xfs
[Top] [All Lists]

Re: [PATCH 4/4] xfs: fix deadlock in xfs_rtfree_extent with kernel v2.6.

To: kdasu <kdasu.kdev@xxxxxxxxx>
Subject: Re: [PATCH 4/4] xfs: fix deadlock in xfs_rtfree_extent with kernel v2.6.37
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Sun, 19 Feb 2012 17:41:18 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <33346051.post@xxxxxxxxxxxxxxx>
References: <33345988.post@xxxxxxxxxxxxxxx> <33346009.post@xxxxxxxxxxxxxxx> <33346035.post@xxxxxxxxxxxxxxx> <33346043.post@xxxxxxxxxxxxxxx> <33346051.post@xxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Feb 17, 2012 at 03:00:09PM -0800, kdasu wrote:
> 
> 
> On the 2.6.37 kernel, xfs_fs_evict_inode() leads to a deadlock when
> freeing multiple realtime extents. On further debugging the root
> cause it was determined to be recursive locking of the RT bitmap
> inode during evict operation within the same task context.
> The same vfs evict sequence is replayed by the xfs log recovery on
> mounts on a reboot after the problem happens first time.
> This problem exists on kernel v2.6.39 as well.

I think you're better off fixing this problem like I did for the
allocation side, that is:

 - remove the xfs_ilock and xfs_trans_ijoin (or probably still
   xfs_trans_iget in your version) from xfs_rtfree_extent, and
   instead add asserts that the inode is locked and has an inode_item
   attach to it.
 - in xfs_bunmapi if we are dealing with an inode with the rt flag
   bump the reference count on the inode there and attach it to the
   transaction before calling into xfs_bmap_del_extent, similar to
   what we do in xfs_bmap_rtalloc.

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