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 <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Ben Kaduk 2010-06-18 00:05:14 -04:00 committed by Derrick Brashear
parent 73a3990f44
commit 53febebc8a

View File

@ -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