9p: Fix O_NONBLOCK read behaviour in P9L_DIRECT mode
Subsystems (3)
David Howells
maintainerPATCH 1/1 9p: Fix O_NONBLOCK read behaviour in P9L_DIRECT mode
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")
Signed-off-by David Howells <[email protected]>
cc Eric Van Hensbergen <[email protected]>
cc Latchesar Ionkov <[email protected]>
cc Dominique Martinet <[email protected]>
cc Christian Schoenebeck <[email protected]>
--- fs/9p/vfs_addr.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/9p/vfs_addr.c +4 -0
@@ -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); }