[PATCH] netfs: Fix undifferentiation of DIO reads from unbuffered reads

Paulo Alcantara pc at manguebit.com
Wed Apr 23 15:49:49 PDT 2025


David Howells <dhowells at redhat.com> writes:

> 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.
>
> A further patch will be required to make cifs do something different,
> depending on the rreq->origin set.
>
> Fixes: 016dc8516aec ("netfs: Implement unbuffered/DIO read support")
> Signed-off-by: David Howells <dhowells at redhat.com>
> cc: Paulo Alcantara <pc at manguebit.com>
> cc: Steve French <sfrench at samba.org>
> cc: netfs at lists.linux.dev
> cc: v9fs at lists.linux.dev
> cc: linux-afs at lists.infradead.org
> cc: linux-cifs at vger.kernel.org
> cc: ceph-devel at vger.kernel.org
> cc: linux-nfs at vger.kernel.org
> cc: linux-fsdevel at vger.kernel.org
> ---
>  fs/9p/vfs_addr.c             |    3 ++-
>  fs/afs/write.c               |    1 +
>  fs/ceph/addr.c               |    4 +++-
>  fs/netfs/direct_read.c       |    3 ++-
>  fs/netfs/main.c              |    1 +
>  fs/netfs/misc.c              |    1 +
>  fs/netfs/objects.c           |    1 +
>  fs/netfs/read_collect.c      |    7 +++++--
>  fs/nfs/fscache.c             |    1 +
>  fs/smb/client/file.c         |    3 ++-
>  include/linux/netfs.h        |    1 +
>  include/trace/events/netfs.h |    1 +
>  12 files changed, 21 insertions(+), 6 deletions(-)

Reviewed-by: Paulo Alcantara (Red Hat) <pc at manguebit.com>



More information about the linux-afs mailing list