]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Fix e2fsck's check_is_really_dir logic
authorTheodore Ts'o <tytso@mit.edu>
Sat, 14 Apr 2007 16:01:39 +0000 (12:01 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 14 Apr 2007 16:01:39 +0000 (12:01 -0400)
Fix a typo which could cause e2fsck to throw an I/O error while doubling
checking whether or not a special device file was really an inode.
Also, don't do this tests on symbolic links since for filesystems with a
large numbers of symlinks it could degrade performance and increases the
risk for false positives.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/ChangeLog
e2fsck/pass1.c

index 2795e464cb716844283c478ea93b29e4a84d2900..7fc700a05ee90e1d5a885873692098379754a6de 100644 (file)
@@ -4,6 +4,14 @@
                markers so it is clearer what e2fsck was doing when an I/O
                error is reported.
 
+       *pass1.c (check_is_really_dir): Fix a typo which could cause
+               e2fsck to throw an I/O error while doubling checking
+               whether or not a special device file was really an inode.
+               Also, don't do this tests on symbolic links since for
+               filesystems with a large numbers of symlinks it could
+               degrade performance and increases the risk for false
+               positives.
+
 2007-04-10  Jim Garlick <garlick@llnl.gov>
 
        * pass1b.c (search_dirent_proc): if a file has multiple hard
index 628157385546ace4f74e0f3b3d026932810d1b8e..19b88649ea47ae553f8231963857fa6b78a5b0c9 100644 (file)
@@ -391,10 +391,10 @@ static void check_is_really_dir(e2fsck_t ctx, struct problem_context *pctx,
        int                     i, not_device = 0;
 
        if (LINUX_S_ISDIR(inode->i_mode) || LINUX_S_ISREG(inode->i_mode) ||
-               inode->i_block[0] == 0)
+           LINUX_S_ISLNK(inode->i_mode) || inode->i_block[0] == 0)
                return;
 
-       for (i=1; i < EXT2_N_BLOCKS; i++) {
+       for (i=0; i < EXT2_N_BLOCKS; i++) {
                blk = inode->i_block[i];
                if (!blk)
                        continue;
@@ -411,9 +411,6 @@ static void check_is_really_dir(e2fsck_t ctx, struct problem_context *pctx,
            (inode->i_links_count == 1) && !not_device)
                return;
 
-       if (LINUX_S_ISLNK(inode->i_mode) && inode->i_links_count == 1)
-               return;
-
        old_op = ehandler_operation(_("reading directory block"));
        retval = ext2fs_read_dir_block(ctx->fs, inode->i_block[0], buf);
        ehandler_operation(0);