linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 9p: Fix O_NONBLOCK read behaviour in P9L_DIRECT mode
@ 2024-07-11 13:19 David Howells
  0 siblings, 0 replies; only message in thread
From: David Howells @ 2024-07-11 13:19 UTC (permalink / raw)
  To: Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet
  Cc: dhowells, Christian Schoenebeck, v9fs, netfs, linux-fsdevel,
	linux-kernel

With the 9p filesystem, in P9L_DIRECT mode, if O_NONBLOCK is set, a read
should terminate after doing one piece of I/O.

Fixes: 80105ed2fd27 ("9p: Use netfslib read/write_iter")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218916
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Eric Van Hensbergen <ericvh@kernel.org>
cc: Latchesar Ionkov <lucho@ionkov.net>
cc: Dominique Martinet <asmadeus@codewreck.org>
cc: Christian Schoenebeck <linux_oss@crudebyte.com>
cc: v9fs@lists.linux.dev
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
---
 fs/9p/vfs_addr.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index a97ceb105cd8..b443024bf715 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -77,6 +77,10 @@ static void v9fs_issue_read(struct netfs_io_subrequest *subreq)
 	 * cache won't be on server and is zeroes */
 	__set_bit(NETFS_SREQ_CLEAR_TAIL, &subreq->flags);
 
+	if ((fid->mode & P9L_DIRECT) &&
+	    test_bit(NETFS_RREQ_NONBLOCK, &rreq->flags))
+		set_bit(NETFS_RREQ_BLOCKED, &rreq->flags);
+
 	netfs_subreq_terminated(subreq, err ?: total, false);
 }
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-07-11 13:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-11 13:19 [PATCH] 9p: Fix O_NONBLOCK read behaviour in P9L_DIRECT mode David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).