mbox series

[0/2] netfs, cifs: DIO read and read-retry fixes

Message ID 20240822220650.318774-1-dhowells@redhat.com (mailing list archive)
Headers show
Series netfs, cifs: DIO read and read-retry fixes | expand

Message

David Howells Aug. 22, 2024, 10:06 p.m. UTC
Hi Christian, Steve,

Here are a couple of fixes to DIO read handling and the retrying of reads,
particularly in relation to cifs.

 (1) Fix the missing credit renegotiation in cifs on the retrying of reads.
     The credits we had ended with the original read (or the last retry)
     and to perform a new read we need more credits otherwise the server
     can reject our read with EINVAL.

 (2) Fix the handling of short DIO reads to avoid ENODATA when the read
     retry tries to access a portion of the file after the EOF.

These were both accessible by simply trying to do a DIO read of a remote
file where the read was larger than the file.

Note that (2) might also apply to other netfslib-using filesystems.

The patches can also be found here:

	https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=netfs-fixes

Thanks,
David

David Howells (2):
  cifs: Fix lack of credit renegotiation on read retry
  netfs, cifs: Fix handling of short DIO read

 fs/netfs/io.c            | 19 ++++++++++++------
 fs/smb/client/cifsglob.h |  1 +
 fs/smb/client/file.c     | 28 ++++++++++++++++++++++----
 fs/smb/client/smb2pdu.c  | 43 +++++++++++++++++++++++++++++-----------
 include/linux/netfs.h    |  1 +
 5 files changed, 70 insertions(+), 22 deletions(-)

Comments

Christian Brauner Aug. 23, 2024, 12:39 p.m. UTC | #1
On Thu, 22 Aug 2024 23:06:47 +0100, David Howells wrote:
> Here are a couple of fixes to DIO read handling and the retrying of reads,
> particularly in relation to cifs.
> 
>  (1) Fix the missing credit renegotiation in cifs on the retrying of reads.
>      The credits we had ended with the original read (or the last retry)
>      and to perform a new read we need more credits otherwise the server
>      can reject our read with EINVAL.
> 
> [...]

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/2] cifs: Fix lack of credit renegotiation on read retry
      https://git.kernel.org/vfs/vfs/c/82d55e76bf2f
[2/2] netfs, cifs: Fix handling of short DIO read
      https://git.kernel.org/vfs/vfs/c/942ad91e2956