Skip to content

Commit bc0b531

Browse files
authored
Prevent scrubbing a read-only pool
While it would be nice to be able to scrub a pool imported read-only this will currently trip an ASSERT. Before we can support this there are some designs challenges which need to be thought through first. For starters, a read-only import skips reading certain information from disk which it knows won't be needed, such as the space maps. Furthermore, the scrub process expects to be checkpoint it's progress, update the on disk error log, and issue repair IO. None of which would be possible when the pool is imported read-only. Each of these wrinkles can certainly be handled, but that will take some signifcant work. In the meanwhile we disable the 'zpool scrub' command when the pool is imported read-only. Reviewed-by: Alan Somers <asomers@gmail.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #17527 Closes #17717
1 parent d64711c commit bc0b531

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

module/zfs/zfs_ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7619,7 +7619,7 @@ zfs_ioctl_init(void)
76197619

76207620
zfs_ioctl_register("scrub", ZFS_IOC_POOL_SCRUB,
76217621
zfs_ioc_pool_scrub, zfs_secpolicy_config, POOL_NAME,
7622-
POOL_CHECK_NONE, B_TRUE, B_TRUE,
7622+
POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_TRUE, B_TRUE,
76237623
zfs_keys_pool_scrub, ARRAY_SIZE(zfs_keys_pool_scrub));
76247624

76257625
zfs_ioctl_register("get_props", ZFS_IOC_POOL_GET_PROPS,

0 commit comments

Comments
 (0)