Skip to content

Commit

Permalink
Prevent "zpool destroy|export" when suspended
Browse files Browse the repository at this point in the history
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 openzfs#2878
  • Loading branch information
behlendorf committed Mar 2, 2015
1 parent fdc5d98 commit 87a63dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/zfs/zfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 87a63dd

Please sign in to comment.