Teach zpool scrub to scrub only blocks in error log
commit482eeef804f0f325faddb102f112c0f1ec86a1b6
authorGeorge Amanakis <gamanakis@gmail.com>
Fri, 17 Dec 2021 20:35:28 +0000 (17 21:35 +0100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 18 May 2023 18:59:42 +0000 (18 11:59 -0700)
treef5b052e7fed06ad527285841ec6de2d7503d39ed
parente34e15ed6d1882d29e314321b7642305d99f1b78
Teach zpool scrub to scrub only blocks in error log

Added a flag '-e' in zpool scrub to scrub only blocks in error log. A
user can pause, resume and cancel the error scrub by passing additional
command line arguments -p -s just like a regular scrub. This involves
adding a new flag, creating new libzfs interfaces, a new ioctl, and the
actual iteration and read-issuing logic. Error scrubbing is executed in
multiple txg to make sure pool performance is not affected.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Co-authored-by: TulsiJain tulsi.jain@delphix.com
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #8995
Closes #12355
29 files changed:
cmd/zpool/zpool_main.c
include/libzfs.h
include/libzfs_core.h
include/sys/dmu.h
include/sys/dsl_scan.h
include/sys/fs/zfs.h
include/sys/spa.h
include/sys/spa_impl.h
include/sys/sysevent/eventdefs.h
lib/libzfs/libzfs.abi
lib/libzfs/libzfs_pool.c
lib/libzfs/libzfs_util.c
lib/libzfs_core/libzfs_core.abi
lib/libzfs_core/libzfs_core.c
man/man4/zfs.4
man/man8/zpool-scrub.8
module/zfs/dsl_scan.c
module/zfs/spa.c
module/zfs/spa_errlog.c
module/zfs/spa_misc.c
module/zfs/zfs_ioctl.c
tests/runfiles/common.run
tests/zfs-tests/cmd/libzfs_input_check.c
tests/zfs-tests/include/libtest.shlib
tests/zfs-tests/tests/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_001_pos.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_002_pos.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_003_pos.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_004_pos.ksh [new file with mode: 0755]