xfs
[Top] [All Lists]

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

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 25/30] libxfs: fix root inode handling inconsistencies
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 31 Oct 2013 08:59:40 +1100
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20131030102318.GA31519@xxxxxxxxxxxxx>
References: <1383107481-28937-1-git-send-email-david@xxxxxxxxxxxxx> <1383107481-28937-26-git-send-email-david@xxxxxxxxxxxxx> <20131030102318.GA31519@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Oct 30, 2013 at 03:23:18AM -0700, Christoph Hellwig wrote:
> On Wed, Oct 30, 2013 at 03:31:16PM +1100, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@xxxxxxxxxx>
> > 
> > When "mounting" a filesystem via libxfs_mount(), callers can tell
> > libxfs to read the root and realtime inodes into cache. However,
> > when unmounting the filesystem, libxfs_unmount() used to
> > unconditionally free root inodes if they were present.
> > 
> > This leads to interesting issues like in mkfs, when it handles
> > creation, reading and freeing of the root and rt inodes itself.
> > It, however, passes in the flag to tell libxfs_mount() to read the
> > root inode, and so when unmounting throws an error like:
> > 
> > cache_node_put: node put on refcount 0 (node=0x684610)
> > 
> > When a second libxfs_iput() call is made on the root inode.
> > 
> > Clean this up and fix up all the callers that use magic numbers
> > rather than symbolic values to tell libxfs tomount the root inodes.
> 
> I think the right fix is to kill LIBXFS_MOUNT_ROOTINOS as nothing
> ever uses mp->m_rootip.

Good point - I never looked at the users of mp->m_rootip, so didn't
notice this. I'll redo this patch to kill LIBXFS_MOUNT_ROOTINOS.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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