Date: Sat, 24 Sep 2016 17:29:27 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306299 - head/usr.bin/mkimg Message-ID: <201609241729.u8OHTRaQ084594@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marcel Date: Sat Sep 24 17:29:27 2016 New Revision: 306299 URL: https://svnweb.freebsd.org/changeset/base/306299 Log: 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 Modified: head/usr.bin/mkimg/mkimg.c Modified: head/usr.bin/mkimg/mkimg.c ============================================================================== --- head/usr.bin/mkimg/mkimg.c Sat Sep 24 16:46:37 2016 (r306298) +++ head/usr.bin/mkimg/mkimg.c Sat Sep 24 17:29:27 2016 (r306299) @@ -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?201609241729.u8OHTRaQ084594>