summaryrefslogtreecommitdiffstats
path: root/sys/fs/smbfs/smbfs_vfsops.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-12-13 23:44:00 +0000
committertjr <tjr@FreeBSD.org>2002-12-13 23:44:00 +0000
commitade731b9ae7a14138f3a30076e3b6fa818158124 (patch)
tree1a77f7c23d2fdcb275bbf718a62e17855b8f3b9e /sys/fs/smbfs/smbfs_vfsops.c
parentc0586fbb4fe74b933efc1631a397e510eb5e2319 (diff)
downloadFreeBSD-src-ade731b9ae7a14138f3a30076e3b6fa818158124.zip
FreeBSD-src-ade731b9ae7a14138f3a30076e3b6fa818158124.tar.gz
Keep trying to flush the vnode list for the mount while some are still
busy and we are making progress towards making them not busy. This is needed because smbfs vnodes reference their parent directory but may appear after their parent in the mount's vnode list; one pass over the list is not sufficient in this case. This stops attempts to unmount idle smbfs mounts failing with EBUSY.
Diffstat (limited to 'sys/fs/smbfs/smbfs_vfsops.c')
-rw-r--r--sys/fs/smbfs/smbfs_vfsops.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c
index 8dba8c8..db0bc84 100644
--- a/sys/fs/smbfs/smbfs_vfsops.c
+++ b/sys/fs/smbfs/smbfs_vfsops.c
@@ -243,8 +243,19 @@ smbfs_unmount(struct mount *mp, int mntflags, struct thread *td)
flags = 0;
if (mntflags & MNT_FORCE)
flags |= FORCECLOSE;
- /* There is 1 extra root vnode reference from smbfs_mount(). */
- error = vflush(mp, 1, flags);
+ /*
+ * Keep trying to flush the vnode list for the mount while
+ * some are still busy and we are making progress towards
+ * making them not busy. This is needed because smbfs vnodes
+ * reference their parent directory but may appear after their
+ * parent in the list; one pass over the vnode list is not
+ * sufficient in this case.
+ */
+ do {
+ smp->sm_didrele = 0;
+ /* There is 1 extra root vnode reference from smbfs_mount(). */
+ error = vflush(mp, 1, flags);
+ } while (error == EBUSY && smp->sm_didrele != 0);
if (error)
return error;
smb_makescred(&scred, td, td->td_ucred);
OpenPOWER on IntegriCloud