xfs
[Top] [All Lists]

Re: XFS regression?

To: Bhagi rathi <jahnu77@xxxxxxxxx>
Subject: Re: XFS regression?
From: David Chinner <dgc@xxxxxxx>
Date: Mon, 15 Oct 2007 09:09:49 +1000
Cc: Andrew Clayton <andrew@xxxxxxxxxxxxxxxxxx>, David Chinner <dgc@xxxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
In-reply-to: <cc7060690710130635u2a85bc28we36b344c0987b691@xxxxxxxxxxxxxx>
References: <20071010152742.1b2a7bce@xxxxxxxxxxxxxx> <20071011010139.GT995458@xxxxxxx> <20071011151512.69f19419@xxxxxxxxxxxxxx> <20071011215352.GX995458@xxxxxxx> <20071012002613.GL23367404@xxxxxxx> <20071012123601.291fee8a@xxxxxxxxxxxxxx> <cc7060690710130635u2a85bc28we36b344c0987b691@xxxxxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
On Sat, Oct 13, 2007 at 07:05:17PM +0530, Bhagi rathi wrote:
> David, Can you let me know the use after free problem? I want to understand
> how the life cycle of linux inode
> and xfs inode are related to log flush.

Log I/O completion:

  -> xfs_trans_commited
       -> xfs_iunpin(xfs inode)
         get linux inode from xfs inode
          -> mark_inode_dirty_sync(linux inode)

Freeing the linux inode:

clear_inode(linux_inode)
 -> xfs_inactive()
    -> xfs_trans_commit() (e.g. freeing data associated with unlinked inode)
       -> xfs_ipin()
    (link between xfs and linux inode broken)
  linux inode freed 
 
So, in log I/O completion, we can be completing a previous
transaction at the same time clear_inode() is running, and
hence in xfs_iunpin() we can race with the freeing of the
linux inode as xfs_iunpin does not hold any locks.

> Any pointer is also of great help.

/me points at the code.

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group


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