1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-09 13:42:56 +00:00

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
This commit is contained in:
Mark Johnston 2016-07-14 18:49:05 +00:00
parent 5d94bbc241
commit 0649caae32
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=302854

View File

@ -4725,8 +4725,12 @@ DB_SHOW_COMMAND(buffer, db_show_buffer)
for (i = 0; i < bp->b_npages; i++) { for (i = 0; i < bp->b_npages; i++) {
vm_page_t m; vm_page_t m;
m = bp->b_pages[i]; m = bp->b_pages[i];
db_printf("(%p, 0x%lx, 0x%lx)", (void *)m->object, if (m != NULL)
(u_long)m->pindex, (u_long)VM_PAGE_TO_PHYS(m)); 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) if ((i + 1) < bp->b_npages)
db_printf(","); db_printf(",");
} }