From b770ff6eb2013641170b37a05d682d210b49c6a6 Mon Sep 17 00:00:00 2001 From: Jeff Roberson Date: Sat, 18 Jun 2005 18:17:03 +0000 Subject: [PATCH] - Try to catch the wrong bufobj panics a little earlier. I believe they are actually caused by a buf with both VNCLEAN and VNDIRTY set. In the traces it is clear that the buf is removed from the dirty queue while it is actually on the clean queue which leaves the tail pointer set. Assert that both flags are not set in buf_vlist_add and buf_vlist_remove. Sponsored by: Isilon Systems, Inc. Approved by: re (blanket vfs) --- sys/kern/vfs_subr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 4379a8e4d1fb..1697696acf40 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1260,6 +1260,9 @@ buf_vlist_remove(struct buf *bp) KASSERT(bp->b_bufobj != NULL, ("No b_bufobj %p", bp)); ASSERT_BO_LOCKED(bp->b_bufobj); + KASSERT((bp->b_xflags & (BX_VNDIRTY|BX_VNCLEAN)) != + (BX_VNDIRTY|BX_VNCLEAN), + ("buf_vlist_remove: Buf %p is on two lists", bp)); if (bp->b_xflags & BX_VNDIRTY) bv = &bp->b_bufobj->bo_dirty; else @@ -1293,6 +1296,8 @@ buf_vlist_add(struct buf *bp, struct bufobj *bo, b_xflags_t xflags) struct bufv *bv; ASSERT_BO_LOCKED(bo); + KASSERT((bp->b_xflags & (BX_VNDIRTY|BX_VNCLEAN)) == 0, + ("buf_vlist_add: Buf %p has existing xflags %d", bp, bp->b_xflags)); bp->b_xflags |= xflags; if (xflags & BX_VNDIRTY) bv = &bo->bo_dirty;