Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jul 2016 18:49:05 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r302854 - head/sys/kern
Message-ID:  <201607141849.u6EIn53i038324@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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(",");
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607141849.u6EIn53i038324>