linux-hardened/fs/ubifs
Artem Bityutskiy 1a9476a770 UBIFS: fix assertion warnings in comparison function
When running the integrity test ('integck' from mtd-utils) on current
UBIFS on 2.6.35, I see that assertions in UBIFS 'list_sort()' comparison
functions trigger sometimes, e.g.:

UBIFS assert failed in data_nodes_cmp at 132 (pid 28311)

My investigation showed that this happens when 'list_sort()' calls the 'cmp()'
function with equivalent arguments. In this case, the 'struct list_head'
parameter, passed to 'cmp()' is bogus, and it does not belong to any element in
the original list.

And this issue seems to be introduced by commit:

commit 835cc0c847
Author: Don Mullis <don.mullis@gmail.com>
Date:   Fri Mar 5 13:43:15 2010 -0800

It is easy to work around the issue by doing:

if (a == b)
	return 0;

in UBIFS. It works, but 'lib_sort()' should nevertheless be fixed. Although it
is harmless to have this piece of code in UBIFS.

This patch adds that code to both UBIFS 'cmp()' functions:
'data_nodes_cmp()' and 'nondata_nodes_cmp()'.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-08-30 10:19:08 +03:00
..
budget.c writeback: enforce s_umount locking in writeback_inodes_sb 2010-06-11 12:58:07 +02:00
commit.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
compress.c UBIFS: fix sparse warnings 2008-12-31 14:13:24 +02:00
debug.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
debug.h UBIFS: improve journal head debugging prints 2009-09-15 17:05:06 +03:00
dir.c ubifs: replace inode uid,gid,mode initialization with helper function 2010-05-21 18:31:26 -04:00
file.c check ATTR_SIZE contraints in inode_change_ok 2010-08-09 16:47:39 -04:00
find.c UBIFS: improve find function interface 2009-03-08 13:29:09 +02:00
gc.c UBIFS: fix assertion warnings in comparison function 2010-08-30 10:19:08 +03:00
io.c UBIFS: mark VFS SB RO too 2010-04-29 15:12:18 +03:00
ioctl.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
journal.c UBIFS: improve journal head debugging prints 2009-09-15 17:05:06 +03:00
Kconfig Revert "lib: build list_sort() only if needed" 2010-03-07 09:54:44 -08:00
key.h UBIFS: mark unused key objects as invalid 2010-08-30 10:19:08 +03:00
log.c UBIFS: improve journal head debugging prints 2009-09-15 17:05:06 +03:00
lprops.c UBIFS: improve lprops dump 2009-09-15 17:09:48 +03:00
lpt.c UBIFS: use ERR_CAST 2010-06-12 14:46:15 +03:00
lpt_commit.c UBIFS: use ERR_CAST 2010-06-12 14:46:15 +03:00
Makefile
master.c UBIFS: check ubifs_scan error codes better 2009-09-10 12:06:47 +03:00
misc.h UBIFS: inline one-line functions 2008-09-30 11:12:56 +03:00
orphan.c UBIFS: check ubifs_scan error codes better 2009-09-10 12:06:47 +03:00
recovery.c UBIFS: fix GC LEB recovery 2010-07-13 06:51:57 +03:00
replay.c UBIFS: do not print scary error messages needlessly 2009-09-10 12:06:47 +03:00
sb.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
scan.c UBIFS: mark unused key objects as invalid 2010-08-30 10:19:08 +03:00
shrinker.c mm: add context argument to shrinker callback 2010-07-19 14:56:17 +10:00
super.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2010-08-10 11:26:52 -07:00
tnc.c UBIFS: mark unused key objects as invalid 2010-08-30 10:19:08 +03:00
tnc_commit.c UBIFS: do not print scary error messages needlessly 2009-09-10 12:06:47 +03:00
tnc_misc.c UBIFS: correct key comparison 2008-09-30 11:12:57 +03:00
ubifs-media.h UBIFS: define journal head numbers in ubifs-media.h 2009-09-15 14:45:35 +03:00
ubifs.h UBIFS: mark unused key objects as invalid 2010-08-30 10:19:08 +03:00
xattr.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00