diff options
| author | Matthew Wilcox (Oracle) <[email protected]> | 2024-02-19 15:41:12 +0000 |
|---|---|---|
| committer | Chandan Babu R <[email protected]> | 2024-02-19 15:49:33 +0000 |
| commit | 3fed24fffc76dd1a8105db558e98bc8355d60379 (patch) | |
| tree | 4c2da723c000e9fe63e2fcdc3a96bc157777f671 /fs/xfs/libxfs/xfs_defer.c | |
| parent | locking: Add rwsem_assert_held() and rwsem_assert_held_write() (diff) | |
| download | kernel-3fed24fffc76dd1a8105db558e98bc8355d60379.tar.gz kernel-3fed24fffc76dd1a8105db558e98bc8355d60379.zip | |
xfs: Replace xfs_isilocked with xfs_assert_ilocked
To use the new rwsem_assert_held()/rwsem_assert_held_write(), we can't
use the existing ASSERT macro. Add a new xfs_assert_ilocked() and
convert all the callers.
Fix an apparent bug in xfs_isilocked(): If the caller specifies
XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL, xfs_assert_ilocked() will check both
the IOLOCK and the ILOCK are held for write. xfs_isilocked() only
checked that the ILOCK was held for write.
xfs_assert_ilocked() is always on, even if DEBUG or XFS_WARN aren't
defined. It's a cheap check, so I don't think it's worth defining
it away.
Reviewed-by: "Darrick J. Wong" <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
Signed-off-by: "Matthew Wilcox (Oracle)" <[email protected]>
Signed-off-by: Chandan Babu R <[email protected]>
Diffstat (limited to 'fs/xfs/libxfs/xfs_defer.c')
| -rw-r--r-- | fs/xfs/libxfs/xfs_defer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c index 6ed3a5fda081..c13276095cc0 100644 --- a/fs/xfs/libxfs/xfs_defer.c +++ b/fs/xfs/libxfs/xfs_defer.c @@ -1006,7 +1006,7 @@ xfs_defer_ops_capture( * transaction. */ for (i = 0; i < dfc->dfc_held.dr_inos; i++) { - ASSERT(xfs_isilocked(dfc->dfc_held.dr_ip[i], XFS_ILOCK_EXCL)); + xfs_assert_ilocked(dfc->dfc_held.dr_ip[i], XFS_ILOCK_EXCL); ihold(VFS_I(dfc->dfc_held.dr_ip[i])); } |
