xfs
[Top] [All Lists]

Re: [PATCH 15/37] libxfs: fix root inode handling inconsistencies

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 15/37] libxfs: fix root inode handling inconsistencies
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 6 Nov 2013 02:23:34 -0800
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1383700043-32305-16-git-send-email-david@xxxxxxxxxxxxx>
References: <1383700043-32305-1-git-send-email-david@xxxxxxxxxxxxx> <1383700043-32305-16-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Nov 06, 2013 at 12:07:01PM +1100, Dave Chinner wrote:
>       mp = libxfs_mount(&xmount, sbp, x.ddev, x.logdev, x.rtdev,
> -                             LIBXFS_MOUNT_ROOTINOS | LIBXFS_MOUNT_DEBUGGER);
> +                       LIBXFS_MOUNT_DEBUGGER);
>       if (!mp) {
> -             mp = libxfs_mount(&xmount, sbp, x.ddev, x.logdev, x.rtdev,
> -                             LIBXFS_MOUNT_DEBUGGER);
> -             if (!mp) {
> -                     fprintf(stderr, _("%s: device %s unusable (not an XFS "
> -                             "filesystem?)\n"), progname, fsdevice);
> -                     exit(1);
> -             }
> +             fprintf(stderr,
> +                     _("%s: device %s unusable (not an XFS filesystem?)\n"),
> +                     progname, fsdevice);
> +             exit(1);
>       }
>       blkbb = 1 << mp->m_blkbb_log;
>  
> +     /*
> +      * xfs_check needs corrected incore superblock values
> +      */
> +     if (sbp->sb_rootino != NULLFSINO &&
> +         xfs_sb_version_haslazysbcount(&mp->m_sb)) {
> +             int error = xfs_initialize_perag_data(mp, sbp->sb_agcount);
> +             if (error) {
> +                     fprintf(stderr, _("%s: cannot init perag data (%d)\n"),
> +                             progname, error);
> +                     exit(EXIT_FAILURE);

The old code above just goes ahead without the perage data due to the
retry without LIBXFS_MOUNT_ROOTINOS.  I think we should keep that
behaviour as we want to be able to run xfs_db under as many
circumstances as possible.

Otherwise looks good,

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

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