PR kern/40210 5.0 BETA WAPBL related crash
This commit is contained in:
parent
d003f8f69b
commit
83f7350f6d
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: ffs_vnops.c,v 1.104 2008/10/10 09:21:58 hannken Exp $ */
|
/* $NetBSD: ffs_vnops.c,v 1.105 2008/12/21 10:44:32 ad Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: ffs_vnops.c,v 1.104 2008/10/10 09:21:58 hannken Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: ffs_vnops.c,v 1.105 2008/12/21 10:44:32 ad Exp $");
|
||||||
|
|
||||||
#if defined(_KERNEL_OPT)
|
#if defined(_KERNEL_OPT)
|
||||||
#include "opt_ffs.h"
|
#include "opt_ffs.h"
|
||||||
|
@ -402,12 +402,25 @@ out:
|
||||||
int
|
int
|
||||||
ffs_full_fsync(struct vnode *vp, int flags)
|
ffs_full_fsync(struct vnode *vp, int flags)
|
||||||
{
|
{
|
||||||
|
extern struct vfsops ffs_vfsops;
|
||||||
struct buf *bp, *nbp;
|
struct buf *bp, *nbp;
|
||||||
int error, passes, skipmeta, inodedeps_only, waitfor;
|
int error, passes, skipmeta, inodedeps_only, waitfor;
|
||||||
struct mount *mp;
|
struct mount *mp;
|
||||||
|
bool ffsino;
|
||||||
|
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|
||||||
|
if ((flags & FSYNC_VFS) != 0) {
|
||||||
|
KASSERT(vp->v_specmountpoint != NULL);
|
||||||
|
mp = vp->v_specmountpoint;
|
||||||
|
ffsino = (mp->mnt_op == &ffs_vfsops);
|
||||||
|
KASSERT(vp->v_type == VBLK);
|
||||||
|
} else {
|
||||||
|
mp = vp->v_mount;
|
||||||
|
ffsino = true;
|
||||||
|
KASSERT(vp->v_tag == VT_UFS);
|
||||||
|
}
|
||||||
|
|
||||||
if (vp->v_type == VBLK &&
|
if (vp->v_type == VBLK &&
|
||||||
vp->v_specmountpoint != NULL &&
|
vp->v_specmountpoint != NULL &&
|
||||||
(vp->v_specmountpoint->mnt_flag & MNT_SOFTDEP))
|
(vp->v_specmountpoint->mnt_flag & MNT_SOFTDEP))
|
||||||
|
@ -425,11 +438,6 @@ ffs_full_fsync(struct vnode *vp, int flags)
|
||||||
if (vp->v_type == VREG || vp->v_type == VBLK) {
|
if (vp->v_type == VREG || vp->v_type == VBLK) {
|
||||||
int pflags = PGO_ALLPAGES | PGO_CLEANIT;
|
int pflags = PGO_ALLPAGES | PGO_CLEANIT;
|
||||||
|
|
||||||
if ((flags & FSYNC_VFS) != 0 && vp->v_specmountpoint != NULL)
|
|
||||||
mp = vp->v_specmountpoint;
|
|
||||||
else
|
|
||||||
mp = vp->v_mount;
|
|
||||||
|
|
||||||
if ((flags & FSYNC_WAIT))
|
if ((flags & FSYNC_WAIT))
|
||||||
pflags |= PGO_SYNCIO;
|
pflags |= PGO_SYNCIO;
|
||||||
if (vp->v_type == VREG &&
|
if (vp->v_type == VREG &&
|
||||||
|
@ -439,7 +447,6 @@ ffs_full_fsync(struct vnode *vp, int flags)
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
} else {
|
} else {
|
||||||
mp = vp->v_mount;
|
|
||||||
mutex_exit(&vp->v_interlock);
|
mutex_exit(&vp->v_interlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,7 +456,7 @@ ffs_full_fsync(struct vnode *vp, int flags)
|
||||||
if (flags & FSYNC_DATAONLY)
|
if (flags & FSYNC_DATAONLY)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
if (VTOI(vp) && (VTOI(vp)->i_flag &
|
if (ffsino && VTOI(vp) && (VTOI(vp)->i_flag &
|
||||||
(IN_ACCESS | IN_CHANGE | IN_UPDATE | IN_MODIFY |
|
(IN_ACCESS | IN_CHANGE | IN_UPDATE | IN_MODIFY |
|
||||||
IN_MODIFIED | IN_ACCESSED))) {
|
IN_MODIFIED | IN_ACCESSED))) {
|
||||||
error = UFS_WAPBL_BEGIN(mp);
|
error = UFS_WAPBL_BEGIN(mp);
|
||||||
|
@ -569,12 +576,8 @@ loop:
|
||||||
else
|
else
|
||||||
waitfor = (flags & FSYNC_WAIT) ? UPDATE_WAIT : 0;
|
waitfor = (flags & FSYNC_WAIT) ? UPDATE_WAIT : 0;
|
||||||
|
|
||||||
if (vp->v_tag == VT_UFS)
|
if (ffsino)
|
||||||
error = ffs_update(vp, NULL, NULL, waitfor);
|
error = ffs_update(vp, NULL, NULL, waitfor);
|
||||||
else {
|
|
||||||
KASSERT(vp->v_type == VBLK);
|
|
||||||
KASSERT((flags & FSYNC_VFS) != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (error == 0 && flags & FSYNC_CACHE) {
|
if (error == 0 && flags & FSYNC_CACHE) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
Loading…
Reference in New Issue