Skip to content

smb/client: improve change notify support

ChenXiaoSong linux-cifs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9smb/client: factor out cifs_new_dir_fileinfo()fs/smb/client/cifsproto.h fs/smb/client/file.c fs/smb/client/readdir.c+32 -80 replies
2/9smb/client: close cached notify handles on closedirfs/smb/client/cifsglob.h fs/smb/client/file.c+34 -00 replies
3/9smb/client: prepare notify ioctl per-open statefs/smb/client/smb2ops.c+16 -00 replies
4/9smb/client: cache SMB3 change notify handlesfs/smb/client/smb2ops.c+51 -310 replies
5/9smb/client: retry change notify after invalid cached handlefs/smb/client/smb2ops.c+34 -20 replies
6/9smb/client: add helpers for sending cancel requestsfs/smb/client/cifsproto.h fs/smb/client/transport.c+39 -120 replies
7/9smb/client: remember async ids from SMB2 pending responsesfs/smb/client/cifsglob.h fs/smb/client/smb2ops.c+14 -00 replies
8/9smb/client: send SMB2 cancel requestsfs/smb/client/smb2ops.c fs/smb/client/smb2proto.h fs/smb/client/smb2transport.c+112 -00 replies
9/9smb/client: make SMB2 change notify interruptiblefs/smb/client/smb2pdu.c+1 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] smb/client: improve change notify support

From: ChenXiaoSong <[email protected]>

This patchset improves support for SMB client's notify feature, including the following two improvements:

1. Support for notify cancellation.
2. Support for receiving all action notifications from the server. 2.1. Before this patchset, when an operation on the server triggered multiple actions, the client received only one action notification. 2.2. After this patchset, the client can receive all action notifications.

Example:

smbinfo notify /mnt

# server: touch /export/file1
Notifications received, returned data_len is 24
Action: 0x00000001, FileName: file1
Notifications received, returned data_len is 24
Action: 0x00000003, FileName: file1

# server: mv /export/file1 /export/file2
Notifications received, returned data_len is 48
Action: 0x00000004, FileName: file1
Action: 0x00000005, FileName: file2
Notifications received, returned data_len is 24
Action: 0x00000003, FileName: file2
Notifications received, returned data_len is 24
Action: 0x00000002, FileName: file1

Then press Ctrl+C to exit smbinfo notify command. The following packets can be captured using tcpdump:

- client: Cancel Request
- server: Notify Response, Error: STATUS_CANCELLED

ChenXiaoSong (9):
smb/client: factor out cifs_new_dir_fileinfo() smb/client: close cached notify handles on closedir smb/client: prepare notify ioctl per-open state smb/client: cache SMB3 change notify handles smb/client: retry change notify after invalid cached handle smb/client: add helpers for sending cancel requests smb/client: remember async ids from SMB2 pending responses smb/client: send SMB2 cancel requests
smb/client: make SMB2 change notify interruptible

 fs/smb/client/cifsglob.h      |   6 ++
 fs/smb/client/cifsproto.h     |   4 +
 fs/smb/client/file.c          |  54 +++++++++++++
 fs/smb/client/readdir.c       |  14 ++--
 fs/smb/client/smb2ops.c       | 148 ++++++++++++++++++++++++++--------
 fs/smb/client/smb2pdu.c       |   1 +
 fs/smb/client/smb2proto.h     |   3 +
 fs/smb/client/smb2transport.c | 105 ++++++++++++++++++++++++
 fs/smb/client/transport.c     |  49 ++++++++---
 9 files changed, 332 insertions(+), 52 deletions(-)
Signature · 1 line
2.54.0