Skip to content

Commit

Permalink
Fix crash caused by invalid snapshot names in redactnvl
Browse files Browse the repository at this point in the history
This is a follow up fix for commit 0fdd610.  The VERIFY is
only true when we haven't hit an error code path.  See added
test case for a reproducer.

Reviewed-by: Matthew Ahrens <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Christian Schwarz <[email protected]>
Closes openzfs#11048
  • Loading branch information
problame authored Oct 14, 2020
1 parent 6a60ef8 commit 15a4ca4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/dmu_redact.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,9 +1062,9 @@ dmu_redact_snap(const char *snapname, nvlist_t *redactnvl,

}
}
VERIFY3P(nvlist_next_nvpair(redactnvl, pair), ==, NULL);
if (err != 0)
goto out;
VERIFY3P(nvlist_next_nvpair(redactnvl, pair), ==, NULL);

boolean_t resuming = B_FALSE;
zfs_bookmark_phys_t bookmark;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ done
log_mustnot zfs redact $sendfs@snap1
log_mustnot zfs redact $sendfs@snap1 book
log_mustnot zfs redact $sendfs#book1 book4 $clone1
log_mustnot zfs redact $sendfs@snap1 book snap2 snap3
log_mustnot zfs redact $sendfs@snap1 book @snap2 @snap3
log_mustnot eval "zfs send --redact $sendfs#book $sendfs@snap >/dev/null"

# Redaction snapshots not a descendant of tosnap
Expand Down

0 comments on commit 15a4ca4

Please sign in to comment.