[Bug 284914] autofs(4) confuses fts(3)

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 20 Feb 2025 02:06:03 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=284914

--- Comment #2 from Lexi Winter <lexi@hemlock.eden.le-fay.org> ---
 33368 find     CALL  write(0x1,0x28240d651000,0x1e)
 33368 find     GIO   fd 1 wrote 30 bytes
       "/home/ft/.ssh/known_hosts.old
       "
 33368 find     RET   write 30/0x1e
 33368 find     CALL 
open(0x2675923a9781,0x120000<O_RDONLY|O_DIRECTORY|O_CLOEXEC>)
 33368 find     NAMI  ".."
 33368 find     RET   open 5
 33368 find     CALL  fstat(0x5,0x267590a00240)
 33368 find     STRU  struct stat {dev=687931149, ino=34, mode=040700, nlink=6,
uid=10020, gid=10006, rdev=0, atime=1740008641.500888000,
mtime=1730971526.664459000, ctime=1740008836.602277000,
birthtime=1730971526.664459000, size=18, blksize=4096, blocks=17, flags=0x800 }
 33368 find     RET   fstat 0
 33368 find     CALL  close(0x5)
 33368 find     RET   close 0
 33368 find     CALL  write(0x2,0x2675909ffb80,0x6)
 33368 find     GIO   fd 2 wrote 6 bytes
       "find: "

the device is (as expected) different from when it first opened the directory:

 33368 find     CALL  statfs(0x28240d644000,0x28240d63a058)
 33368 find     NAMI  "/home/ft"
 33368 find     RET   statfs 0
 33368 find     CALL  fstat(0x5,0x267590a00170)
 33368 find     STRU  struct stat {dev=18446744072887533315, ino=7,
mode=040755, nlink=3, uid=0, gid=0, rdev=0, atime=1740015874.694741010,
mtime=1740015874.694741010, ctime=1740015874.694741010,
birthtime=1740015874.694741010, size=512, blksize=4096, blocks=1, flags=0x0 }

i suspect this trips the check in fts.c:fts_safe_changedir():

        if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) {               
                errno = ENOENT;         /* disinformation */                    
                ret = -1;                                                       
                goto bail;                                                      
        }

-- 
You are receiving this mail because:
You are the assignee for the bug.