OSDN Git Service

libext2fs: Fix a corner case bug in ext2fs_unlink
authorTheodore Ts'o <tytso@mit.edu>
Sat, 1 Dec 2007 12:08:45 +0000 (07:08 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 2 Dec 2007 10:25:30 +0000 (05:25 -0500)
commit7e5a86a66044c4bf4021d1e2900a8748011f17b5
tree8f90ba0068a03ae381bcdfbdf9aac2991cacd4d7
parent8cdd6a6f34a66806fb200f2a55c8fa4142d79511
libext2fs: Fix a corner case bug in ext2fs_unlink

We cannot merge a removed directory entry to just arbitrary previous
directory entry. The previous entry must be in the same block.  So
really bad things can happen when are deleting the first directory
entry in a block where the last directory entry in the previous
directory block is not in use.  We fix this bug by checking to see if
the current entry is not the first one in the block before trying to
merge it to the previous entry.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/unlink.c