]> git.proxmox.com Git - mirror_zfs.git/commit
Don't assert on nvlists larger than SPA_MAXBLOCKSIZE
authorAllan Jude <allan@klarasystems.com>
Tue, 25 Aug 2020 18:04:20 +0000 (14:04 -0400)
committerGitHub <noreply@github.com>
Tue, 25 Aug 2020 18:04:20 +0000 (11:04 -0700)
commit7a6c12fd6a756af5a2f664c0a6a292d22fbb2487
tree844487cbffd8fc7165b8756b97ff830ff47b1957
parent87688b686bb4ede154d502cf9a342126c25789c0
Don't assert on nvlists larger than SPA_MAXBLOCKSIZE

Originally we asserted that all reads are less than SPA_MAXBLOCKSIZE
However, nvlists are not ZFS records, and are not limited to
SPA_MAXBLOCKSIZE.

Add a new environment variable, ZFS_SENDRECV_MAX_NVLIST, to allow the
user to specify the maximum size of the nvlist that can be sent or
received.
Default value: 4 * SPA_MAXBLOCKSIZE (64 MB)

Modify libzfs send routines to return a useful error if the send stream
will generate an nvlist that is beyond the maximum size.

Modify libzfs recv routines to add an explicit error message if the
nvlist is too large, rather than abort()ing.

Move the change the assert() to only trigger on data records

Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Closes #9616
include/libzfs_impl.h
lib/libzfs/libzfs_sendrecv.c
lib/libzfs/libzfs_util.c