Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] smb: client: support directory change tracking
@ 2025-09-16 13:34 Sang-Heon Jeon
  2025-09-16 13:34 ` [RFC PATCH 1/2] smb: client: export SMB2_notify_init for " Sang-Heon Jeon
  2025-09-16 13:34 ` [RFC PATCH 2/2] smb: client: add directory change tracking via SMB2 Change Notify Sang-Heon Jeon
  0 siblings, 2 replies; 12+ messages in thread
From: Sang-Heon Jeon @ 2025-09-16 13:34 UTC (permalink / raw)
  To: sfrench; +Cc: linux-cifs, Sang-Heon Jeon

Hello, Steve 

This RFC patch series implements directory change tracking logic for the
SMB2+ client using the SMB2 Change Notify protocol. When directory
monitoring is needed, we send a Change Notify request that remains
pending on the server until changes occur. When the server responds with
change events, we convert responds to fsnotify event and broadcast them.

If the connections is disrupted, we stop tracking and resume after
reconnection completes. Also, we stop tracking when unmount occurs.
Cleanup workers run periodically to free tracking structures for
directories that are no longer being watched.

This feature is related to f-section of TODO kernel docs.

Points for discussion:
 1. This feature generates additional request/response traffic between
server and client. Is the overhead is acceptable?
 2. The cleanup worker's working period is proper? Should this interval
be configurable?
 3. Should we add a mount option to control this feature at mount time
rather than only having a compile-time CONFIG option? Or maybe apply
both? 
 4. Are there any potential of user-space breaking? Or other
vulnerability.

Future improvements:
 1. More sophisticated approach to when tracking should
start/resume/stop to reduce unnecessary calls and checks.
 2. improvementse Change Notify response process with various error code
and scenarios.

Basic functionality testing was performed on Ubuntu desktop with this
patchset applied, against both Windows 10 Home Server and RPI3 Samba
server environments. Also, Edge case testing may be insufficient, and I
would appreciate any help with additional test scenarios if possible.

My approach may be incorrect or incomplete in places. Please let me know
about thest issues without blame - I'm eager to learn and apply better
methods.

Thank you for taking your valuable time to review this work.

Best Regrads,
Sang-Heon Jeon

Sang-Heon Jeon (2):
  smb: client: export SMB2_notify_init for directory change tracking
  smb: client: add directory change tracking via SMB2 Change Notify

 fs/smb/client/Kconfig     |  17 ++
 fs/smb/client/Makefile    |   2 +
 fs/smb/client/connect.c   |   6 +
 fs/smb/client/notify.c    | 528 ++++++++++++++++++++++++++++++++++++++
 fs/smb/client/notify.h    |  19 ++
 fs/smb/client/readdir.c   |   9 +
 fs/smb/client/smb2pdu.c   |   8 +-
 fs/smb/client/smb2proto.h |   4 +
 8 files changed, 592 insertions(+), 1 deletion(-)
 create mode 100644 fs/smb/client/notify.c
 create mode 100644 fs/smb/client/notify.h

-- 
2.43.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-10-29 17:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-16 13:34 [RFC PATCH 0/2] smb: client: support directory change tracking Sang-Heon Jeon
2025-09-16 13:34 ` [RFC PATCH 1/2] smb: client: export SMB2_notify_init for " Sang-Heon Jeon
2025-09-16 13:34 ` [RFC PATCH 2/2] smb: client: add directory change tracking via SMB2 Change Notify Sang-Heon Jeon
2025-09-27  1:03   ` Sang-Heon Jeon
2025-09-27  8:39     ` Amir Goldstein
2025-09-29 16:51       ` Sang-Heon Jeon
2025-09-29 17:06         ` Amir Goldstein
2025-10-17  4:05           ` Sang-Heon Jeon
2025-10-23 15:30             ` Amir Goldstein
2025-10-28 16:13               ` Sang-Heon Jeon
2025-10-29 12:39                 ` Amir Goldstein
2025-10-29 17:13                   ` Sang-Heon Jeon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox