aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-07-04 11:13:31 -0400
committerBen Myers <bpm@sgi.com>2012-07-29 17:16:49 -0400
commit0b56185b0d64ef89dad1c85bb7403fa762cbe50d (patch)
treef46b40a37c5a27e4cf0ab9c99241350e679f9930 /fs/xfs
parentfe67be036ff2f713b1c5f24dd4cdffae75bcb97a (diff)
xfs: do not take the iolock in xfs_inactive
An inode that enters xfs_inactive has been removed from all global lists but the inode hash, and can't be recycled in xfs_iget before it has been marked reclaimable. Thus taking the iolock in here is not nessecary at all, and given the amount of lockdep false positives it has triggered already I'd rather remove the locking. The only change outside of xfs_inactive is relaxing an assert in xfs_itruncate_extents. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Rich Johnston <rjohnston@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_inode.c4
-rw-r--r--fs/xfs/xfs_vnodeops.c29
2 files changed, 15 insertions, 18 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 5c10825f2f80..2778258fcfa2 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1123,7 +1123,9 @@ xfs_itruncate_extents(
1123 int error = 0; 1123 int error = 0;
1124 int done = 0; 1124 int done = 0;
1125 1125
1126 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_IOLOCK_EXCL)); 1126 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
1127 ASSERT(!atomic_read(&VFS_I(ip)->i_count) ||
1128 xfs_isilocked(ip, XFS_IOLOCK_EXCL));
1127 ASSERT(new_size <= XFS_ISIZE(ip)); 1129 ASSERT(new_size <= XFS_ISIZE(ip));
1128 ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES); 1130 ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES);
1129 ASSERT(ip->i_itemp != NULL); 1131 ASSERT(ip->i_itemp != NULL);
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 9a2ae8c0ecc4..79270430dafc 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -554,7 +554,7 @@ xfs_inactive(
554 return VN_INACTIVE_CACHE; 554 return VN_INACTIVE_CACHE;
555 } 555 }
556 556
557 xfs_ilock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); 557 xfs_ilock(ip, XFS_ILOCK_EXCL);
558 xfs_trans_ijoin(tp, ip, 0); 558 xfs_trans_ijoin(tp, ip, 0);
559 559
560 if (S_ISLNK(ip->i_d.di_mode)) { 560 if (S_ISLNK(ip->i_d.di_mode)) {
@@ -591,21 +591,24 @@ xfs_inactive(
591 ASSERT(ip->i_d.di_forkoff != 0); 591 ASSERT(ip->i_d.di_forkoff != 0);
592 592
593 error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); 593 error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
594 xfs_iunlock(ip, XFS_ILOCK_EXCL);
595 if (error) 594 if (error)
596 goto error_unlock; 595 goto out_unlock;
596
597 xfs_iunlock(ip, XFS_ILOCK_EXCL);
597 598
598 error = xfs_attr_inactive(ip); 599 error = xfs_attr_inactive(ip);
599 if (error) 600 if (error)
600 goto error_unlock; 601 goto out;
601 602
602 tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE); 603 tp = xfs_trans_alloc(mp, XFS_TRANS_INACTIVE);
603 error = xfs_trans_reserve(tp, 0, 604 error = xfs_trans_reserve(tp, 0,
604 XFS_IFREE_LOG_RES(mp), 605 XFS_IFREE_LOG_RES(mp),
605 0, XFS_TRANS_PERM_LOG_RES, 606 0, XFS_TRANS_PERM_LOG_RES,
606 XFS_INACTIVE_LOG_COUNT); 607 XFS_INACTIVE_LOG_COUNT);
607 if (error) 608 if (error) {
608 goto error_cancel; 609 xfs_trans_cancel(tp, 0);
610 goto out;
611 }
609 612
610 xfs_ilock(ip, XFS_ILOCK_EXCL); 613 xfs_ilock(ip, XFS_ILOCK_EXCL);
611 xfs_trans_ijoin(tp, ip, 0); 614 xfs_trans_ijoin(tp, ip, 0);
@@ -658,21 +661,13 @@ xfs_inactive(
658 * Release the dquots held by inode, if any. 661 * Release the dquots held by inode, if any.
659 */ 662 */
660 xfs_qm_dqdetach(ip); 663 xfs_qm_dqdetach(ip);
661 xfs_iunlock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); 664out_unlock:
662 665 xfs_iunlock(ip, XFS_ILOCK_EXCL);
663out: 666out:
664 return VN_INACTIVE_CACHE; 667 return VN_INACTIVE_CACHE;
665out_cancel: 668out_cancel:
666 xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT); 669 xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT);
667 xfs_iunlock(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL); 670 goto out_unlock;
668 return VN_INACTIVE_CACHE;
669
670error_cancel:
671 ASSERT(XFS_FORCED_SHUTDOWN(mp));
672 xfs_trans_cancel(tp, 0);
673error_unlock:
674 xfs_iunlock(ip, XFS_IOLOCK_EXCL);
675 return VN_INACTIVE_CACHE;
676} 671}
677 672
678/* 673/*