1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-11 14:10:34 +00:00

Add a check for MNTK_UNMOUNTF at the beginning of nfs_sync()

in the new NFS client so that a forced dismount doesn't
get stuck in the VFS_SYNC() call that happens before
VFS_UNMOUNT() in dounmount().
Additional changes are needed before forced dismounts will work.

MFC after:	2 weeks
This commit is contained in:
Rick Macklem 2011-05-26 22:05:35 +00:00
parent 9c418f51ca
commit 8b5e8315a7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=222329

View File

@ -1458,10 +1458,20 @@ nfs_sync(struct mount *mp, int waitfor)
td = curthread;
MNT_ILOCK(mp);
/*
* If a forced dismount is in progress, return from here so that
* the umount(2) syscall doesn't get stuck in VFS_SYNC() before
* calling VFS_UNMOUNT().
*/
if ((mp->mnt_kern_flag & MNTK_UNMOUNTF) != 0) {
MNT_IUNLOCK(mp);
return (EBADF);
}
/*
* Force stale buffer cache information to be flushed.
*/
MNT_ILOCK(mp);
loop:
MNT_VNODE_FOREACH(vp, mp, mvp) {
VI_LOCK(vp);