summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLOLi <[email protected]>2017-01-14 00:47:34 +0100
committerBrian Behlendorf <[email protected]>2017-01-13 15:47:34 -0800
commit08f0510d87186575db00269fff17a3409de5ceb6 (patch)
tree21938c4d405161079020ef9d1a47c1b55d677d7b /tests
parent5043684ae51195fc8b7ce7ff15241f17fe23d993 (diff)
Fix unallocated object detection for large_dnode datasets
Fix dmu_object_next() to correctly handle unallocated objects on large_dnode datasets. We implement this by scanning the dnode block until we find the correct offset to be used in dnode_next_offset(). This is necessary because we can't assume *objectp is a hole even if dmu_object_info() returns ENOENT. This fixes a couple of issues with zfs receive on large_dnode datasets. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ned Bass <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #5027 Closes #5532
Diffstat (limited to 'tests')
-rwxr-xr-xtests/zfs-tests/tests/functional/features/large_dnode/large_dnode_005_pos.ksh17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_005_pos.ksh b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_005_pos.ksh
index e03d1274f..1117e849d 100755
--- a/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_005_pos.ksh
+++ b/tests/zfs-tests/tests/functional/features/large_dnode/large_dnode_005_pos.ksh
@@ -27,9 +27,11 @@ verify_runnable "both"
TEST_SEND_FS=$TESTPOOL/send_large_dnode
TEST_RECV_FS=$TESTPOOL/recv_large_dnode
TEST_SNAP=$TEST_SEND_FS@ldnsnap
+TEST_SNAPINCR=$TEST_SEND_FS@ldnsnap_incr
TEST_STREAM=$TESTDIR/ldnsnap
+TEST_STREAMINCR=$TESTDIR/ldnsnap_incr
TEST_FILE=foo
-
+TEST_FILEINCR=bar
function cleanup
{
@@ -42,6 +44,7 @@ function cleanup
fi
rm -f $TEST_STREAM
+ rm -f $TEST_STREAMINCR
}
log_onexit cleanup
@@ -49,10 +52,13 @@ log_onexit cleanup
log_assert "zfs send stream with large dnodes accepted by new pool"
log_must $ZFS create -o dnodesize=1k $TEST_SEND_FS
-log_must touch /$TEST_SEND_FS/$TEST_FILE
-log_must $ZFS umount $TEST_SEND_FS
+log_must $TOUCH /$TEST_SEND_FS/$TEST_FILE
log_must $ZFS snap $TEST_SNAP
log_must $ZFS send $TEST_SNAP > $TEST_STREAM
+log_must $RM -f /$TEST_SEND_FS/$TEST_FILE
+log_must $TOUCH /$TEST_SEND_FS/$TEST_FILEINCR
+log_must $ZFS snap $TEST_SNAPINCR
+log_must $ZFS send -i $TEST_SNAP $TEST_SNAPINCR > $TEST_STREAMINCR
log_must eval "$ZFS recv $TEST_RECV_FS < $TEST_STREAM"
inode=$(ls -li /$TEST_RECV_FS/$TEST_FILE | awk '{print $1}')
@@ -61,4 +67,9 @@ if [[ "$dnsize" != "1K" ]]; then
log_fail "dnode size is $dnsize (expected 1K)"
fi
+log_must eval "$ZFS recv -F $TEST_RECV_FS < $TEST_STREAMINCR"
+log_must $DIFF -r /$TEST_SEND_FS /$TEST_RECV_FS
+log_must $ZFS umount $TEST_SEND_FS
+log_must $ZFS umount $TEST_RECV_FS
+
log_pass