Module Name: src Committed By: martin Date: Fri Jan 1 18:58:58 UTC 2016
Modified Files: src/sys/kern: vfs_bio.c Log Message: KASSERT->KASSERTMSG to allow debugging a double-free'd buffer in ddb. To generate a diff of this commit: cvs rdiff -u -r1.256 -r1.257 src/sys/kern/vfs_bio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/vfs_bio.c diff -u src/sys/kern/vfs_bio.c:1.256 src/sys/kern/vfs_bio.c:1.257 --- src/sys/kern/vfs_bio.c:1.256 Mon Aug 24 22:50:32 2015 +++ src/sys/kern/vfs_bio.c Fri Jan 1 18:58:58 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_bio.c,v 1.256 2015/08/24 22:50:32 pooka Exp $ */ +/* $NetBSD: vfs_bio.c,v 1.257 2016/01/01 18:58:58 martin Exp $ */ /*- * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -123,7 +123,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.256 2015/08/24 22:50:32 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.257 2016/01/01 18:58:58 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_bufcache.h" @@ -328,7 +328,8 @@ binstailfree(buf_t *bp, struct bqueue *d { KASSERT(mutex_owned(&bufcache_lock)); - KASSERT(bp->b_freelistindex == -1); + KASSERTMSG(bp->b_freelistindex == -1, "double free of buffer? " + "bp=%p, b_freelistindex=%d\n", bp, bp->b_freelistindex); TAILQ_INSERT_TAIL(&dp->bq_queue, bp, b_freelist); dp->bq_bytes += bp->b_bufsize; bp->b_freelistindex = dp - bufqueues;