summaryrefslogtreecommitdiffstats
path: root/module/zfs/dsl_bookmark.c
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2017-04-14 12:52:43 -0700
committerBrian Behlendorf <[email protected]>2017-06-30 11:11:01 -0700
commitc6f6767eea2179689873efdad4929f73f7f2b10b (patch)
treee5c354f759bab04c2b86d08481511d88788fa84f /module/zfs/dsl_bookmark.c
parent817b1b6e7b6f9b8890a550c7c7efabdba41dd352 (diff)
OpenZFS 8377 - Panic in bookmark deletion
Authored by: Matthew Ahrens <[email protected]> Reviewed by: Paul Dagnelie <[email protected]> Reviewed by: Pavel Zakharov <[email protected]> Reviewed by: George Wilson <[email protected]> Approved by: Robert Mustacchi <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Ported-by: Giuseppe Di Natale <[email protected]> The problem is that when dsl_bookmark_destroy_check() is executed from open context (the pre-check), it fills in dbda_success based on the existence of the bookmark. But the bookmark (or containing filesystem as in this case) can be destroyed before we get to syncing context. When we re-run dsl_bookmark_destroy_check() in syncing context, it will not add the deleted bookmark to dbda_success, intending for dsl_bookmark_destroy_sync() to not process it. But because the bookmark is still in dbda_success from the open-context call, we do try to destroy it. The fix is that dsl_bookmark_destroy_check() should not modify dbda_success when called from open context. OpenZFS-issue: https://www.illumos.org/issues/8377 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/b0b6fe3 Closes #6286
Diffstat (limited to 'module/zfs/dsl_bookmark.c')
-rw-r--r--module/zfs/dsl_bookmark.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/module/zfs/dsl_bookmark.c b/module/zfs/dsl_bookmark.c
index 64f5788c4..a6ca1ebab 100644
--- a/module/zfs/dsl_bookmark.c
+++ b/module/zfs/dsl_bookmark.c
@@ -358,6 +358,9 @@ dsl_bookmark_destroy_check(void *arg, dmu_tx_t *tx)
int rv = 0;
nvpair_t *pair;
+ ASSERT(nvlist_empty(dbda->dbda_success));
+ ASSERT(nvlist_empty(dbda->dbda_errors));
+
if (!spa_feature_is_enabled(dp->dp_spa, SPA_FEATURE_BOOKMARKS))
return (0);
@@ -387,7 +390,10 @@ dsl_bookmark_destroy_check(void *arg, dmu_tx_t *tx)
}
}
if (error == 0) {
- fnvlist_add_boolean(dbda->dbda_success, fullname);
+ if (dmu_tx_is_syncing(tx)) {
+ fnvlist_add_boolean(dbda->dbda_success,
+ fullname);
+ }
} else {
fnvlist_add_int32(dbda->dbda_errors, fullname, error);
rv = error;