diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-05-26 22:05:35 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-05-26 22:05:35 +0000 |
commit | 3f8cc808836c219c3bde9dd3c4912cd0128582aa (patch) | |
tree | dba86c753da6e8dfda4200c4f2f1e8671d6b5e30 /sys/fs | |
parent | a10f288d7ebbdbd8d41709521c07ba48fe4a650b (diff) | |
download | FreeBSD-src-3f8cc808836c219c3bde9dd3c4912cd0128582aa.zip FreeBSD-src-3f8cc808836c219c3bde9dd3c4912cd0128582aa.tar.gz |
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
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/nfsclient/nfs_clvfsops.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 84725dd..d962a54 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -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); |