Date: Sun, 11 Dec 2016 03:59:37 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309844 - stable/11/usr.bin/mkimg Message-ID: <201612110359.uBB3xbc1016728@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marcel Date: Sun Dec 11 03:59:37 2016 New Revision: 309844 URL: https://svnweb.freebsd.org/changeset/base/309844 Log: MFC r306299: 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. Modified: stable/11/usr.bin/mkimg/mkimg.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/mkimg/mkimg.c ============================================================================== --- stable/11/usr.bin/mkimg/mkimg.c Sun Dec 11 03:57:21 2016 (r309843) +++ stable/11/usr.bin/mkimg/mkimg.c Sun Dec 11 03:59:37 2016 (r309844) @@ -463,13 +463,16 @@ mkimg(void) block = scheme_metadata(SCHEME_META_IMG_END, block); error = image_set_size(block); - if (!error) + if (!error) { error = capacity_resize(block); - if (!error) + block = image_get_size(); + } + if (!error) { error = format_resize(block); + block = image_get_size(); + } if (error) errc(EX_IOERR, error, "image sizing"); - block = image_get_size(); ncyls = block / (nsecs * nheads); error = scheme_write(block); if (error)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612110359.uBB3xbc1016728>