Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294617
b: refs/heads/master
c: ad637a1
h: refs/heads/master
i:
  294615: 927497a
v: v3
  • Loading branch information
Alex Elder authored and Ben Myers committed Feb 25, 2012
1 parent b11b585 commit ea4438e
Show file tree
Hide file tree
Showing 3 changed files with 14 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: 9006fb91cfdf22812923f0536c7531c429c1aeab
refs/heads/master: ad637a10f444fc66b1f6d4a28fe30d4c61ed0161
9 changes: 9 additions & 0 deletions trunk/fs/xfs/xfs_iget.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,15 @@ xfs_iget(
xfs_perag_t *pag;
xfs_agino_t agino;

/*
* xfs_reclaim_inode() uses the ILOCK to ensure an inode
* doesn't get freed while it's being referenced during a
* radix tree traversal here. It assumes this function
* aqcuires only the ILOCK (and therefore it has no need to
* involve the IOLOCK in this synchronization).
*/
ASSERT((lock_flags & (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED)) == 0);

/* reject inode numbers outside existing AGs */
if (!ino || XFS_INO_TO_AGNO(mp, ino) >= mp->m_sb.sb_agcount)
return EINVAL;
Expand Down
10 changes: 4 additions & 6 deletions trunk/fs/xfs/xfs_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,17 +913,15 @@ xfs_reclaim_inode(
* can reference the inodes in the cache without taking references.
*
* We make that OK here by ensuring that we wait until the inode is
* unlocked after the lookup before we go ahead and free it. We get
* both the ilock and the iolock because the code may need to drop the
* ilock one but will still hold the iolock.
* unlocked after the lookup before we go ahead and free it.
*/
xfs_ilock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
xfs_ilock(ip, XFS_ILOCK_EXCL);
xfs_qm_dqdetach(ip);
xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
xfs_iunlock(ip, XFS_ILOCK_EXCL);

xfs_inode_free(ip);
return error;

return error;
}

/*
Expand Down

0 comments on commit ea4438e

Please sign in to comment.