Permalink
Browse files

kernel - Try to catch possible bug in getnewbuf()

* Add a debugging kprintf() and cleanup code to attempt to catch a possible
  bug in getnewbuf() where a buffer is somehow left on a vnode's clean or
  dirty list before being reused.
  • Loading branch information...
1 parent c825189 commit cd3cfe0a90bb89c57adf2bda61d6fd7cb7356269 Matthew Dillon committed Feb 27, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 sys/kern/vfs_bio.c
View
@@ -2169,6 +2169,12 @@ getnewbuf(int blkflags, int slptimeo, int size, int maxsize)
if (bp->b_bufsize)
allocbuf(bp, 0);
+ if (bp->b_flags & (B_VNDIRTY | B_VNCLEAN | B_HASHED)) {
+ kprintf("getnewbuf: caught bug vp queue "
+ "%p/%08x qidx %d\n",
+ bp, bp->b_flags, qindex);
+ brelvp(bp);
+ }
bp->b_flags = B_BNOCLIP;
bp->b_cmd = BUF_CMD_DONE;
bp->b_vp = NULL;

0 comments on commit cd3cfe0

Please sign in to comment.