diff options
author | jhb <jhb@FreeBSD.org> | 2001-06-28 03:50:17 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-06-28 03:50:17 +0000 |
commit | 54c05ef2f2ac9b7b4b641808d5ca5a0dbeef7a6a (patch) | |
tree | d94cf199c4a7049b5e10cd020dcee3d2cf8a1011 /sys/fs/unionfs/union_vfsops.c | |
parent | fe47a79f92a98691f51822ae0a94e572b069d46e (diff) | |
download | FreeBSD-src-54c05ef2f2ac9b7b4b641808d5ca5a0dbeef7a6a.zip FreeBSD-src-54c05ef2f2ac9b7b4b641808d5ca5a0dbeef7a6a.tar.gz |
Protect the mnt_vnode list with the mntvnode lock.
Diffstat (limited to 'sys/fs/unionfs/union_vfsops.c')
-rw-r--r-- | sys/fs/unionfs/union_vfsops.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c index 1a5cb70..aa4986c 100644 --- a/sys/fs/unionfs/union_vfsops.c +++ b/sys/fs/unionfs/union_vfsops.c @@ -45,6 +45,8 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/lock.h> +#include <sys/mutex.h> #include <sys/proc.h> #include <sys/vnode.h> #include <sys/mount.h> @@ -330,9 +332,11 @@ union_unmount(mp, mntflags, p) int n; /* count #vnodes held on mount list */ + mtx_lock(&mntvnode_mtx); n = 0; LIST_FOREACH(vp, &mp->mnt_vnodelist, v_mntvnodes) n++; + mtx_unlock(&mntvnode_mtx); /* if this is unchanged then stop */ if (n == freeing) |