summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Siden <[email protected]>2014-11-04 09:35:37 -0800
committerBrian Behlendorf <[email protected]>2015-05-04 09:41:10 -0700
commit0c60cc326bdb44f7eea61e62c6183822d0bd9cf0 (patch)
tree6fea98eadcc5131971bf67523ad4983867643233
parent3d45fdd6c0d5b4c8e42b6a2cda00bf6f22c9f2bf (diff)
Illumos 4951 - ZFS administrative commands (fix)
4951 ZFS administrative commands should use reserved space, not fail with ENOSPC Approved by: Christopher Siden <[email protected]> References: https://www.illumos.org/issues/4951 https://github.com/illumos/illumos-gate/commit/c39f2c8 Ported by: Brian Behlendorf <[email protected]>
-rw-r--r--include/sys/spa.h1
-rw-r--r--module/zfs/dsl_pool.c7
2 files changed, 2 insertions, 6 deletions
diff --git a/include/sys/spa.h b/include/sys/spa.h
index ea43713a4..13cbbf98b 100644
--- a/include/sys/spa.h
+++ b/include/sys/spa.h
@@ -786,6 +786,7 @@ extern spa_load_state_t spa_load_state(spa_t *spa);
extern uint64_t spa_freeze_txg(spa_t *spa);
extern uint64_t spa_get_asize(spa_t *spa, uint64_t lsize);
extern uint64_t spa_get_dspace(spa_t *spa);
+extern uint64_t spa_get_slop_space(spa_t *spa);
extern void spa_update_dspace(spa_t *spa);
extern uint64_t spa_version(spa_t *spa);
extern boolean_t spa_deflate(spa_t *spa);
diff --git a/module/zfs/dsl_pool.c b/module/zfs/dsl_pool.c
index 717dfbe9f..fe1a4d8b7 100644
--- a/module/zfs/dsl_pool.c
+++ b/module/zfs/dsl_pool.c
@@ -612,17 +612,12 @@ dsl_pool_adjustedsize(dsl_pool_t *dp, boolean_t netfree)
uint64_t space, resv;
/*
- * Reserve about 1.6% (1/64), or at least 32MB, for allocation
- * efficiency.
- * XXX The intent log is not accounted for, so it must fit
- * within this slop.
- *
* If we're trying to assess whether it's OK to do a free,
* cut the reservation in half to allow forward progress
* (e.g. make it possible to rm(1) files from a full pool).
*/
space = spa_get_dspace(dp->dp_spa);
- resv = MAX(space >> 6, SPA_MINDEVSIZE >> 1);
+ resv = spa_get_slop_space(dp->dp_spa);
if (netfree)
resv >>= 1;