- BUF_REFCNT() seems to be the preferred method for verifying a locked buf.

Tell vop_strategy_pre() to use this instead.
 - Ignore B_CLUSTER bufs.  Their components are locked but they don't really
   exist so they don't have to be.  This isn't ideal but it is safe.
This commit is contained in:
Jeff Roberson 2002-07-07 05:29:45 +00:00
parent 49244e35ff
commit bed75d4627

View File

@ -257,11 +257,17 @@ void
vop_strategy_pre(void *ap)
{
struct vop_strategy_args *a = ap;
int status;
struct buf *bp;
status = lockstatus(&a->a_bp->b_lock, curthread);
bp = a->a_bp;
if (status != LK_SHARED && status != LK_EXCLUSIVE) {
/*
* Cluster ops lock their component buffers but not the IO container.
*/
if ((bp->b_flags & B_CLUSTER) != 0)
return;
if (BUF_REFCNT(bp) < 1) {
if (vfs_badlock_print)
printf("VOP_STRATEGY: bp is not locked but should be.\n");
if (vfs_badlock_panic)