summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/zfs/spa_misc.c
diff options
context:
space:
mode:
authorMatthew Ahrens <mahrens@delphix.com>2016-07-13 16:48:01 -0700
committerMatthew Ahrens <mahrens@delphix.com>2016-07-14 12:52:34 -0700
commit4b5c8e93cab28d3c65ba9d407fd8f46e3be1db1c (patch)
treead805a343c61b7932ff58d0f9a2a920bddac98fc /usr/src/uts/common/fs/zfs/spa_misc.c
parent470bc2d6d44a4a70ed9403c0bce321333e897c31 (diff)
downloadillumos-joyent-4b5c8e93cab28d3c65ba9d407fd8f46e3be1db1c.tar.gz
7104 increase indirect block size
Reviewed by: George Wilson <george.wilson@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/uts/common/fs/zfs/spa_misc.c')
-rw-r--r--usr/src/uts/common/fs/zfs/spa_misc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/usr/src/uts/common/fs/zfs/spa_misc.c b/usr/src/uts/common/fs/zfs/spa_misc.c
index 699b15cc58..a674eea6b0 100644
--- a/usr/src/uts/common/fs/zfs/spa_misc.c
+++ b/usr/src/uts/common/fs/zfs/spa_misc.c
@@ -341,9 +341,14 @@ int spa_asize_inflation = 24;
* it is possible to run the pool completely out of space, causing it to
* be permanently read-only.
*
+ * Note that on very small pools, the slop space will be larger than
+ * 3.2%, in an effort to have it be at least spa_min_slop (128MB),
+ * but we never allow it to be more than half the pool size.
+ *
* See also the comments in zfs_space_check_t.
*/
int spa_slop_shift = 5;
+uint64_t spa_min_slop = 128 * 1024 * 1024;
/*
* ==========================================================================
@@ -1637,14 +1642,16 @@ spa_get_asize(spa_t *spa, uint64_t lsize)
/*
* Return the amount of slop space in bytes. It is 1/32 of the pool (3.2%),
- * or at least 32MB.
+ * or at least 128MB, unless that would cause it to be more than half the
+ * pool size.
*
* See the comment above spa_slop_shift for details.
*/
uint64_t
-spa_get_slop_space(spa_t *spa) {
+spa_get_slop_space(spa_t *spa)
+{
uint64_t space = spa_get_dspace(spa);
- return (MAX(space >> spa_slop_shift, SPA_MINDEVSIZE >> 1));
+ return (MAX(space >> spa_slop_shift, MIN(space >> 1, spa_min_slop)));
}
uint64_t