After upgrading Debian from version 11 to 12, we have observed incorrect behavior of our mechanism for sharing logs from filesystems mounted using autofs through Samba. The autofs configuration appears as follows: File /etc/auto.master: /mnt/linbkp1 /etc/autofs.linbkp1 --timeout=60,--ghost File /etc/autofs.linbkp1: dd -fstype=nfs,ro, linbkp1:/mnt/dd Autofs itself works well - when the resource is not mounted, accessing the directory from shell triggers its mounting. The /mnt directory is shared in Samba in the standard way: [mnt] path = /mnt browseable = yes read only = yes force user = root guest ok = no When access to the directory is initiated from a Linux system and the resource is still mounted, the shared directory works correctly. However, if the resource expires and is unmounted from the filesystem, Samba version 4.17.12 fails to access the resource. Attempting to list the resource results in an error: smb: \linbkp1\dd\> ls NT_STATUS_OBJECT_NAME_NOT_FOUND listing \linbkp1\dd\* In Debian 11, where Samba 4.13.13 was used, a similar operation would mount the resource, and if not on the first attempt, then subsequent attempts to list the contents of the directory would display them correctly. This mechanism also worked in older versions of Samba (from Debian 9 and Debian 10). I also tested Samba in debian-backports (samba 4.19.4) and debian-experimental (samba 4.20.0~rc1), as well as with Red Hat 9 (Samba 4.18.6), and the error still persists.
Not that it helps you directly, but I believe https://gitlab.com/samba-team/samba/-/commit/ac7a16f9cc4bd97ef546d1b7b02605991000d0f9 should fix your problem
*** Bug 15679 has been marked as a duplicate of this bug. ***
Thanks Volker! I applied ac7a16f9 on top of Debian/sid's 4.20.2+dfsg-6 and can confirm that this solves the problem for me.