Update local variable 'block' after calling capacity_resize(),
otherwise format_resize(), which is called right after, isn't getting the current/actual image size. Rather than rounding up, format_resize() could end up truncating the size and we don't allow that by design. MFC after: 1 week
This commit is contained in:
parent
2b4da8aa20
commit
ac3425511d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=306299
@ -463,13 +463,16 @@ mkimg(void)
|
|||||||
|
|
||||||
block = scheme_metadata(SCHEME_META_IMG_END, block);
|
block = scheme_metadata(SCHEME_META_IMG_END, block);
|
||||||
error = image_set_size(block);
|
error = image_set_size(block);
|
||||||
if (!error)
|
if (!error) {
|
||||||
error = capacity_resize(block);
|
error = capacity_resize(block);
|
||||||
if (!error)
|
block = image_get_size();
|
||||||
|
}
|
||||||
|
if (!error) {
|
||||||
error = format_resize(block);
|
error = format_resize(block);
|
||||||
|
block = image_get_size();
|
||||||
|
}
|
||||||
if (error)
|
if (error)
|
||||||
errc(EX_IOERR, error, "image sizing");
|
errc(EX_IOERR, error, "image sizing");
|
||||||
block = image_get_size();
|
|
||||||
ncyls = block / (nsecs * nheads);
|
ncyls = block / (nsecs * nheads);
|
||||||
error = scheme_write(block);
|
error = scheme_write(block);
|
||||||
if (error)
|
if (error)
|
||||||
|
Loading…
Reference in New Issue
Block a user