xfs
[Top] [All Lists]

Re: [PATCH 1/5] xfs_repair: clear bad flgs in process_dinode_int

To: Eric Sandeen <sandeen@xxxxxxxxxx>
Subject: Re: [PATCH 1/5] xfs_repair: clear bad flgs in process_dinode_int
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Mon, 8 Sep 2014 09:45:12 -0400
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1410108065-18156-2-git-send-email-sandeen@xxxxxxxxxx>
References: <1410108065-18156-1-git-send-email-sandeen@xxxxxxxxxx> <1410108065-18156-2-git-send-email-sandeen@xxxxxxxxxx>
User-agent: Mutt/1.5.23 (2014-03-12)
On Sun, Sep 07, 2014 at 11:41:01AM -0500, Eric Sandeen wrote:
> process_dinode_int() reports bad flags if
> dino->di_flags & ~XFS_DIFLAG_ANY - i.e. if
> any flags are set outside the known set.  But
> then instead of clearing them, it does
> flags &= ~XFS_DIFLAG_ANY which keeps *only*
> the bad flags.  This leads to persistent,
> unrepairable errors of the form:
> 
> "Bad flags set in inode XXX"
> 
> Fix this.
> 
> While we are at it, fix a couple lines which
> look like they used to be continuation lines,
> but are no longer.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> ---

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

>  repair/dinode.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/repair/dinode.c b/repair/dinode.c
> index 8891e84..38a6562 100644
> --- a/repair/dinode.c
> +++ b/repair/dinode.c
> @@ -2456,7 +2456,7 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 
> "\n"),
>       _("Bad flags set in inode %" PRIu64 "\n"),
>                                       lino);
>                       }
> -                     flags &= ~XFS_DIFLAG_ANY;
> +                     flags &= XFS_DIFLAG_ANY;
>               }
>  
>               if (flags & (XFS_DIFLAG_REALTIME | XFS_DIFLAG_RTINHERIT)) {
> @@ -2513,11 +2513,11 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 
> "\n"),
>               }
>               if (!verify_mode && flags != be16_to_cpu(dino->di_flags)) {
>                       if (!no_modify) {
> -                             do_warn(_(", fixing bad flags.\n"));
> +                             do_warn(_("fixing bad flags.\n"));
>                               dino->di_flags = cpu_to_be16(flags);
>                               *dirty = 1;
>                       } else
> -                             do_warn(_(", would fix bad flags.\n"));
> +                             do_warn(_("would fix bad flags.\n"));
>               }
>       }
>  
> -- 
> 1.7.1
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

<Prev in Thread] Current Thread [Next in Thread>