From 92e43c17188d47f47b69318e4884096dec380e36 Mon Sep 17 00:00:00 2001 From: LOLi Date: Fri, 7 Jul 2017 19:39:53 +0200 Subject: Fix 'zpool clear' on readonly pools Illumos 4080 inadvertently allows 'zpool clear' on readonly pools: fix this by reintroducing a check (POOL_CHECK_READONLY) in zfs_ioc_clear registration code. Signed-off-by: Giuseppe Di Natale Signed-off-by: Brian Behlendorf Signed-off-by: loli10K Closes #6306 --- module/zfs/zfs_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/zfs/zfs_ioctl.c') diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index acdfba173..d56049931 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -6163,7 +6163,7 @@ zfs_ioctl_init(void) zfs_secpolicy_config, B_TRUE, POOL_CHECK_NONE); zfs_ioctl_register_pool(ZFS_IOC_CLEAR, zfs_ioc_clear, - zfs_secpolicy_config, B_TRUE, POOL_CHECK_NONE); + zfs_secpolicy_config, B_TRUE, POOL_CHECK_READONLY); zfs_ioctl_register_pool(ZFS_IOC_POOL_REOPEN, zfs_ioc_pool_reopen, zfs_secpolicy_config, B_TRUE, POOL_CHECK_SUSPENDED); -- cgit v1.2.3