Skip to content

netfs, cifs: Fixes to retry-related code and RDMA support

David Howells ceph-devel linux-cifs linux-fsdevel linux-nfs lkml netfs stable v9fs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest16 patches 2 repliesIn review
  2. v111 patches 1 replySuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16netfs: Fix hang due to missing case in final DIO read result collectionfs/netfs/misc.c+4 -21 reply
2/16netfs: Put double put of requestfs/netfs/misc.c include/trace/events/netfs.h+6 -00 replies
3/16netfs: Provide helpers to perform NETFS_RREQ_IN_PROGRESS flag wanglingfs/netfs/internal.h fs/netfs/misc.c fs/netfs/read_collect.c +1 more+27 -90 replies
4/16netfs: Fix looping in wait functionsfs/netfs/misc.c+11 -40 replies
5/16netfs: Fix ref leak on inserted extra subreq in write retryfs/netfs/write_retry.c+1 -10 replies
6/16smb: client: set missing retry flag in smb2_writev_callback()fs/smb/client/smb2pdu.c+1 -00 replies
7/16smb: client: set missing retry flag in cifs_readv_callback()fs/smb/client/cifssmb.c+1 -00 replies
8/16smb: client: set missing retry flag in cifs_writev_callback()fs/smb/client/cifssmb.c+1 -00 replies
9/16smb: client: fix regression with native SMB symlinksfs/smb/client/reparse.c+4 -160 replies
10/16smb: client: fix warning when reconnecting channelfs/smb/client/cifsglob.h fs/smb/client/smb2pdu.c+5 -60 replies
11/16smb: client: let smbd_post_send_iter() respect the peers max_send_size and transmit all datafs/smb/client/smbdirect.c+27 -40 replies
12/16cifs: Fix reading into an ITER_FOLIOQ from the smbdirect codefs/smb/client/smbdirect.c+19 -955 replies
13/16cifs: Fix the smbd_reponse slab to allow usercopyfs/smb/client/smbdirect.c+13 -50 replies
14/16smb: client: fix potential deadlock when reconnecting channelsfs/smb/client/cifsglob.h fs/smb/client/connect.c+32 -220 replies
15/16netfs: Renumber the NETFS_RREQ_* flags to make traces easier to readfs/netfs/main.c include/linux/netfs.h include/trace/events/netfs.h+14 -140 replies
16/16netfs: Update tracepoints in a number of waysfs/netfs/direct_write.c fs/netfs/internal.h fs/netfs/misc.c +6 more+79 -270 replies

Reviews trailers per patch

9 of 16 patches have a Reviewed-by or Acked-by.

PatchPaulo AlcantaraDavid HowellsStefan Metzmacher
1/16R-b
2/16R-b
3/16R-b
4/16R-b
5/16R-b
6/16
7/16
8/16
9/16
10/16R-b T-b
11/16
12/16
13/16R-b T-b
14/16R-b T-b
15/16R-b
16/16

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/16] netfs, cifs: Fixes to retry-related code and RDMA support

Hi Christian, Steve,

Here are some miscellaneous fixes and changes for netfslib and cifs, if you could consider pulling them. All the bugs fixed were observed in cifs, so they should probably go through the cifs tree unless Christian would much prefer for them to go through the VFS tree.

Many of these were found because a bug in Samba was causing smbd to crash and restart after about 1-2s and this was vigorously and abruptly exercising the netfslib retry paths.

Subsequent testing of the cifs RDMA support showed up some more bugs, for which fixes are also included here.

First, there are some netfs fixes:

(1) Fix a hang due to missing case in final DIO read result collection not breaking out of a loop if the request finished, but there were no subrequests being processed and NETFS_RREQ_ALL_QUEUED wasn't yet set.

(2) Fix a double put of the netfs_io_request struct if completion happened in the pause loop.

(3) Provide some helpers to abstract out NETFS_RREQ_IN_PROGRESS flag wrangling.

(4) Fix infinite looping in netfs_wait_for_pause/request() which wa caused by a loop waiting for NETFS_RREQ_ALL_QUEUED to get set - but which wouldn't get set until the looping function returned. This uses patch
(3) above.

(5) Fix a ref leak on an extra subrequest inserted into a request's list of subreqs because more subreq records were needed for retrying than were needed for the original request (say, for instance, that the amount of cifs credit available was reduced and, subsequently, the ops had to be smaller).

Then a bunch of cifs fixes, some of which are from other people:

(6-8) cifs: Fix various RPC callbacks to set NETFS_SREQ_NEED_RETRY if a
subrequest fails retriably.

(9) Fix a regression with SMB symlinks.

(10) Fix a warning in the workqueue code when reconnecting a channel.

(11) Fix smbd_post_send_iter() to correctly respect the max_send_size and to transmit all the data.

(12) Fix reading into an ITER_FOLIOQ from the smbdirect code.

(13) Fix the smbd_response slab to allow copy_to_iter() to be used on it without incurring a bug from the usercopy hardening code.

(14) Fix a potential deadlock during channel reconnection.

And finally a couple of patches to improve tracing output, but that should otherwise not affect functionality:

(15) Renumber the NETFS_RREQ_* flags to make the hex values easier to interpret by eye, including moving the main status flags down to the lowest bits, with IN_PROGRESS in bit 0.

(16) Update the tracepoints in a number of ways, including adding more tracepoints into the cifs read/write RPC callback so that differend MID_RESPONSE_* values can be differentiated.

Those last two could wait for the next merge window.

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 (9):
netfs: Fix hang due to missing case in final DIO read result
collection
netfs: Put double put of request
netfs: Provide helpers to perform NETFS_RREQ_IN_PROGRESS flag wangling
netfs: Fix looping in wait functions
netfs: Fix ref leak on inserted extra subreq in write retry
cifs: Fix reading into an ITER_FOLIOQ from the smbdirect code
cifs: Fix the smbd_reponse slab to allow usercopy
netfs: Renumber the NETFS_RREQ_* flags to make traces easier to read
netfs: Update tracepoints in a number of ways

Paulo Alcantara (6):
smb: client: set missing retry flag in smb2_writev_callback()
smb: client: set missing retry flag in cifs_readv_callback()
smb: client: set missing retry flag in cifs_writev_callback()
smb: client: fix regression with native SMB symlinks
smb: client: fix warning when reconnecting channel
smb: client: fix potential deadlock when reconnecting channels

Stefan Metzmacher (1):
smb: client: let smbd_post_send_iter() respect the peers max_send_size
and transmit all data

 fs/netfs/direct_write.c      |   1 -
 fs/netfs/internal.h          |  20 ++++-
 fs/netfs/main.c              |   6 +-
 fs/netfs/misc.c              |  50 +++++++----
 fs/netfs/read_collect.c      |  16 ++--
 fs/netfs/write_collect.c     |   8 +-
 fs/netfs/write_retry.c       |   3 +-
 fs/smb/client/cifsglob.h     |   2 +
 fs/smb/client/cifssmb.c      |  22 +++++
 fs/smb/client/connect.c      |  53 +++++++-----
 fs/smb/client/reparse.c      |  20 +----
 fs/smb/client/smb2pdu.c      |  37 +++++---
 fs/smb/client/smbdirect.c    | 163 +++++++++++++----------------------
 include/linux/netfs.h        |  20 ++---
 include/trace/events/netfs.h |  29 +++++--
 15 files changed, 245 insertions(+), 205 deletions(-)