aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zap_micro.c
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2017-02-24 13:34:26 -0800
committerBrian Behlendorf <[email protected]>2017-02-24 13:34:26 -0800
commit66eead53c9d2480f2a464ef170920953431ad200 (patch)
tree14f8e0ab26d9c89503e36d74a49a906a89e0a9bf /module/zfs/zap_micro.c
parentf7e76821c525a7764a01f4a0e16aa9e2b77e3170 (diff)
Clean up by-dnode code in dmu_tx.c
https://github.com/zfsonlinux/zfs/commit/0eef1bde31d67091d3deed23fe2394f5a8bf2276 introduced some changes which we slightly improved the style of when porting to illumos. There is also one minor error-handling fix, in zap_add() the "zap" may become NULL in case of an error re-opening the ZAP. Originally suggested at: https://github.com/openzfs/openzfs/pull/276 Reviewed-by: Brian Behlendorf <[email protected]> Reviewed by: Pavel Zakharov <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #5805
Diffstat (limited to 'module/zfs/zap_micro.c')
-rw-r--r--module/zfs/zap_micro.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/zfs/zap_micro.c b/module/zfs/zap_micro.c
index 0c8ee9d25..53f8d2313 100644
--- a/module/zfs/zap_micro.c
+++ b/module/zfs/zap_micro.c
@@ -1207,7 +1207,8 @@ zap_add_impl(zap_t *zap, const char *key,
}
ASSERT(zap == zn->zn_zap);
zap_name_free(zn);
- zap_unlockdir(zap, tag);
+ if (zap != NULL) /* may be NULL if fzap_add() failed */
+ zap_unlockdir(zap, tag);
return (err);
}