On Mar 30, 2007 20:44 -0400, Theodore Tso wrote: > On Wed, Feb 21, 2007 at 02:45:59PM +0530, Kalpak Shah wrote: > > If the mode of a directory gets corrupted, check_filetype() makes > > wrong decisions for all its sub-directories. For example, using > > debugfs we can corrupt the mode of a directory to 0140755 (i.e. a > > socket). e2fsck will set the filetype of all its subdirectories as 6 > > (filetype for socket). All the subdirectories would be moved to > > lost+found, and in second run of e2fsck their filetype would be set > > back to 2. > > Um, I'm not seeing this. Using stock e2fsprogs, given the following > test image, I'm not seeing the behavior you describe. The log of the e2fsck (on a test filesystem with deliberately introduced corruption) is available at: https://bugzilla.lustre.org/show_bug.cgi?id=11645 I've also added a testcase (created by making a parent directory with several subdirs, then using debugfs to change the mode of the parent directory). https://bugzilla.lustre.org/attachment.cgi?id=9958 (also attached here). It doesn't exhibit the filetype breakage in the upstream e2fsck because the test is run with the patch applied, but it does still show the "size is wrong on second e2fsck" problem you observed. The test case is created as if that problem was also fixed already (i.e. second e2fsck is clean). Cheers, Andreas -- Andreas Dilger Principal Software Engineer Cluster File Systems, Inc.
Attachment:
e2fsprogs-tests-f_check_filetype.patch
Description: Binary data