There are two problems in this report. The second one turned up while debugging the first. 1. Previous versions of nested directories fail when catia comes before shadow_copy2 When catia is listed before shadow_copy2 in vfs objects, opening previous versions fails for paths that are a few directories deep. With the modules in the opposite order it works. Example share: [shadow] path = /srv/samba/test/snapshots-test vfs objects = catia shadow_copy2 shadow:mountpoint = /srv/samba/test/snapshots-test shadow:snapdir = snapshots with a snapshot at snapshots/@GMT-2026.10.28-15.15.30/ containing a/b/c/d/file.txt. $ smbclient //server/shadow -c "allinfo a/b/c/d" ... @GMT-2026.10.28-15.15.30 pathinfo(@GMT-2026.10.28-15.15.30\a\b\c\d) failed: NT_STATUS_OBJECT_PATH_NOT_FOUND Paths with only one or two directory levels work. Cause: for snapshot paths, in openat_pathref_fsp_nosymlink() smbd opens the path one directory at a time and reuses file handles. vfs_catia caches a translated name per file handle and doesn't notice that a reused handle now stands for a different directory. It then hands a stale directory name down to shadow_copy2, which builds the wrong snapshot path. The fix is to drop the VFS module state of a handle when it gets reused during the path walk. 2. shadow_copy2 disables the fast path lookup for the whole share Just having shadow_copy2 in the VFS stack disables the fastpath lookup via openat2() with RESOLVE_NO_SYMLINKS for every path on the share, not only for snapshot paths. shadow_copy2 rejected the flag unconditionally, so smbd always tried the fast lookup first, failed, and fell back to opening the path one directory at a time. The fix lets non-snapshot opens pass straight through shadow_copy2, so only snapshot paths still take the slow route. Have patches, need bugnumber.
*** Bug 16298 has been marked as a duplicate of this bug. ***
We hit exactly this in production on 4.22.11 (Debian 13, 3-node CTDB cluster, CephFS kernel mount, vfs objects = catia fruit streams_xattr acl_xattr shadow_copy2): "Previous Versions" fails for anything below three directory levels. Standalone reproducer and level 10 log are attached to bug 16298. We worked around it by removing catia (no catia:mappings in use). We'd appreciate a backport to 4.22 and 4.23 and are happy to test the patches from MR 4786 against 4.22 with our reproducer.
This bug was referenced in samba master: e09de2cbdbba357cc281e16b08585cc74b38c421 885ed5544347adbd569a470b9df13ef041578e23 1e9c1cd2bd613e0784d59148f4742bf4307ba72d