History log of /linux-master/fs/befs/btree.c
Revision Date Author Comments
# 73919280 08-May-2023 Azeem Shaikh <azeemshaikh38@gmail.com>

befs: Replace all non-returning strlcpy with strscpy

strlcpy() reads the entire source buffer first.
This read may exceed the destination size limit.
This is both inefficient and can lead to linear read
overflows if a source string is not NUL-terminated.
In an effort to remove strlcpy() completely, replace
strlcpy() here with strscpy().
No return values were used, so direct replacement is safe.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
[2] https://github.com/KSPP/linux/issues/89

Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230509014136.2095900-1-azeemshaikh38@gmail.com


# 799ce1dbb 09-Jul-2017 Tommy Nguyen <remyabel@gmail.com>

befs: add kernel-doc formatting for befs_bt_read_super()

fs/befs/TODO mentions some comments needing conversion to Kernel-Doc
formatting. This patch changes the comment describing befs_bt_read_super().

Signed-off-by: Tommy Nguyen <remyabel@gmail.com>
Signed-off-by: Luis de Bethencourt <luisbg@kernel.org>


# e60f749b 10-Nov-2016 Luis de Bethencourt <luisbg@osg.samsung.com>

befs: remove trailing whitespaces

Removing all trailing whitespaces in befs.

I was skeptic about tainting the history with this, but whitespace changes
can be ignored by using 'git blame -w' and 'git log -w'.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>


# 02d91f97 11-Aug-2016 Luis de Bethencourt <luisbg@osg.samsung.com>

befs: fix typos in btree.c

Fixing typos in kernel-doc function descriptions in fs/befs/btree.c.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Salah Triki <salah.triki@gmail.com>


# bb75e666 08-Aug-2016 Luis de Bethencourt <luisbg@osg.samsung.com>

befs: fix typo in befs_find_key

Fixing skeep to skip.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Salah Triki <salah.triki@gmail.com>


# 672a8515 08-Aug-2016 Luis de Bethencourt <luisbg@osg.samsung.com>

befs: remove unused BEFS_BT_PARMATCH

befs_btree_find(), the only caller of befs_find_key(), only cares about if
the return from that function is BEFS_BT_MATCH or not. It never uses the
partial match given with BEFS_BT_PARMATCH. Make the overflow return clearer
by having BEFS_BT_OVERFLOW instead of BEFS_BT_PARMATCH.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Salah Triki <salah.triki@gmail.com>


# 143d2a61 31-Jul-2016 Salah Triki <salah.triki@gmail.com>

fs: befs: remove useless initialization to zero

node_off is unconditionally set to bt_super.root_node_ptr, so no need to
init it to zero.

Signed-off-by: Salah Triki <salah.triki@gmail.com>
Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>


# 88ff3444 31-Jul-2016 Salah Triki <salah.triki@gmail.com>

fs: befs: remove in vain variable assignment

There is no need to set *value, it will be overwritten later.

Signed-off-by: Salah Triki <salah.triki@gmail.com>
Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>


# 4bb59432 26-Jul-2016 Salah Triki <salah.triki@gmail.com>

fs: befs: Coding style fix

Constant has to be capitalized.

Signed-off-by: Salah Triki <salah.triki@gmail.com>
Acked-by: Luis de Bethencourt <luisbg@osg.samsung.com>


# 2dfa8a6e 11-Jul-2016 Luis de Bethencourt <luisbg@osg.samsung.com>

befs: fix typo in befs_bt_read_node documentation

Fixing a grammatical error in the documentation.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>


# cfe0cb20 11-Jul-2016 Luis de Bethencourt <luisbg@osg.samsung.com>

befs: in memory free_node_ptr and max_size never read

The only place the values of free_node_ptr and max_size are read is in
befs_dump_index_entry(), which both times it is called, it is passed the on
disk superblock. Removing assignment of unused values.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>


# 4c3897cc 03-Jul-2016 Luis de Bethencourt <luisbg@osg.samsung.com>

befs: make consistent use of befs_error()

befs_error() is used in potential errors that could happen in befs to
provide informational log messages. befs_debug() is silent when
CONFIG_BEFS_DEBUG=no, and very verbose when switched on, which is why it is
used for general debugging but not for errors.

Fix a few cases where the befs debug utility usage isn't following the
expected pattern. To make sure we have consistent information in the logs.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>


# 22341d8f 10-May-2016 Al Viro <viro@zeniv.linux.org.uk>

befs: constify stuff a bit

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


# 9f0f564a 25-Jun-2015 Fabian Frederick <fabf@skynet.be>

fs/befs/btree.c: remove unneeded initializations

bh, od_sup and this_node are unconditionally initialized in
befs_bt_read_super() and befs_btree_find()

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 0f2a84f4 13-Oct-2014 Himangi Saraogi <himangi774@gmail.com>

fs/befs/btree.c: remove typedef befs_btree_node

The Linux kernel coding style guidelines suggest not using typedefs for
structure types. This patch gets rid of the typedef for befs_btree_node.

The following Coccinelle semantic patch detects the case.

@tn1@
type td;
@@

typedef struct { ... } td;

@script:python tf@
td << tn1.td;
tdres;
@@

coccinelle.tdres = td;

@@
type tn1.td;
identifier tf.tdres;
@@

-typedef
struct
+ tdres
{ ... }
-td
;

@@
type tn1.td;
identifier tf.tdres;
@@

-td
+ struct tdres

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 817e1d90 06-Jun-2014 Fabian Frederick <fabf@skynet.be>

fs/befs: kernel-doc fixes

Fix some comment errors.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 6cb103b6 06-Jun-2014 Fabian Frederick <fabf@skynet.be>

fs/befs/btree.c: replace strncpy by strlcpy + coding style fixing

- strncpy + end of string assignement replaced by strlcpy

- Fix endif };

- Fix typo

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# dac52fc1 03-Apr-2014 Fabian Frederick <fabf@skynet.be>

BEFS: logging cleanup

Summary:
- all printk(KERN_foo converted to pr_foo()
- add pr_fmt and remove redundant prefixes
- convert befs_() to va_format (based on patch by Joe Perches)
- remove non standard %Lu
- use __func__ for all debugging

[akpm@linux-foundation.org: fix printk warnings, reported by Fengguang]
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Joe Perches <joe@perches.com>
Cc: Fengguang Wu <fengguang.wu@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# ee68a3c6 11-Mar-2013 Zhang Yanfei <zhangyanfei@cn.fujitsu.com>

fs: befs: remove cast for kmalloc return value

remove cast for kmalloc return value.

Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 25985edc 30-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi>

Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>


# c78bad11 03-Feb-2008 Joe Perches <joe@perches.com>

fs/: Spelling fixes

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>


# 5cbded58 13-Dec-2006 Robert P. J. Day <rpjday@mindspring.com>

[PATCH] getting rid of all casts of k[cmz]alloc() calls

Run this:

#!/bin/sh
for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
echo "De-casting $f..."
perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
done

And then go through and reinstate those cases where code is casting pointers
to non-pointers.

And then drop a few hunks which conflicted with outstanding work.

Cc: Russell King <rmk@arm.linux.org.uk>, Ian Molton <spyro@f2s.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Greg KH <greg@kroah.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Paul Fulghum <paulkf@microgate.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Karsten Keil <kkeil@suse.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Ian Kent <raven@themaw.net>
Cc: Steven French <sfrench@us.ibm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# a9721f31 24-Dec-2005 Al Viro <viro@ftp.linux.org.uk>

[PATCH] befs: endianness annotations

split the data structures that exist in host- and disk-endian variants,
annotate the fields of disk-endian ones, propagate changes.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# af10b008 23-Dec-2005 Al Viro <viro@ftp.linux.org.uk>

[PATCH] befs: prepare to sanitizing headers

pulled includes of endian.h from fs/befs/*.c to befs.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 1da177e4 16-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org>

Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!