aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zap.c
diff options
context:
space:
mode:
authorTony Hutter <[email protected]>2018-04-09 14:24:46 -0700
committerBrian Behlendorf <[email protected]>2018-04-09 14:24:46 -0700
commit4f301661dfe7e90574ad634f8b7fe8da7e6b4064 (patch)
treeb68c6ff4d5177d5d26092e601f16d48c0aaf7b14 /module/zfs/zap.c
parent3b0d99289a8e473b059605a83d4ce0bd505ec3d3 (diff)
Revert "Handle zap_add() failures in mixed ... "
This reverts commit cc63068e95ee725cce03b1b7ce50179825a6cda5. Under certain circumstances this change can result in an ENOSPC error when adding new files to a directory. See #7401 for full details. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Issue #7401 Cloes #7416
Diffstat (limited to 'module/zfs/zap.c')
-rw-r--r--module/zfs/zap.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/module/zfs/zap.c b/module/zfs/zap.c
index 1c2030bda..2f6aed667 100644
--- a/module/zfs/zap.c
+++ b/module/zfs/zap.c
@@ -818,19 +818,15 @@ fzap_lookup(zap_name_t *zn,
return (err);
}
-#define MAX_EXPAND_RETRIES 2
-
int
fzap_add_cd(zap_name_t *zn,
uint64_t integer_size, uint64_t num_integers,
const void *val, uint32_t cd, void *tag, dmu_tx_t *tx)
{
zap_leaf_t *l;
- zap_leaf_t *prev_l = NULL;
int err;
zap_entry_handle_t zeh;
zap_t *zap = zn->zn_zap;
- int expand_retries = 0;
ASSERT(RW_LOCK_HELD(&zap->zap_rwlock));
ASSERT(!zap->zap_ismicro);
@@ -854,29 +850,10 @@ retry:
if (err == 0) {
zap_increment_num_entries(zap, 1, tx);
} else if (err == EAGAIN) {
- /*
- * If the last two expansions did not help, there is no point
- * trying to expand again
- */
- if (expand_retries > MAX_EXPAND_RETRIES && prev_l == l) {
- err = SET_ERROR(ENOSPC);
- goto out;
- }
-
err = zap_expand_leaf(zn, l, tag, tx, &l);
zap = zn->zn_zap; /* zap_expand_leaf() may change zap */
- if (err == 0) {
- prev_l = l;
- expand_retries++;
+ 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: