From 53febebc8a69c3231fb2c7094294f59b747a6ec9 Mon Sep 17 00:00:00 2001 From: Ben Kaduk Date: Fri, 18 Jun 2010 00:05:14 -0400 Subject: [PATCH] Try to flush vnodes in FBSD's unmount, bailing if necessary vflush() actually returns something! Check if we get EBUSY, and don't continue if so. Also, actually call vflush on FBSD80_ENV. Note that we currently leak refs on our root vnode, so this means umount will fail unless it uses -f, for now. Change-Id: I8f02ebfa127409f0e8567f3efa7eccf491147cbd Change-Id: Iaa4666f1004b49b69a82c778a3de60633fac880f Reviewed-on: http://gerrit.openafs.org/2214 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/afs/FBSD/osi_vfsops.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/afs/FBSD/osi_vfsops.c b/src/afs/FBSD/osi_vfsops.c index 95c5ace558..df8df19f1b 100644 --- a/src/afs/FBSD/osi_vfsops.c +++ b/src/afs/FBSD/osi_vfsops.c @@ -155,6 +155,7 @@ afs_unmount(struct mount *mp, int flags) afs_unmount(struct mount *mp, int flags, struct thread *p) #endif { + int error = 0; /* * Release any remaining vnodes on this mount point. @@ -163,19 +164,22 @@ afs_unmount(struct mount *mp, int flags, struct thread *p) * This has to be done outside the global lock. */ #if defined(AFS_FBSD80_ENV) - /* do nothing */ + error = vflush(mp, 1, (flags & MNT_FORCE) ? FORCECLOSE : 0, curthread); #elif defined(AFS_FBSD53_ENV) - vflush(mp, 1, (flags & MNT_FORCE) ? FORCECLOSE : 0, p); + error = vflush(mp, 1, (flags & MNT_FORCE) ? FORCECLOSE : 0, p); #else - vflush(mp, 1, (flags & MNT_FORCE) ? FORCECLOSE : 0); + error = vflush(mp, 1, (flags & MNT_FORCE) ? FORCECLOSE : 0); #endif + if (error) + goto out; AFS_GLOCK(); AFS_STATCNT(afs_unmount); afs_globalVFS = 0; afs_shutdown(); AFS_GUNLOCK(); - return 0; +out: + return error; } int