Commit [3a0345] Maximize Restore History

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>

David Woodhouse David Woodhouse 2009-12-16

Greg Kroah-Hartman Greg Kroah-Hartman 2009-12-18

changed fs/jffs2/gc.c
fs/jffs2/gc.c Diff Switch to side-by-side view
Loading...