]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: always take XFS_MMAPLOCK shared in xfs_dax_read_fault
authorChristoph Hellwig <hch@lst.de>
Sun, 23 Jun 2024 05:44:30 +0000 (07:44 +0200)
committerChandan Babu R <chandanbabu@kernel.org>
Mon, 1 Jul 2024 04:02:29 +0000 (09:32 +0530)
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>
fs/xfs/xfs_file.c

index 32a2cd6ec82e0c7a46e48a47b00f20ec4a4fa0f1..904be41f3e5ec64c46dd43ee572ab2c6d4d37d15 100644 (file)
@@ -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;
 }