All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Chandan Babu R <chandan.babu@oracle.com>
Cc: "Darrick J. Wong" <djwong@kernel.org>, linux-xfs@vger.kernel.org
Subject: [PATCH 5/6] xfs: always take XFS_MMAPLOCK shared in xfs_dax_read_fault
Date: Sun, 23 Jun 2024 07:44:30 +0200	[thread overview]
Message-ID: <20240623054500.870845-6-hch@lst.de> (raw)
In-Reply-To: <20240623054500.870845-1-hch@lst.de>

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>
---
 fs/xfs/xfs_file.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 32a2cd6ec82e0c..904be41f3e5ec6 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;
 }
-- 
2.43.0


  parent reply	other threads:[~2024-06-23  5:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-23  5:44 clean up I/O path inode locking helpers and the page fault handler v2 Christoph Hellwig
2024-06-23  5:44 ` [PATCH 1/6] xfs: move the dio write relocking out of xfs_ilock_for_iomap Christoph Hellwig
2024-06-23  5:44 ` [PATCH 2/6] xfs: cleanup xfs_ilock_iocb_for_write Christoph Hellwig
2024-06-23  5:44 ` [PATCH 3/6] xfs: simplify xfs_dax_fault Christoph Hellwig
2024-06-23  5:44 ` [PATCH 4/6] xfs: refactor __xfs_filemap_fault Christoph Hellwig
2024-06-23  5:44 ` Christoph Hellwig [this message]
2024-06-23  5:44 ` [PATCH 6/6] xfs: fold xfs_ilock_for_write_fault into xfs_write_fault Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240623054500.870845-6-hch@lst.de \
    --to=hch@lst.de \
    --cc=chandan.babu@oracle.com \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.