Date: Tue, 3 Mar 2020 22:14:24 +0000 (UTC) From: Eric van Gyzen <vangyzen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358594 - head/sbin/dumpon Message-ID: <202003032214.023MEOc4096908@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: vangyzen Date: Tue Mar 3 22:14:23 2020 New Revision: 358594 URL: https://svnweb.freebsd.org/changeset/base/358594 Log: dumpon: skip size check if using zstd As with gzip, let the dump device be smaller than physical memory when using zstd and full dumps. Also print the error message if the size check fails, even if -v is not specified. Failing silently is not friendly. Reviewed by: cem markj MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23923 Modified: head/sbin/dumpon/dumpon.c Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Tue Mar 3 18:58:43 2020 (r358593) +++ head/sbin/dumpon/dumpon.c Tue Mar 3 22:14:23 2020 (r358594) @@ -203,11 +203,8 @@ check_size(int fd, const char *fn) err(EX_OSERR, "can't get memory size"); if (ioctl(fd, DIOCGMEDIASIZE, &mediasize) != 0) err(EX_OSERR, "%s: can't get size", fn); - if ((uintmax_t)mediasize < (uintmax_t)physmem) { - if (verbose) - printf("%s is smaller than physical memory\n", fn); - exit(EX_IOERR); - } + if ((uintmax_t)mediasize < (uintmax_t)physmem) + errx(EX_IOERR, "%s is smaller than physical memory", fn); } #ifdef HAVE_CRYPTO @@ -495,7 +492,7 @@ main(int argc, char *argv[]) usage(); fd = opendumpdev(dev, dumpdev); - if (!netdump && !gzip && !rflag) + if (!netdump && !gzip && !zstd && !rflag) check_size(fd, dumpdev); kdap = &ndconf;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003032214.023MEOc4096908>