diff options
author | phk <phk@FreeBSD.org> | 2002-11-01 15:32:12 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-11-01 15:32:12 +0000 |
commit | 85539f2f6cf7db5cdb12846675492a4ab0bfeae0 (patch) | |
tree | 300c1a2d2779db4dce526e0a803ee5abd7d9f636 | |
parent | b7e16f352965af4600c8c6494610b0a649a404d1 (diff) | |
download | FreeBSD-src-85539f2f6cf7db5cdb12846675492a4ab0bfeae0.zip FreeBSD-src-85539f2f6cf7db5cdb12846675492a4ab0bfeae0.tar.gz |
Put a KASSERT in specfs::strategy() to check that the incoming buffer
has a valid b_iocmd. Valid is any one of BIO_{READ,WRITE,DELETE}.
I have seen at least one case where the bio_cmd field was zero once the
request made it into GEOM. Putting the KASSERT here allows us to spot
the culprit in the backtrace.
-rw-r--r-- | sys/fs/specfs/spec_vnops.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index ed5c2bc..5700f10 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -532,6 +532,14 @@ spec_strategy(ap) struct cdevsw *dsw; struct thread *td = curthread; + bp = ap->a_bp; + vp = ap->a_vp; + + KASSERT(bp->b_iocmd == BIO_READ || + bp->b_iocmd == BIO_WRITE || + bp->b_iocmd == BIO_DELETE, + ("Wrong b_iocmd buf=%p cmd=%d", bp, bp->b_iocmd)); + /* * Slow down disk requests for niced processes. */ @@ -541,8 +549,6 @@ spec_strategy(ap) PPAUSE | PCATCH | PDROP, "ioslow", td->td_ksegrp->kg_nice); } - bp = ap->a_bp; - vp = ap->a_vp; if (bp->b_iocmd == BIO_WRITE) { if ((bp->b_flags & B_VALIDSUSPWRT) == 0 && bp->b_vp != NULL && bp->b_vp->v_mount != NULL && |