Date: Thu, 7 Aug 2014 00:32:23 +0000 (UTC) From: Kirk McKusick <mckusick@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r269652 - stable/9/sbin/restore Message-ID: <53e2c917.5727.6e347a@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mckusick Date: Thu Aug 7 00:32:23 2014 New Revision: 269652 URL: http://svnweb.freebsd.org/changeset/base/269652 Log: MFC of r269303: When restoring a UFS dump onto a ZFS filesystem, an assertion in restore was failing because ZFS was reporting a blocksize that was not a multiple of 1024. Replace restore's failed assertion with code that writes restored files in a blocksize that works for restore (a multiple of 1024) despite being non-optimal for ZFS. Submitted by: Dmitry Morozovsky Tested by: Dmitry Morozovsky Modified: stable/9/sbin/restore/tape.c Directory Properties: stable/9/sbin/restore/ (props changed) Modified: stable/9/sbin/restore/tape.c ============================================================================== --- stable/9/sbin/restore/tape.c Wed Aug 6 23:33:16 2014 (r269651) +++ stable/9/sbin/restore/tape.c Thu Aug 7 00:32:23 2014 (r269652) @@ -260,9 +260,11 @@ setup(void) fssize = TP_BSIZE; if (stbuf.st_blksize >= TP_BSIZE && stbuf.st_blksize <= MAXBSIZE) fssize = stbuf.st_blksize; - if (((fssize - 1) & fssize) != 0) { - fprintf(stderr, "bad block size %ld\n", fssize); - done(1); + if (((TP_BSIZE - 1) & stbuf.st_blksize) != 0) { + fprintf(stderr, "Warning: filesystem with non-multiple-of-%d " + "blocksize (%d);\n", TP_BSIZE, stbuf.st_blksize); + fssize = roundup(fssize, TP_BSIZE); + fprintf(stderr, "\twriting using blocksize %ld\n", fssize); } if (spcl.c_volume != 1) { fprintf(stderr, "Tape is not volume 1 of the dump\n");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53e2c917.5727.6e347a>