Commit 54af2bd2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: unpin stale inodes directly in IOP_COMMITTED
parents c60ffcbb 1316d4da
...@@ -681,15 +681,15 @@ xfs_inode_item_unlock( ...@@ -681,15 +681,15 @@ xfs_inode_item_unlock(
* where the cluster buffer may be unpinned before the inode is inserted into * where the cluster buffer may be unpinned before the inode is inserted into
* the AIL during transaction committed processing. If the buffer is unpinned * the AIL during transaction committed processing. If the buffer is unpinned
* before the inode item has been committed and inserted, then it is possible * before the inode item has been committed and inserted, then it is possible
* for the buffer to be written and IO completions before the inode is inserted * for the buffer to be written and IO completes before the inode is inserted
* into the AIL. In that case, we'd be inserting a clean, stale inode into the * into the AIL. In that case, we'd be inserting a clean, stale inode into the
* AIL which will never get removed. It will, however, get reclaimed which * AIL which will never get removed. It will, however, get reclaimed which
* triggers an assert in xfs_inode_free() complaining about freein an inode * triggers an assert in xfs_inode_free() complaining about freein an inode
* still in the AIL. * still in the AIL.
* *
* To avoid this, return a lower LSN than the one passed in so that the * To avoid this, just unpin the inode directly and return a LSN of -1 so the
* transaction committed code will not move the inode forward in the AIL but * transaction committed code knows that it does not need to do any further
* will still unpin it properly. * processing on the item.
*/ */
STATIC xfs_lsn_t STATIC xfs_lsn_t
xfs_inode_item_committed( xfs_inode_item_committed(
...@@ -699,8 +699,10 @@ xfs_inode_item_committed( ...@@ -699,8 +699,10 @@ xfs_inode_item_committed(
struct xfs_inode_log_item *iip = INODE_ITEM(lip); struct xfs_inode_log_item *iip = INODE_ITEM(lip);
struct xfs_inode *ip = iip->ili_inode; struct xfs_inode *ip = iip->ili_inode;
if (xfs_iflags_test(ip, XFS_ISTALE)) if (xfs_iflags_test(ip, XFS_ISTALE)) {
return lsn - 1; xfs_inode_item_unpin(lip, 0);
return -1;
}
return lsn; return lsn;
} }
......
...@@ -1361,7 +1361,7 @@ xfs_trans_item_committed( ...@@ -1361,7 +1361,7 @@ xfs_trans_item_committed(
lip->li_flags |= XFS_LI_ABORTED; lip->li_flags |= XFS_LI_ABORTED;
item_lsn = IOP_COMMITTED(lip, commit_lsn); item_lsn = IOP_COMMITTED(lip, commit_lsn);
/* If the committed routine returns -1, item has been freed. */ /* item_lsn of -1 means the item needs no further processing */
if (XFS_LSN_CMP(item_lsn, (xfs_lsn_t)-1) == 0) if (XFS_LSN_CMP(item_lsn, (xfs_lsn_t)-1) == 0)
return; return;
...@@ -1474,7 +1474,7 @@ xfs_trans_committed_bulk( ...@@ -1474,7 +1474,7 @@ xfs_trans_committed_bulk(
lip->li_flags |= XFS_LI_ABORTED; lip->li_flags |= XFS_LI_ABORTED;
item_lsn = IOP_COMMITTED(lip, commit_lsn); item_lsn = IOP_COMMITTED(lip, commit_lsn);
/* item_lsn of -1 means the item was freed */ /* item_lsn of -1 means the item needs no further processing */
if (XFS_LSN_CMP(item_lsn, (xfs_lsn_t)-1) == 0) if (XFS_LSN_CMP(item_lsn, (xfs_lsn_t)-1) == 0)
continue; continue;
......
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