All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] e2fsck: don't check/clone duplicate xattr blocks in fs without xattr feature
@ 2011-02-09 18:41 Eric Sandeen
  2011-03-09 21:01 ` Eric Sandeen
  2011-06-01  0:00 ` Ted Ts'o
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Sandeen @ 2011-02-09 18:41 UTC (permalink / raw)
  To: ext4 development

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] e2fsck: don't check/clone duplicate xattr blocks in fs without xattr feature
  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-06-01  0:00 ` Ted Ts'o
  1 sibling, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2011-03-09 21:01 UTC (permalink / raw)
  To: ext4 development

On 2/9/11 12:41 PM, Eric Sandeen wrote:
> 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>

Ted, ping on this one?  Would like to get it upstream before
pushing it to RHEL, because as we all know now, that's how
we roll at Red Hat.  :)

Thanks,
-Eric

> ---
> 
> 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) ||
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] e2fsck: don't check/clone duplicate xattr blocks in fs without xattr feature
  2011-03-09 21:01 ` Eric Sandeen
@ 2011-05-23 17:52   ` Eric Sandeen
  2011-05-23 18:00     ` Eric Sandeen
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2011-05-23 17:52 UTC (permalink / raw)
  To: ext4 development

On 3/9/11 3:01 PM, Eric Sandeen wrote:
> On 2/9/11 12:41 PM, Eric Sandeen wrote:
>> 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>
> 
> Ted, ping on this one?  Would like to get it upstream before
> pushing it to RHEL, because as we all know now, that's how
> we roll at Red Hat.  :)

Ping again, for review and/or merge of this one, it's approaching 4 months old now...

Thanks,
-Eric

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] e2fsck: don't check/clone duplicate xattr blocks in fs without xattr feature
  2011-05-23 17:52   ` Eric Sandeen
@ 2011-05-23 18:00     ` Eric Sandeen
  2011-05-23 18:04       ` Eric Sandeen
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Sandeen @ 2011-05-23 18:00 UTC (permalink / raw)
  To: ext4 development

On 5/23/11 12:52 PM, Eric Sandeen wrote:

> Ping again, for review and/or merge of this one, it's approaching 4 months old now...
> 

Actually I'll rebase & resend now.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] e2fsck: don't check/clone duplicate xattr blocks in fs without xattr feature
  2011-05-23 18:00     ` Eric Sandeen
@ 2011-05-23 18:04       ` Eric Sandeen
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Sandeen @ 2011-05-23 18:04 UTC (permalink / raw)
  To: ext4 development

On 5/23/11 1:00 PM, Eric Sandeen wrote:
> On 5/23/11 12:52 PM, Eric Sandeen wrote:
> 
>> Ping again, for review and/or merge of this one, it's approaching 4 months old now...
>>
> 
> Actually I'll rebase & resend now.

Argh, I take it back, too many trees, sorry.  Original patch is still fine.

-Eric

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] e2fsck: don't check/clone duplicate xattr blocks in fs without xattr feature
  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-06-01  0:00 ` Ted Ts'o
  1 sibling, 0 replies; 7+ messages in thread
From: Ted Ts'o @ 2011-06-01  0:00 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development

On Wed, Feb 09, 2011 at 12:41:43PM -0600, Eric Sandeen wrote:
> 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>

Applied, sorry for the delay.

						- Ted

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] e2fsck: don't check/clone duplicate xattr blocks in fs without xattr feature
@ 2011-02-09 18:41 Eric Sandeen
  0 siblings, 0 replies; 7+ messages in thread
From: Eric Sandeen @ 2011-02-09 18:41 UTC (permalink / raw)
  To: ext4 development

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-06-01  2:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2011-02-09 18:41 Eric Sandeen

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.