summaryrefslogtreecommitdiff
path: root/fs/netfs/misc.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2025-05-23 08:57:52 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-19 15:40:21 +0200
commitb5dbb53c888e5d5099c1a7038aaa2e6c765a9ac6 (patch)
treee678ab41ce71ce79c791cde70c734b903acff8ec /fs/netfs/misc.c
parent7a506ec1caa6a992b84f5bebedf32ecbd739989a (diff)
netfs: Fix undifferentiation of DIO reads from unbuffered reads
[ Upstream commit db26d62d79e4068934ad0dccdb92715df36352b9 ] 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 <dhowells@redhat.com> Link: https://lore.kernel.org/3444961.1747987072@warthog.procyon.org.uk Reviewed-by: "Paulo Alcantara (Red Hat)" <pc@manguebit.com> Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> cc: Steve French <sfrench@samba.org> cc: netfs@lists.linux.dev cc: v9fs@lists.linux.dev cc: linux-afs@lists.infradead.org cc: linux-cifs@vger.kernel.org cc: ceph-devel@vger.kernel.org cc: linux-nfs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/netfs/misc.c')
-rw-r--r--fs/netfs/misc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/netfs/misc.c b/fs/netfs/misc.c
index 77e7f7c79d27..43b67a28a8fa 100644
--- a/fs/netfs/misc.c
+++ b/fs/netfs/misc.c
@@ -461,6 +461,7 @@ all_collected:
case NETFS_DIO_READ:
case NETFS_DIO_WRITE:
case NETFS_READ_SINGLE:
+ case NETFS_UNBUFFERED_READ:
case NETFS_UNBUFFERED_WRITE:
break;
default: