xfs
[Top] [All Lists]

Re: [PATCH 4/4] xfs_repair: set *parent if process_dir2_data() fixes roo

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH 4/4] xfs_repair: set *parent if process_dir2_data() fixes root inode's parent
From: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
Date: Mon, 9 Mar 2015 15:50:58 -0300
Cc: Eric Sandeen <sandeen@xxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <54F772D2.2030602@xxxxxxxxxxx>
Mail-followup-to: Eric Sandeen <sandeen@xxxxxxxxxxx>, Eric Sandeen <sandeen@xxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
References: <54F77199.8030708@xxxxxxxxxx> <54F772D2.2030602@xxxxxxxxxxx>
User-agent: Mutt/1.5.23 (2014-03-12)
Makes sense to me.

Reviewed-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>

Thanks Eric :-)

Cheers,

On Wed, Mar 04, 2015 at 03:02:10PM -0600, Eric Sandeen wrote:
> process_dir2_data() may fix the root dir's parent inode:
> 
> "bad .. entry in root directory inode 6912, was 7159: correcting"
> 
> But we don't update the *parent passed in in that case; this then leads to
> an assert later in process_dir2, because *parent is still the wrong value:
> 
> xfs_repair: dir2.c:2039: process_dir2:
>   Assertion `(ino != mp->m_sb.sb_rootino && ino != *parent) ||
>   (ino == mp->m_sb.sb_rootino && (ino == *parent || need_root_dotdot == 1))'
>   failed.
> 
> Updating the value of *parent when we fix the parent value resolves this
> problem.  Do it whether or not we're in no_modify mode.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> ---
> 
> diff --git a/repair/dir2.c b/repair/dir2.c
> index 6b8964d..67cd9d1 100644
> --- a/repair/dir2.c
> +++ b/repair/dir2.c
> @@ -1468,6 +1468,7 @@ _("bad .. entry in root directory inode %" PRIu64 ", 
> was %" PRIu64 ": "),
>                                       } else {
>                                               do_warn(_("would correct\n"));
>                                       }
> +                                     *parent = ino;
>                               }
>                       }
>                       /*
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

-- 
Carlos

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