diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2018-05-28 15:46:29 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2018-05-28 15:46:29 +0000 |
commit | b485ccecaf69421e50bdbe6d2225584c57ef77b8 (patch) | |
tree | 9dc1c4f1e4d4a69a01ddcf8297af67c87b578e4d /sys | |
parent | 2616bb094de9bac6f96899968157fd50359ad049 (diff) |
When mounting an ext2 filesystem, lock the device vnode for the duration
of the vinvalbuf() call, just like is done by other filesystems. This
prevents a kernel panic with VFSLCKDEBUG.
OK mpi@
Diffstat (limited to 'sys')
-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 70290930cb5..ae9888e9b17 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.107 2018/05/27 06:02:15 visa Exp $ */ +/* $OpenBSD: ext2fs_vfsops.c,v 1.108 2018/05/28 15:46:28 visa Exp $ */ /* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */ /* @@ -504,7 +504,10 @@ ext2fs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p) return (error); if (vcount(devvp) > 1 && devvp != rootvp) return (EBUSY); - if ((error = vinvalbuf(devvp, V_SAVE, cred, p, 0, 0)) != 0) + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); + error = vinvalbuf(devvp, V_SAVE, cred, p, 0, 0); + VOP_UNLOCK(devvp); + if (error != 0) return (error); ronly = (mp->mnt_flag & MNT_RDONLY) != 0; |