Skip to content

netfs, cifs: Combined repost of fixes for truncation, DIO read and read-retry

David Howells ceph-devel linux-cifs linux-erofs linux-fsdevel linux-mm linux-nfs lkml netfs v9fs 1 version Applied

Status from this message: Applied to the vfs.fixes branch of the vfs/vfs.git tree.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/9mm: Fix missing folio invalidation calls during truncationmm/truncate.c+2 -22 replies
2/9afs: Fix post-setattr file edit to do truncation correctlyfs/afs/inode.c+8 -30 replies
3/9netfs: Fix netfs_release_folio() to say no if folio dirtyfs/netfs/misc.c+3 -00 replies
4/9netfs: Fix trimming of streaming-write folios in netfs_inval_folio()fs/netfs/misc.c+35 -150 replies
5/9netfs: Fix missing iterator reset on retry of short readfs/netfs/io.c+1 -00 replies
6/9cifs: Fix lack of credit renegotiation on read retryfs/netfs/io.c fs/smb/client/cifsglob.h fs/smb/client/file.c +3 more+55 -160 replies
7/9netfs, cifs: Fix handling of short DIO readfs/netfs/io.c fs/smb/client/smb2pdu.c include/linux/netfs.h+21 -100 replies
8/9cifs: Fix FALLOC_FL_PUNCH_HOLE supportfs/smb/client/smb2ops.c+22 -00 replies
9/9netfs, cifs: Improve some debugging bitsfs/netfs/io.c fs/smb/client/smb2ops.c+6 -40 replies

Reviews trailers per patch

1 of 9 patches has a Reviewed-by or Acked-by.

PatchMatthew Wilcox (Oracle)
1/9R-b
2/9
3/9
4/9
5/9
6/9
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/9] netfs, cifs: Combined repost of fixes for truncation, DIO read and read-retry

Hi Christian, Steve,

Firstly, there are some fixes for truncation, netfslib and afs that I discovered whilst trying Pankaj Raghav's minimum folio order patchset:

(1) Fix truncate to make it honour AS_RELEASE_ALWAYS in a couple of places that got missed.

(2) Fix duplicated editing of a partially invalidated folio in afs's post-setattr edit phase.

(3) Fix netfs_release_folio() to indicate that the folio is busy if the folio is dirty (as does iomap).

(4) Fix the trimming of a folio that contain streaming-write data when truncation occurs into or past that folio

Here's a patch to netfs for short reads:

(5) Fix netfslib's short read retry to reset the buffer iterator otherwise the wrong part of the buffer may get written on.

Here are a couple of fixes to DIO read handling and the retrying of reads, particularly in relation to cifs. They have both had some fixes to the fixes rolled in:

(6) 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.

(7) 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.

Here's a fix for hole punching in cifs:

(8) Fix cifs FALLOC_FL_PUNCH_HOLE support as best I can. If it's going to punch a hole in dirty data in the pagecacne, invalidating that data may result in the EOF not being moved correctly. The set-zero and the eof-move RPC ops really need compounding to avoid third-party interference.

And finally, here's an adjustment to debugging statements:

(9) Adjust three debugging output statements. Not strictly a fix, so could be dropped. Including the subreq ID in some extra debug lines helps a bit, though.

The patches can also be found here:

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

They're on top of part of Christian's vfs.fixes tree, including the partial reversion of the commit to replace PG_fscache.

Thanks,
David

David Howells (9):
mm: Fix missing folio invalidation calls during truncation
afs: Fix post-setattr file edit to do truncation correctly
netfs: Fix netfs_release_folio() to say no if folio dirty
netfs: Fix trimming of streaming-write folios in netfs_inval_folio()
netfs: Fix missing iterator reset on retry of short read
cifs: Fix lack of credit renegotiation on read retry netfs, cifs: Fix handling of short DIO read
cifs: Fix FALLOC_FL_PUNCH_HOLE support
netfs, cifs: Improve some debugging bits

 fs/afs/inode.c           | 11 ++++++---
 fs/netfs/io.c            | 22 +++++++++++------
 fs/netfs/misc.c          | 53 ++++++++++++++++++++++++++++------------
 fs/smb/client/cifsglob.h |  1 +
 fs/smb/client/file.c     | 37 +++++++++++++++++++++++++---
 fs/smb/client/smb2ops.c  | 32 +++++++++++++++++++++---
 fs/smb/client/smb2pdu.c  | 41 +++++++++++++++++++------------
 fs/smb/client/trace.h    |  1 +
 include/linux/netfs.h    |  1 +
 mm/truncate.c            |  4 +--
 10 files changed, 153 insertions(+), 50 deletions(-)