1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-30 12:04:07 +00:00

Clamp the dump block size to the dump device max I/O size.

This commit is contained in:
Justin Hibbits 2013-11-07 21:02:57 +00:00
parent 7a89ddd40f
commit c17f21575c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=257813

View File

@ -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) {