From 369aa501d11f4d21d4732b58d749259ad811a10a Mon Sep 17 00:00:00 2001 From: Tom Caputi Date: Wed, 13 Mar 2019 13:52:01 -0400 Subject: Fix handling of maxblkid for raw sends Currently, the receive code can create an unreadable dataset from a correct raw send stream. This is because it is currently impossible to set maxblkid to a lower value without freeing the associated object. This means truncating files on the send side to a non-0 size could result in corruption. This patch solves this issue by adding a new 'force' flag to dnode_new_blkid() which will allow the raw receive code to force the DMU to accept the provided maxblkid even if it is a lower value than the existing one. For testing purposes the send_encrypted_files.ksh test has been extended to include a variety of truncated files and multiple snapshots. It also now leverages the xattrtest command to help ensure raw receives correctly handle xattrs. Reviewed-by: Paul Dagnelie Reviewed-by: Brian Behlendorf Reviewed-by: Matt Ahrens Signed-off-by: Tom Caputi Closes #8168 Closes #8487 --- tests/zfs-tests/cmd/xattrtest/xattrtest.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'tests/zfs-tests/cmd/xattrtest') diff --git a/tests/zfs-tests/cmd/xattrtest/xattrtest.c b/tests/zfs-tests/cmd/xattrtest/xattrtest.c index 32a6b1d95..42c510ed0 100644 --- a/tests/zfs-tests/cmd/xattrtest/xattrtest.c +++ b/tests/zfs-tests/cmd/xattrtest/xattrtest.c @@ -144,11 +144,6 @@ parse_args(int argc, char **argv) break; case 'y': verify = 1; - if (phase != PHASE_ALL) { - fprintf(stderr, - "Error: -y and -o are incompatible.\n"); - rc = 1; - } break; case 'n': nth = strtol(optarg, NULL, 0); @@ -201,11 +196,6 @@ parse_args(int argc, char **argv) PHASE_ALL, PHASE_INVAL); rc = 1; } - if (verify == 1) { - fprintf(stderr, - "Error: -y and -o are incompatible.\n"); - rc = 1; - } break; default: rc = 1; -- cgit v1.2.3