From 30888ee740ccc5de5634a39d3fef60841ae77a82 Mon Sep 17 00:00:00 2001 From: mckusick Date: Thu, 7 Aug 2014 00:32:23 +0000 Subject: [PATCH] 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 git-svn-id: svn://svn.freebsd.org/base/stable/9@269652 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sbin/restore/tape.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c index 022d2841f..9659e9ce0 100644 --- a/sbin/restore/tape.c +++ b/sbin/restore/tape.c @@ -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"); -- 2.45.0