]> git.ipfire.org Git - thirdparty/samba.git/commit
smbd: Simplify inotify_handler()
authorVolker Lendecke <vl@samba.org>
Fri, 23 May 2025 13:22:39 +0000 (15:22 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 2 Jun 2025 17:08:34 +0000 (17:08 +0000)
commit2b317dd80002b7f87710317118bca35a20e85f4c
tree2cf5d272a650cfd39335a170b77e2d6f62e6eff6
parent4ed098b6730bb6bd09eaada0c228b29d4b6abb6a
smbd: Simplify inotify_handler()

[sizeof(struct inotify_event) + NAME_MAX + 1] is the recommended
buffer size in "man 7 inotify". Pulling everything out of the inotify
buffer makes sense if we would reliably get the two rename events in
the same read-call. Unfortunately this is not the case, even with a
buffer size of 64k I've seen MOVED_FROM and MOVED_to in separate reads
from the socket. We'll have to take care of this situation next. Until
then, we don't have to FIONREAD and then read everything that's
there. Rather go through another event loop, replacing the ioctl with
a epoll_wait syscall.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15864
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/notify_inotify.c