All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Subject: [PATCH] e2fsck: don't check/clone duplicate xattr blocks in fs without xattr feature
Date: Wed, 09 Feb 2011 12:41:37 -0600	[thread overview]
Message-ID: <4D52DFE1.4090709@redhat.com> (raw)

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>
---

diff --git a/e2fsck/pass1b.c b/e2fsck/pass1b.c
index 155fcba..2ddaeb4 100644
--- a/e2fsck/pass1b.c
+++ b/e2fsck/pass1b.c
@@ -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) ||

             reply	other threads:[~2011-02-09 18:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09 18:41 Eric Sandeen [this message]
2011-02-09 18:41 [PATCH] e2fsck: don't check/clone duplicate xattr blocks in fs without xattr feature Eric Sandeen
2011-03-09 21:01 ` Eric Sandeen
2011-05-23 17:52   ` Eric Sandeen
2011-05-23 18:00     ` Eric Sandeen
2011-05-23 18:04       ` Eric Sandeen
2011-06-01  0:00 ` Ted Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D52DFE1.4090709@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.