After being successfully mounted by automountd, a smbfs directory is never unmounted by autounmountd -- even after days of inactivity. # cat /etc/auto_master ... /- /etc/auto_smbfs # cat /etc/auto_smbfs /home/xxx/Work -fstype=smbfs,-N,-Innn.nnn.nnn.nnn,-uxxx,-gxxx ://xxx@nnn.nnn.nnn.nnn/Work # service automountd status automountd is running as pid 1147. # ps -Ostart -p 1147 PID STARTED TT STAT TIME COMMAND 1147 Mon09PM - Is 0:00.00 /usr/sbin/automountd # service autounmountd status autounmountd is running as pid 1135. # ps -Ostart -p 1135 PID STARTED TT STAT TIME COMMAND 1135 Mon09PM - Is 0:00.06 /usr/sbin/autounmountd # mount ... map /etc/auto_smbfs on /usr/home/xxx/Work (autofs) //XXX@nnn.nnn.nnn.nnn/WORK on /usr/home/xxx/Work (smbfs, automounted) # fuser -c /usr/home/xxx/Work /usr/home/xxx/Work:
Could you try the patch below? Index: sys/fs/smbfs/smbfs_vfsops.c =================================================================== --- sys/fs/smbfs/smbfs_vfsops.c (revision 274743) +++ sys/fs/smbfs/smbfs_vfsops.c (working copy) @@ -401,8 +401,6 @@ scred = smbfs_malloc_scred(); smb_makescred(scred, td, td->td_ucred); error = smbfs_smb_statfs(ssp, sbp, scred); - if (error == 0) - sbp->f_flags = 0; /* copy of mount exported flags */ smbfs_free_scred(scred); return (error); }
Yes, I'll try the patch this evening. Thanks.
The patch worked. Thanks again. Also, my version is 10.1-RELEASE; I mistakenly entered 10.1-STABLE initially.
A commit references this bug: Author: trasz Date: Fri Nov 21 06:21:40 UTC 2014 New revision: 274784 URL: https://svnweb.freebsd.org/changeset/base/274784 Log: Fix smbfs to not zero out statfs f_flags field. Previously, this made getmntinfo() return empty flags for smbfs filesystems when called with MNT_WAIT. It's not visible with mount(8), since it uses MNT_NOWAIT, but broke autounmount(8) operation. PR: 195161 Differential Revision: https://reviews.freebsd.org/D1194 Reviewed by: kib@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Changes: head/sys/fs/smbfs/smbfs_vfsops.c
A commit references this bug: Author: trasz Date: Sun Dec 21 11:33:19 UTC 2014 New revision: 276002 URL: https://svnweb.freebsd.org/changeset/base/276002 Log: MFC r274784: Fix smbfs to not zero out statfs f_flags field. Previously, this made getmntinfo() return empty flags for smbfs filesystems when called with MNT_WAIT. It's not visible with mount(8), since it uses MNT_NOWAIT, but broke autounmount(8) operation. PR: 195161 Sponsored by: The FreeBSD Foundation Changes: _U stable/10/ stable/10/sys/fs/smbfs/smbfs_vfsops.c