diff options
| author | David Howells <[email protected]> | 2025-05-23 07:57:52 +0000 |
|---|---|---|
| committer | Christian Brauner <[email protected]> | 2025-05-23 08:35:03 +0000 |
| commit | db26d62d79e4068934ad0dccdb92715df36352b9 (patch) | |
| tree | 322b7ce500512ffaf7dff5689006bbf9ccf060e7 /fs/9p/vfs_addr.c | |
| parent | Merge patch series "netfs: Miscellaneous fixes" (diff) | |
| download | kernel-db26d62d79e4068934ad0dccdb92715df36352b9.tar.gz kernel-db26d62d79e4068934ad0dccdb92715df36352b9.zip | |
netfs: Fix undifferentiation of DIO reads from unbuffered reads
On cifs, "DIO reads" (specified by O_DIRECT) need to be differentiated from
"unbuffered reads" (specified by cache=none in the mount parameters). The
difference is flagged in the protocol and the server may behave
differently: Windows Server will, for example, mandate that DIO reads are
block aligned.
Fix this by adding a NETFS_UNBUFFERED_READ to differentiate this from
NETFS_DIO_READ, parallelling the write differentiation that already exists.
cifs will then do the right thing.
Fixes: 016dc8516aec ("netfs: Implement unbuffered/DIO read support")
Signed-off-by: David Howells <[email protected]>
Link: https://lore.kernel.org/[email protected]
Reviewed-by: "Paulo Alcantara (Red Hat)" <[email protected]>
Reviewed-by: Viacheslav Dubeyko <[email protected]>
cc: Steve French <[email protected]>
cc: [email protected]
cc: [email protected]
cc: [email protected]
cc: [email protected]
cc: [email protected]
cc: [email protected]
cc: [email protected]
Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'fs/9p/vfs_addr.c')
| -rw-r--r-- | fs/9p/vfs_addr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index b5a4a28e0fe7..e4420591cf35 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -77,7 +77,8 @@ static void v9fs_issue_read(struct netfs_io_subrequest *subreq) /* if we just extended the file size, any portion not in * cache won't be on server and is zeroes */ - if (subreq->rreq->origin != NETFS_DIO_READ) + if (subreq->rreq->origin != NETFS_UNBUFFERED_READ && + subreq->rreq->origin != NETFS_DIO_READ) __set_bit(NETFS_SREQ_CLEAR_TAIL, &subreq->flags); if (pos + total >= i_size_read(rreq->inode)) __set_bit(NETFS_SREQ_HIT_EOF, &subreq->flags); |
