From 66eead53c9d2480f2a464ef170920953431ad200 Mon Sep 17 00:00:00 2001 From: Matthew Ahrens Date: Fri, 24 Feb 2017 13:34:26 -0800 Subject: 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 Reviewed by: Pavel Zakharov Signed-off-by: Matthew Ahrens Closes #5805 --- module/zfs/zap_micro.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module/zfs/zap_micro.c') 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); } -- cgit v1.2.3