aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2015-02-27 14:35:56 -0800
committerBrian Behlendorf <[email protected]>2015-03-02 11:50:06 -0800
commit87a63dd702370c00322e8d1d84102075c775324b (patch)
treeafe63e0010a0d178aff3699a0c751f22316fc476
parentfdc5d98253c60e45be7efe62ed428d4c2344e394 (diff)
Prevent "zpool destroy|export" when suspended
Cleanly destroying or exporting a pool requires that the pool not be suspended. Therefore, set the POOL_CHECK_SUSPENDED flag for these ioctls so the utilities will output a descriptive error message rather than block. Signed-off-by: Brian Behlendorf <[email protected]> Issue #2878
-rw-r--r--module/zfs/zfs_ioctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c
index 998ee1596..cd7697058 100644
--- a/module/zfs/zfs_ioctl.c
+++ b/module/zfs/zfs_ioctl.c
@@ -5450,9 +5450,9 @@ zfs_ioctl_init(void)
* does the logging of those commands.
*/
zfs_ioctl_register_pool(ZFS_IOC_POOL_DESTROY, zfs_ioc_pool_destroy,
- zfs_secpolicy_config, B_FALSE, POOL_CHECK_NONE);
+ zfs_secpolicy_config, B_FALSE, POOL_CHECK_SUSPENDED);
zfs_ioctl_register_pool(ZFS_IOC_POOL_EXPORT, zfs_ioc_pool_export,
- zfs_secpolicy_config, B_FALSE, POOL_CHECK_NONE);
+ zfs_secpolicy_config, B_FALSE, POOL_CHECK_SUSPENDED);
zfs_ioctl_register_pool(ZFS_IOC_POOL_STATS, zfs_ioc_pool_stats,
zfs_secpolicy_read, B_FALSE, POOL_CHECK_NONE);