aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGeorge Melikov <[email protected]>2017-02-04 20:10:24 +0300
committerBrian Behlendorf <[email protected]>2017-02-04 09:10:24 -0800
commit2e0e443ac40c7e825a02519a497328226bd866ff (patch)
tree40b32d221e46f670d1efe0925842330b542e4bda /lib
parent57c6a9174d9e1d3844181267e34d9510b1250b4a (diff)
OpenZFS 7247 - zfs receive of deduplicated stream fails
Authored by: Chris Williamson <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Dan Kimmel <[email protected]> Approved by: Robert Mustacchi <[email protected]> Reviewed-by: loli10K <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Ported-by: George Melikov <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/7247 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/2ad25b4 Closes #5689 Porting notes: - tests/zfs-tests/tests/functional/cli_root/zfs_receive/zfs_receive_013_pos.ksh renamed as zfs_receive_015_pos.ksh, zfs_receive_013_pos.ksh is now used for OpenZFS test. - libzfs_sendrecv.c: SMALLEST_POSSIBLE_MAX_DDT_MB is always used for all 32-bit builds.
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_sendrecv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c
index b08cd2b63..c1a09e3a9 100644
--- a/lib/libzfs/libzfs_sendrecv.c
+++ b/lib/libzfs/libzfs_sendrecv.c
@@ -245,12 +245,16 @@ cksummer(void *arg)
int outfd;
dedup_table_t ddt;
zio_cksum_t stream_cksum;
- uint64_t physmem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE);
uint64_t numbuckets;
+#ifdef _ILP32
+ ddt.max_ddt_size = SMALLEST_POSSIBLE_MAX_DDT_MB << 20;
+#else
+ uint64_t physmem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE);
ddt.max_ddt_size =
MAX((physmem * MAX_DDT_PHYSMEM_PERCENT) / 100,
SMALLEST_POSSIBLE_MAX_DDT_MB << 20);
+#endif
numbuckets = ddt.max_ddt_size / (sizeof (dedup_entry_t));