[PATCH 0/9] smb/client: improve change notify support
ChenXiaoSong <[email protected]>
| Newsgroups | org.kernel.vger.linux-cifs |
|---|---|
| Message-ID | <[email protected]> |
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(-) -- 2.54.0