summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_file.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-06-23 08:44:30 +0300
committerChandan Babu R <chandanbabu@kernel.org>2024-07-01 07:02:29 +0300
commit4e82fa11fbbcc5426366dc2ddc839fd56b9d53de (patch)
tree5a814a6e5235170775fc49330929fa8f7e6a1871 /fs/xfs/xfs_file.c
parent6a39ec1d394458e59f411edecf7b08ce34bdc7c8 (diff)
downloadlinux-4e82fa11fbbcc5426366dc2ddc839fd56b9d53de.tar.xz
xfs: always take XFS_MMAPLOCK shared in xfs_dax_read_fault
After the previous refactoring, xfs_dax_fault is now never used for write faults, so don't bother with the xfs_ilock_for_write_fault logic to protect against writes when remapping is in progress. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r--fs/xfs/xfs_file.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 32a2cd6ec82e..904be41f3e5e 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -1279,12 +1279,11 @@ xfs_dax_read_fault(
unsigned int order)
{
struct xfs_inode *ip = XFS_I(file_inode(vmf->vma->vm_file));
- unsigned int lock_mode;
vm_fault_t ret;
- lock_mode = xfs_ilock_for_write_fault(ip);
+ xfs_ilock(ip, XFS_MMAPLOCK_SHARED);
ret = xfs_dax_fault_locked(vmf, order, false);
- xfs_iunlock(ip, lock_mode);
+ xfs_iunlock(ip, XFS_MMAPLOCK_SHARED);
return ret;
}