Bug 15578 - samba doesn't work with autofs in ghost mode
Summary: samba doesn't work with autofs in ghost mode
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.17.12
Hardware: x64 Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
Depends on:
Reported: 2024-02-09 11:09 UTC by Bartek Chanda
Modified: 2024-02-09 11:09 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Bartek Chanda 2024-02-09 11:09:41 UTC
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:

   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.