From c17f21575ca182a8474facc8cac3ca12618f9d44 Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Thu, 7 Nov 2013 21:02:57 +0000 Subject: [PATCH] Clamp the dump block size to the dump device max I/O size. --- sys/powerpc/powerpc/dump_machdep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/powerpc/dump_machdep.c b/sys/powerpc/powerpc/dump_machdep.c index df5f733fcf0a..b0e25490dd03 100644 --- a/sys/powerpc/powerpc/dump_machdep.c +++ b/sys/powerpc/powerpc/dump_machdep.c @@ -114,7 +114,7 @@ cb_dumpdata(struct pmap_md *md, int seqnr, void *arg) { struct dumperinfo *di = (struct dumperinfo*)arg; vm_offset_t va; - size_t counter, ofs, resid, sz; + size_t counter, ofs, resid, sz, maxsz; int c, error, twiddle; error = 0; @@ -123,11 +123,12 @@ cb_dumpdata(struct pmap_md *md, int seqnr, void *arg) ofs = 0; /* Logical offset within the chunk */ resid = md->md_size; + maxsz = min(DFLTPHYS, di->maxiosize); printf(" chunk %d: %lu bytes ", seqnr, (u_long)resid); while (resid) { - sz = (resid > DFLTPHYS) ? DFLTPHYS : resid; + sz = min(resid, maxsz); va = pmap_dumpsys_map(md, ofs, &sz); counter += sz; if (counter >> 24) {