diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2018-05-29 14:29:53 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2018-05-29 14:29:53 +0000 |
commit | 67d786b9ef1e1b9382cd2c3df24e5195c233438d (patch) | |
tree | 7a6479f67fbb7d3889705924822a46ed6f4d0985 | |
parent | 7fda55b6108d7b9658f7c357c65c2cbcc535e0c2 (diff) |
Lock the device vnode when calling vinvalbuf() in ext2fs_reload(),
just as is done in ffs_reload().
Requested by and OK bluhm@
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_vfsops.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c index ae9888e9b17..4adb7f11b5a 100644 --- a/sys/ufs/ext2fs/ext2fs_vfsops.c +++ b/sys/ufs/ext2fs/ext2fs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vfsops.c,v 1.108 2018/05/28 15:46:28 visa Exp $ */ +/* $OpenBSD: ext2fs_vfsops.c,v 1.109 2018/05/29 14:29:52 visa Exp $ */ /* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */ /* @@ -442,7 +442,10 @@ ext2fs_reload(struct mount *mountp, struct ucred *cred, struct proc *p) * Step 1: invalidate all cached meta-data. */ devvp = VFSTOUFS(mountp)->um_devvp; - if (vinvalbuf(devvp, 0, cred, p, 0, 0)) + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); + error = vinvalbuf(devvp, 0, cred, p, 0, 0); + VOP_UNLOCK(devvp); + if (error != 0) panic("ext2fs_reload: dirty1"); /* |