diff options
author | jeff <jeff@FreeBSD.org> | 2006-04-01 01:15:23 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2006-04-01 01:15:23 +0000 |
commit | 9fb762d2310a1ad2b83b2763b6b5b87d8234ca7a (patch) | |
tree | 4d1ed02707795595d8428f7d529a74c2e7e84554 /sys/nfsclient/nfs_vfsops.c | |
parent | db0836bdc320d1ca56591a60e6b6d18ab2b2ef10 (diff) | |
download | FreeBSD-src-9fb762d2310a1ad2b83b2763b6b5b87d8234ca7a.zip FreeBSD-src-9fb762d2310a1ad2b83b2763b6b5b87d8234ca7a.tar.gz |
- Busy the filesystem in nfs_statfs to prevent us from creating a new
vnode after vflush() has succeeded. This would cause a dangling vnode
panic at unmount time otherwise. Other filesystems may have this problem
via their VFS_VGET() routines.
Found by: kris
Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index be02893..2c74bee 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -248,9 +248,14 @@ nfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) #ifndef nolint sfp = NULL; #endif - error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np); + error = vfs_busy(mp, LK_NOWAIT, NULL, td); if (error) return (error); + error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np); + if (error) { + vfs_unbusy(mp, td); + return (error); + } vp = NFSTOV(np); if (v3 && (nmp->nm_state & NFSSTA_GOTFSINFO) == 0) (void)nfs_fsinfo(nmp, vp, td->td_ucred, td); @@ -292,6 +297,7 @@ nfs_statfs(struct mount *mp, struct statfs *sbp, struct thread *td) m_freem(mrep); nfsmout: vput(vp); + vfs_unbusy(mp, td); return (error); } |