summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorNed Bass <[email protected]>2017-07-25 18:52:40 -0700
committerBrian Behlendorf <[email protected]>2017-07-25 18:52:40 -0700
commit73aac4aa410121ddcc08bd7fd15d987caf101584 (patch)
treed3e35cd29385670d859e6b14d78a27fda6bad11e /cmd
parent3f759c0c736d3a636614406ac0d6f9335819d6e9 (diff)
Some additional send stream validity checking
Check in the DMU whether an object record in a send stream being received contains an unsupported dnode slot count, and return an error if it does. Failure to catch an unsupported dnode slot count would result in a panic when the SPA attempts to increment the reference count for the large_dnode feature and the pool has the feature disabled. This is not normally an issue for a well-formed send stream which would have the DMU_BACKUP_FEATURE_LARGE_DNODE flag set if it contains large dnodes, so it will be rejected as unsupported if the required feature is disabled. This change adds a missing object record field validation. Add missing stream feature flag checks in dmu_recv_resume_begin_check(). Consolidate repetitive comment blocks in dmu_recv_begin_check(). Update zstreamdump to print the dnode slot count (dn_slots) for an object record when running in verbose mode. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Signed-off-by: Ned Bass <[email protected]> Closes #6396
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zstreamdump/zstreamdump.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/zstreamdump/zstreamdump.c b/cmd/zstreamdump/zstreamdump.c
index b2f7bfdff..2fe95dfb6 100644
--- a/cmd/zstreamdump/zstreamdump.c
+++ b/cmd/zstreamdump/zstreamdump.c
@@ -422,12 +422,14 @@ main(int argc, char *argv[])
}
if (verbose) {
(void) printf("OBJECT object = %llu type = %u "
- "bonustype = %u blksz = %u bonuslen = %u\n",
+ "bonustype = %u blksz = %u bonuslen = %u "
+ "dn_slots = %u\n",
(u_longlong_t)drro->drr_object,
drro->drr_type,
drro->drr_bonustype,
drro->drr_blksz,
- drro->drr_bonuslen);
+ drro->drr_bonuslen,
+ drro->drr_dn_slots);
}
if (drro->drr_bonuslen > 0) {
(void) ssread(buf,