aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_iget.c9
-rw-r--r--fs/xfs/xfs_sync.c10
2 files changed, 13 insertions, 6 deletions
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index 19dcfb2aac9a..37f22dad5f59 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -418,6 +418,15 @@ xfs_iget(
418 xfs_perag_t *pag; 418 xfs_perag_t *pag;
419 xfs_agino_t agino; 419 xfs_agino_t agino;
420 420
421 /*
422 * xfs_reclaim_inode() uses the ILOCK to ensure an inode
423 * doesn't get freed while it's being referenced during a
424 * radix tree traversal here. It assumes this function
425 * aqcuires only the ILOCK (and therefore it has no need to
426 * involve the IOLOCK in this synchronization).
427 */
428 ASSERT((lock_flags & (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED)) == 0);
429
421 /* reject inode numbers outside existing AGs */ 430 /* reject inode numbers outside existing AGs */
422 if (!ino || XFS_INO_TO_AGNO(mp, ino) >= mp->m_sb.sb_agcount) 431 if (!ino || XFS_INO_TO_AGNO(mp, ino) >= mp->m_sb.sb_agcount)
423 return EINVAL; 432 return EINVAL;
diff --git a/fs/xfs/xfs_sync.c b/fs/xfs/xfs_sync.c
index 40b75eecd2b4..71bf846b7280 100644
--- a/fs/xfs/xfs_sync.c
+++ b/fs/xfs/xfs_sync.c
@@ -913,17 +913,15 @@ reclaim:
913 * can reference the inodes in the cache without taking references. 913 * can reference the inodes in the cache without taking references.
914 * 914 *
915 * We make that OK here by ensuring that we wait until the inode is 915 * We make that OK here by ensuring that we wait until the inode is
916 * unlocked after the lookup before we go ahead and free it. We get 916 * unlocked after the lookup before we go ahead and free it.
917 * both the ilock and the iolock because the code may need to drop the
918 * ilock one but will still hold the iolock.
919 */ 917 */
920 xfs_ilock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); 918 xfs_ilock(ip, XFS_ILOCK_EXCL);
921 xfs_qm_dqdetach(ip); 919 xfs_qm_dqdetach(ip);
922 xfs_iunlock(ip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL); 920 xfs_iunlock(ip, XFS_ILOCK_EXCL);
923 921
924 xfs_inode_free(ip); 922 xfs_inode_free(ip);
925 return error;
926 923
924 return error;
927} 925}
928 926
929/* 927/*