Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 222791
b: refs/heads/master
c: de25c18
h: refs/heads/master
i:
  222789: 23fd758
  222787: f7b0afb
  222783: 8e9b032
v: v3
  • Loading branch information
Dave Chinner authored and Alex Elder committed Dec 1, 2010
1 parent 32ed312 commit b495711
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 309c848002052edbec650075a1eb098b17c17f35
refs/heads/master: de25c1818c44f580ff556cb9e0f7a1c687ed870b
31 changes: 25 additions & 6 deletions trunk/fs/xfs/xfs_inode_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,18 +657,37 @@ xfs_inode_item_unlock(
}

/*
* This is called to find out where the oldest active copy of the
* inode log item in the on disk log resides now that the last log
* write of it completed at the given lsn. Since we always re-log
* all dirty data in an inode, the latest copy in the on disk log
* is the only one that matters. Therefore, simply return the
* given lsn.
* This is called to find out where the oldest active copy of the inode log
* item in the on disk log resides now that the last log write of it completed
* at the given lsn. Since we always re-log all dirty data in an inode, the
* latest copy in the on disk log is the only one that matters. Therefore,
* simply return the given lsn.
*
* If the inode has been marked stale because the cluster is being freed, we
* don't want to (re-)insert this inode into the AIL. There is a race condition
* where the cluster buffer may be unpinned before the inode is inserted into
* the AIL during transaction committed processing. If the buffer is unpinned
* 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
* 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
* triggers an assert in xfs_inode_free() complaining about freein an inode
* still in the AIL.
*
* To avoid this, return a lower LSN than the one passed in so that the
* transaction committed code will not move the inode forward in the AIL but
* will still unpin it properly.
*/
STATIC xfs_lsn_t
xfs_inode_item_committed(
struct xfs_log_item *lip,
xfs_lsn_t lsn)
{
struct xfs_inode_log_item *iip = INODE_ITEM(lip);
struct xfs_inode *ip = iip->ili_inode;

if (xfs_iflags_test(ip, XFS_ISTALE))
return lsn - 1;
return lsn;
}

Expand Down

0 comments on commit b495711

Please sign in to comment.