summaryrefslogtreecommitdiffstats
path: root/module/zfs/zap.c
diff options
context:
space:
mode:
Diffstat (limited to 'module/zfs/zap.c')
-rw-r--r--module/zfs/zap.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/module/zfs/zap.c b/module/zfs/zap.c
index 2f6aed667..d899ccdb7 100644
--- a/module/zfs/zap.c
+++ b/module/zfs/zap.c
@@ -852,8 +852,16 @@ retry:
} else if (err == EAGAIN) {
err = zap_expand_leaf(zn, l, tag, tx, &l);
zap = zn->zn_zap; /* zap_expand_leaf() may change zap */
- if (err == 0)
+ if (err == 0) {
goto retry;
+ } else if (err == ENOSPC) {
+ /*
+ * If we failed to expand the leaf, then bailout
+ * as there is no point trying
+ * zap_put_leaf_maybe_grow_ptrtbl().
+ */
+ return (err);
+ }
}
out: