Re: [PATCH 25/30 V2] libxfs: fix root inode handling inconsistencies

Christoph Hellwig
2013-10-31T15:00:25Z

On Thu, Oct 31, 2013 at 03:13:43PM +1100, Dave Chinner wrote:
> - if ((flags & LIBXFS_MOUNT_ROOTINOS) && rtmount_inodes(mp)) {
> - if (mp->m_rootip)
> - libxfs_iput(mp->m_rootip, 0);
> + /* set up the realtime inodes if they exist */
> + error = rtmount_inodes(mp);
> + if (error)
> return NULL;
> - }
>
> /*
> * mkfs calls mount before the AGF/AGI structures are written.
> */
> - if ((flags & LIBXFS_MOUNT_ROOTINOS) && sbp->sb_rootino != NULLFSINO &&
> + if (sbp->sb_rootino != NULLFSINO &&
> xfs_sb_version_haslazysbcount(&mp->m_sb)) {

Oh, I hadn't noticed that LIBXFS_MOUNT_ROOTINOS does more than reading
the root inode. Seems like mkfs might need the rt inodes if a file with
the rt flag is specified in the proto file.

I can't see how xfs_copy could need either the rt inodes nor the perag
data.