aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/cmd/zhack/zhack.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2014-07-09 23:14:59 +0000
committerXin LI <delphij@FreeBSD.org>2014-07-09 23:14:59 +0000
commit1b174fa1eb24a60e7dd557444c497f08e20ee211 (patch)
tree4f6c9fc59df24d546f6fb81a551e40dee8f33a96 /cddl/contrib/opensolaris/cmd/zhack/zhack.c
parent79b647995de54b1d1d955e05f9a08d0c17066d91 (diff)
parent9b4b9b12f6b68beef03476dc0ec16b4f9c31fb97 (diff)
downloadsrc-1b174fa1eb24a60e7dd557444c497f08e20ee211.tar.gz
src-1b174fa1eb24a60e7dd557444c497f08e20ee211.zip
MFV r268455:
Use reserved space for ZFS administrative commands. We reserve 1/2^spa_slop_shift = 1/32 or 3.125% of pool space (or 32MB at least) for system use. Most ZPL operations, e.g. write(2), creat(2), will fail with ENOSPC if we fall below this. Certain operations, e.g. file removal and most administrative actions, still permitted until half of the slop space is used. This would allow users to use these operations to free up space in the pool when pool is close to full but half of slop space is still free. A very restricted set of operations that frees up space or change quota are always permitted, regardless of the amount of free space. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=268473
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/zhack/zhack.c')
-rw-r--r--cddl/contrib/opensolaris/cmd/zhack/zhack.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zhack/zhack.c b/cddl/contrib/opensolaris/cmd/zhack/zhack.c
index ace8c32f1a30..6e3f0294a623 100644
--- a/cddl/contrib/opensolaris/cmd/zhack/zhack.c
+++ b/cddl/contrib/opensolaris/cmd/zhack/zhack.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
* Copyright (c) 2013 Steven Hartland. All rights reserved.
*/
@@ -362,7 +362,7 @@ zhack_do_feature_enable(int argc, char **argv)
feature.fi_guid);
VERIFY0(dsl_sync_task(spa_name(spa), NULL,
- zhack_feature_enable_sync, &feature, 5));
+ zhack_feature_enable_sync, &feature, 5, ZFS_SPACE_CHECK_NORMAL));
spa_close(spa, FTAG);
@@ -473,7 +473,8 @@ zhack_do_feature_ref(int argc, char **argv)
}
VERIFY0(dsl_sync_task(spa_name(spa), NULL,
- decr ? feature_decr_sync : feature_incr_sync, &feature, 5));
+ decr ? feature_decr_sync : feature_incr_sync, &feature,
+ 5, ZFS_SPACE_CHECK_NORMAL));
spa_close(spa, FTAG);
}