]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsck: don't check/clone duplicate xattr blocks in fs without xattr feature
authorEric Sandeen <sandeen@redhat.com>
Tue, 31 May 2011 23:59:56 +0000 (19:59 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 1 Jun 2011 00:09:08 +0000 (20:09 -0400)
I had an extremely corrupted customer filesystem which, after thousands
of lines of e2fsck output, found one more problem on an immediately
subsequent e2fsck.  In short, a file had had its i_file_acl block
cloned due to being a duplicate.  That ultimately got cleared
because the fs did not have the xattr feature, and the inode
was subsequently removed due to invalid mode.

The 2nd e2fsck pass found the cloned xattr block as in use, but
not owned by any file, and had to fix up the block bitmaps.

Simply skipping the processing of duplicate xattr blocks on a
non-xattr filesystem seems reasonable, since they will be cleared
later in any case.

(also fix existing brace misalignment)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1b.c

index 155fcba4ad920559a65fa26e8339d224149b51b7..9bef36872a782d8cd9c4a9b8cf76ef590a85de9f 100644 (file)
@@ -310,12 +310,14 @@ static void pass1b(e2fsck_t ctx, char *block_buf)
                        pctx.errcode = ext2fs_block_iterate3(fs, ino,
                                             BLOCK_FLAG_READ_ONLY, block_buf,
                                             process_pass1b_block, &pb);
-               if (ext2fs_file_acl_block(&inode)) {
+               /* If the feature is not set, attrs will be cleared later anyway */
+               if ((fs->super->s_feature_compat & EXT2_FEATURE_COMPAT_EXT_ATTR) &&
+                   ext2fs_file_acl_block(&inode)) {
                        blk64_t blk = ext2fs_file_acl_block(&inode);
                        process_pass1b_block(fs, &blk,
                                             BLOCK_COUNT_EXTATTR, 0, 0, &pb);
                        ext2fs_file_acl_block_set(&inode, blk);
-                       }
+               }
                if (pb.dup_blocks) {
                        end_problem_latch(ctx, PR_LATCH_DBLOCK);
                        if (ino >= EXT2_FIRST_INODE(fs->super) ||