Commit 3ddfdcea authored by Eric Sandeen's avatar Eric Sandeen Committed by Christoph Hellwig

[XFS] Handle mode 0 inodes that find their way onto the unlinked list

These shouldn't be there, probably the result of corruption.
However, if we find one, handle it specially so that we don't
deadlock during unlinked list processing in recovery.  Without
xfs_iput_new, we'd be waiting on an inode lock we already hold.

SGI Modid: 2.5.x-xfs:slinx:136535a
parent 5510dcc8
...@@ -2952,7 +2952,6 @@ xlog_recover_process_iunlinks(xlog_t *log) ...@@ -2952,7 +2952,6 @@ xlog_recover_process_iunlinks(xlog_t *log)
if (!error) { if (!error) {
ASSERT(ip->i_d.di_nlink == 0); ASSERT(ip->i_d.di_nlink == 0);
ASSERT(ip->i_d.di_mode != 0);
/* setup for the next pass */ /* setup for the next pass */
agino = INT_GET(dip->di_next_unlinked, agino = INT_GET(dip->di_next_unlinked,
...@@ -2970,7 +2969,9 @@ xlog_recover_process_iunlinks(xlog_t *log) ...@@ -2970,7 +2969,9 @@ xlog_recover_process_iunlinks(xlog_t *log)
ip->i_d.di_dmevmask = 0; ip->i_d.di_dmevmask = 0;
/* /*
* Drop our reference to the * If this is a new inode, handle
* it specially. Otherwise,
* just drop our reference to the
* inode. If there are no * inode. If there are no
* other references, this will * other references, this will
* send the inode to * send the inode to
...@@ -2978,6 +2979,9 @@ xlog_recover_process_iunlinks(xlog_t *log) ...@@ -2978,6 +2979,9 @@ xlog_recover_process_iunlinks(xlog_t *log)
* truncate the file and free * truncate the file and free
* the inode. * the inode.
*/ */
if (ip->i_d.di_mode == 0)
xfs_iput_new(ip, 0);
else
VN_RELE(XFS_ITOV(ip)); VN_RELE(XFS_ITOV(ip));
} else { } else {
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment