Commit 4e82fa11 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Chandan Babu R
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarChandan Babu R <chandanbabu@kernel.org>
parent 6a39ec1d
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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;
}