On Friday, April 6, 2018 9:27:07 AM CEST Kamil Dudka wrote: > On Thursday, April 5, 2018 5:49:15 PM CEST Paul Eggert wrote: > > On 04/05/2018 05:44 AM, Kamil Dudka wrote: > > > Does this change (intentionally?) enable leaf optimization for CIFS? > > > > No, I wasn't thinking about CIFS when I wrote that. Thanks for reporting > > it. I installed the attached to try to fix this. I have not tested it > > with CIFS. > > Thanks! I have provided the Fedora user with a patched build of findutils, > will let you know when I have some feedback on that. > > Kamil
We have two independent testers of a debug build that contains the above patch. Unfortunately, the patch did not prevent 'find' from aborting. There must be some programming mistake in the code that checks whether the leaf optimization should be enabled or not. >From both the captured strace outputs it is obvious that fstatfs() is not called on the CIFS mount points at all. For example, if 'find' traverses /mnt/iamsbackup (where /mnt is an XFS file system and /mnt/iamsbackup a CIFS file system), it calls fstatfs() on the file descriptor of /mnt despite /mnt/iamsbackup already has its own file descriptor. Then it aborts while trying to leaf-optimize the traversal of /mnt/iamsbackup/... because 'find' thinks it is traversing an XFS file system: Any idea what could have gone wrong? Kamil [...] newfstatat(AT_FDCWD, "/mnt", {st_mode=S_IFDIR|0755, st_size=24, ...}, AT_SYMLINK_NOFOLLOW) = 0 fcntl(4, F_DUPFD_CLOEXEC, 3) = 5 getdents(4, /* 3 entries */, 32768) = 80 getdents(4, /* 0 entries */, 32768) = 0 close(4) = 0 newfstatat(5, "iamsbackup", {st_mode=S_IFDIR|0770, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0 fcntl(5, F_DUPFD_CLOEXEC, 0) = 4 openat(5, "iamsbackup", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 6 fstat(6, {st_mode=S_IFDIR|0770, st_size=4096, ...}) = 0 fcntl(6, F_GETFL) = 0x38800 (flags O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_NOFOLLOW|O_DIRECTORY) fcntl(6, F_SETFD, FD_CLOEXEC) = 0 newfstatat(5, "iamsbackup", {st_mode=S_IFDIR|0770, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0 fstatfs(5, {f_type=XFS_SB_MAGIC, f_bsize=4096, f_blocks=239342405, f_bfree=237648468, f_bavail=237648468, f_files=478918656, f_ffree=478852745, f_fsid={val=[2430, 0]}, f_namelen=255, f_frsi fcntl(6, F_DUPFD_CLOEXEC, 3) = 7 getdents(6, /* 9 entries */, 32768) = 296 getdents(6, /* 0 entries */, 32768) = 0 close(6) = 0 close(4) = 0 fcntl(7, F_DUPFD_CLOEXEC, 0) = 4 newfstatat(7, "latestBackup", {st_mode=S_IFDIR|0770, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0 openat(7, "latestBackup", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 6 fstat(6, {st_mode=S_IFDIR|0770, st_size=0, ...}) = 0 fcntl(6, F_GETFL) = 0x38800 (flags O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_NOFOLLOW|O_DIRECTORY) fcntl(6, F_SETFD, FD_CLOEXEC) = 0 rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0 getpid() = 7826 gettid() = 7826 tgkill(7826, 7826, SIGABRT) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=7826, si_uid=1001} --- +++ killed by SIGABRT (core dumped) +++