diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2006-08-06 18:42:02 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2006-08-06 18:42:02 +0000 |
commit | 86b0e9841c734d03c0061a08c6defcd360133f65 (patch) | |
tree | 0934a3c5c967aacd5db1309cd537b488566addec /sys/isofs | |
parent | aea23d2253246c3537bcfc024f98ae378b87f0e7 (diff) |
obey the locking disaplince wrt to VOP_CLOSE during umounts
and mount error paths.
ok sturm@ pedro@
Diffstat (limited to 'sys/isofs')
-rw-r--r-- | sys/isofs/cd9660/cd9660_vfsops.c | 20 | ||||
-rw-r--r-- | sys/isofs/udf/udf_vfsops.c | 5 |
2 files changed, 18 insertions, 7 deletions
diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c index 8cd5424647d..7bdf1faa5d6 100644 --- a/sys/isofs/cd9660/cd9660_vfsops.c +++ b/sys/isofs/cd9660/cd9660_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd9660_vfsops.c,v 1.40 2006/06/28 15:07:00 pedro Exp $ */ +/* $OpenBSD: cd9660_vfsops.c,v 1.41 2006/08/06 18:42:01 thib Exp $ */ /* $NetBSD: cd9660_vfsops.c,v 1.26 1997/06/13 15:38:58 pk Exp $ */ /*- @@ -251,7 +251,10 @@ iso_mountfs(devvp, mp, p, argp) return (error); if (vcount(devvp) > 1 && devvp != rootvp) return (EBUSY); - if ((error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0)) != 0) + vn_lock(devvp, LK_EXCLUSIVE|LK_RETRY, p); + error = vinvalbuf(devvp, V_SAVE, p->p_ucred, p, 0, 0); + VOP_UNLOCK(devvp, 0, p); + if (error != 0); return (error); error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p); @@ -430,9 +433,11 @@ out: brelse(bp); if (supbp) brelse(supbp); - if (needclose) - (void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, - p); + if (needclose) { + vn_lock(devvp, LK_EXCLUSIVE|LK_RETRY, p); + VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p); + VOP_UNLOCK(devvp, 0, p); + } if (isomp) { free((caddr_t)isomp, M_ISOFSMNT); mp->mnt_data = (qaddr_t)0; @@ -567,8 +572,11 @@ cd9660_unmount(mp, mntflags, p) #endif isomp->im_devvp->v_specmountpoint = NULL; + + vn_lock(isomp->im_devvp, LK_EXCLUSIVE|LK_RETRY, p); error = VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, p); - vrele(isomp->im_devvp); + vput(isomp->im_devvp); + free((caddr_t)isomp, M_ISOFSMNT); mp->mnt_data = (qaddr_t)0; mp->mnt_flag &= ~MNT_LOCAL; diff --git a/sys/isofs/udf/udf_vfsops.c b/sys/isofs/udf/udf_vfsops.c index d30612c67db..75777c404b7 100644 --- a/sys/isofs/udf/udf_vfsops.c +++ b/sys/isofs/udf/udf_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udf_vfsops.c,v 1.21 2006/07/11 22:02:08 pedro Exp $ */ +/* $OpenBSD: udf_vfsops.c,v 1.22 2006/08/06 18:42:01 thib Exp $ */ /* * Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org> @@ -401,7 +401,10 @@ bail: } if (bp != NULL) brelse(bp); + + vn_lock(devvp, LK_EXCLUSIVE|LK_RETRY, p); VOP_CLOSE(devvp, FREAD, FSCRED, p); + VOP_UNLOCK(devvp, 0, p); return (error); } |