From: Ben Kaduk Date: Fri, 18 Jun 2010 04:05:14 +0000 (-0400) Subject: Try to flush vnodes in FBSD's unmount, bailing if necessary X-Git-Tag: openafs-devel-1_5_75~83 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=53febebc8a69c3231fb2c7094294f59b747a6ec9;p=packages%2Fo%2Fopenafs.git 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 --- diff --git a/src/afs/FBSD/osi_vfsops.c b/src/afs/FBSD/osi_vfsops.c index 95c5ace55..df8df19f1 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