]> git.baikalelectronics.ru Git - kernel.git/commit
[XFS] Prevent a deadlock when xfslogd unpins inodes.
authorDavid Chinner <dgc@sgi.com>
Sat, 11 Nov 2006 07:05:00 +0000 (18:05 +1100)
committerTim Shimmin <tes@sgi.com>
Sat, 11 Nov 2006 07:05:00 +0000 (18:05 +1100)
commitdae2aee1cb2739b2dcd68bbe4dc741b945a5df88
tree72d591ce30b7bcc8e08b20aa325ac4360921f028
parent023c085d709dc38e2148cbc9a296cf0d6a7f4108
[XFS] Prevent a deadlock when xfslogd unpins inodes.

The previous fixes for the use after free in xfs_iunpin left a nasty log
deadlock when xfslogd unpinned the inode and dropped the last reference to
the inode. the ->clear_inode() method can issue transactions, and if the
log was full, the transaction could push on the log and get stuck trying
to push the inode it was currently unpinning.

To fix this, we provide xfs_iunpin a guarantee that it will always have a
valid xfs_inode <-> linux inode link or a particular flag will be set on
the inode. We then use log forces during lookup to ensure transactions are
completed before we recycle the inode. This ensures that xfs_iunpin will
never use the linux inode after it is being freed, and any lookup on an
inode on the reclaim list will wait until it is safe to attach a new linux
inode to the xfs inode.

SGI-PV: 956832
SGI-Modid: xfs-linux-melb:xfs-kern:27359a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Shailendra Tripathi <stripathi@agami.com>
Signed-off-by: Takenori Nagano <t-nagano@ah.jp.nec.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
fs/xfs/xfs_iget.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_vnodeops.c