[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
itrunc3 panic fix: attempt #1
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: itrunc3 panic fix: attempt #1
- From: Constantine Sapuntzakis <csapuntz_(_at_)_stanford_(_dot_)_edu>
- Date: Sun, 29 Nov 1998 18:20:55 -0800 (PST)
- Cc: art_(_at_)_cvs_(_dot_)_openbsd_(_dot_)_org, deraadt_(_at_)_cvs_(_dot_)_openbsd_(_dot_)_org, markc_(_at_)_webFreaks_(_dot_)_net
I found that vinvalbuf is insufficiently protected. This might be
causing the panics. Please try the following patch and see if they go
away.
Index: vfs_subr.c
===================================================================
RCS file: /cvs/src/sys/kern/vfs_subr.c,v
retrieving revision 1.25
diff -u -w -u -r1.25 vfs_subr.c
--- vfs_subr.c 1998/11/20 01:35:32 1.25
+++ vfs_subr.c 1998/11/30 02:19:43
@@ -1853,6 +1853,7 @@
}
splx(s);
}
+ s = splbio();
for (;;) {
if ((blist = vp->v_cleanblkhd.lh_first) &&
(flags & V_SAVEMETA))
@@ -1869,32 +1870,34 @@
nbp = bp->b_vnbufs.le_next;
if (flags & V_SAVEMETA && bp->b_lblkno < 0)
continue;
- s = splbio();
if (bp->b_flags & B_BUSY) {
bp->b_flags |= B_WANTED;
error = tsleep((caddr_t)bp,
slpflag | (PRIBIO + 1), "vinvalbuf",
slptimeo);
+ if (error) {
splx(s);
- if (error)
return (error);
+ }
break;
}
bp->b_flags |= B_BUSY | B_VFLUSH;
- splx(s);
/*
* XXX Since there are no node locks for NFS, I believe
* there is a slight chance that a delayed write will
* occur while sleeping just above, so check for it.
*/
if ((bp->b_flags & B_DELWRI) && (flags & V_SAVE)) {
+ splx(s);
(void) VOP_BWRITE(bp);
+ s = splbio();
break;
}
bp->b_flags |= B_INVAL;
brelse(bp);
}
}
+ splx(s);
if (!(flags & V_SAVEMETA) &&
(vp->v_dirtyblkhd.lh_first || vp->v_cleanblkhd.lh_first))
panic("vinvalbuf: flush failed");
Visit your host, monkey.org