flush_inodedep_deps(): If softdep_lookupvp() returns NULL it means the

inode has been reclaimed.  Skip the VOP_PUTPAGES() in this case.

Reviewed by: Chuck Silvers <chs@netbsd.org>
This commit is contained in:
hannken 2005-05-07 14:24:14 +00:00
parent 239b1361f7
commit a71c653aca

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_softdep.c,v 1.63 2005/02/26 22:32:20 perry Exp $ */ /* $NetBSD: ffs_softdep.c,v 1.64 2005/05/07 14:24:14 hannken Exp $ */
/* /*
* Copyright 1998 Marshall Kirk McKusick. All Rights Reserved. * Copyright 1998 Marshall Kirk McKusick. All Rights Reserved.
@ -33,7 +33,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ffs_softdep.c,v 1.63 2005/02/26 22:32:20 perry Exp $"); __KERNEL_RCSID(0, "$NetBSD: ffs_softdep.c,v 1.64 2005/05/07 14:24:14 hannken Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/buf.h> #include <sys/buf.h>
@ -5136,7 +5136,6 @@ flush_inodedep_deps(fs, ino)
struct vnode *vp; struct vnode *vp;
vp = softdep_lookupvp(fs, ino); vp = softdep_lookupvp(fs, ino);
KASSERT(vp != NULL);
/* /*
* This work is done in two passes. The first pass grabs most * This work is done in two passes. The first pass grabs most
@ -5166,16 +5165,26 @@ flush_inodedep_deps(fs, ino)
* let's just do it here. * let's just do it here.
*/ */
FREE_LOCK(&lk); if (vp != NULL) {
simple_lock(&vp->v_interlock); FREE_LOCK(&lk);
error = VOP_PUTPAGES(vp, 0, 0, PGO_ALLPAGES | PGO_CLEANIT | simple_lock(&vp->v_interlock);
(waitfor == MNT_NOWAIT ? 0: PGO_SYNCIO)); error = VOP_PUTPAGES(vp, 0, 0,
if (waitfor == MNT_WAIT) { PGO_ALLPAGES | PGO_CLEANIT |
drain_output(vp, 0); (waitfor == MNT_NOWAIT ? 0: PGO_SYNCIO));
} if (waitfor == MNT_WAIT) {
ACQUIRE_LOCK(&lk); drain_output(vp, 0);
if (error) { }
return error; ACQUIRE_LOCK(&lk);
if (error) {
return error;
}
} else {
/*
* The inode has been reclaimed. Be sure no
* dependencies to flush pages remain.
*/
KASSERT(TAILQ_EMPTY(&inodedep->id_inoupdt));
KASSERT(TAILQ_EMPTY(&inodedep->id_newinoupdt));
} }
for (adp = TAILQ_FIRST(&inodedep->id_inoupdt); adp; for (adp = TAILQ_FIRST(&inodedep->id_inoupdt); adp;