jffs2: Fix long-standing bug with symlink garbage collection.
commit257d82180713789bf57e59c9d32bdd1531c63a44
authorDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 16 Dec 2009 03:27:20 +0000 (16 03:27 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 21:44:21 +0000 (18 13:44 -0800)
treee3ceaa15b28432c727e4dafd2724a66996a979cb
parent2dcc81df4c1364aea736598cccbf751f03f5249b
jffs2: Fix long-standing bug with symlink garbage collection.

commit 2e16cfca6e17ae37ae21feca080a6f2eca9087dc upstream.

Ever since jffs2_garbage_collect_metadata() was first half-written in
February 2001, it's been broken on architectures where 'char' is signed.
When garbage collecting a symlink with target length above 127, the payload
length would end up negative, causing interesting and bad things to happen.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/jffs2/gc.c