aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2014-07-30 14:52:04 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2014-07-30 14:52:04 +0000
commit73187559a6b8a04f1db3dd5979a82421cdd47c76 (patch)
tree0c077068ff9ebae5e89fc8cbc5738054d27e00cf /sbin
parentb38ebc05386102e78ac3cae92f0c9778bcd0ce8f (diff)
downloadsrc-73187559a6b8a04f1db3dd5979a82421cdd47c76.tar.gz
src-73187559a6b8a04f1db3dd5979a82421cdd47c76.zip
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 MFC after: 1 week
Notes
Notes: svn path=/head/; revision=269303
Diffstat (limited to 'sbin')
-rw-r--r--sbin/restore/tape.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c
index 4f3454901104..225fe3250bdb 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");