svn commit: r302854 - head/sys/kern

Mark Johnston markj at FreeBSD.org
Thu Jul 14 18:49:06 UTC 2016


Author: markj
Date: Thu Jul 14 18:49:05 2016
New Revision: 302854
URL: https://svnweb.freebsd.org/changeset/base/302854

Log:
  Let DDB's buf printer handle NULL pointers in the buf page array.
  
  A buf's b_pages and b_npages fields may be inconsistent after a panic.
  For instance, vfs_vmio_invalidate() sets b_npages to zero only after all
  pages are unwired and their page array entries are cleared.
  
  MFC after:	1 week
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Thu Jul 14 17:31:29 2016	(r302853)
+++ head/sys/kern/vfs_bio.c	Thu Jul 14 18:49:05 2016	(r302854)
@@ -4725,8 +4725,12 @@ DB_SHOW_COMMAND(buffer, db_show_buffer)
 		for (i = 0; i < bp->b_npages; i++) {
 			vm_page_t m;
 			m = bp->b_pages[i];
-			db_printf("(%p, 0x%lx, 0x%lx)", (void *)m->object,
-			    (u_long)m->pindex, (u_long)VM_PAGE_TO_PHYS(m));
+			if (m != NULL)
+				db_printf("(%p, 0x%lx, 0x%lx)", m->object,
+				    (u_long)m->pindex,
+				    (u_long)VM_PAGE_TO_PHYS(m));
+			else
+				db_printf("( ??? )");
 			if ((i + 1) < bp->b_npages)
 				db_printf(",");
 		}


More information about the svn-src-head mailing list