]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Cancel TRIM / initialize on FAULTED non-writeable vdevs
authornssrikanth <75025422+nssrikanth@users.noreply.github.com>
Tue, 2 Mar 2021 18:27:27 +0000 (23:57 +0530)
committerGitHub <noreply@github.com>
Tue, 2 Mar 2021 18:27:27 +0000 (10:27 -0800)
commitbedbc13daa6dfe9e0221bfadb8d8db2378deaacc
tree2b54ce4a3d625d6ff31850bcdd1f6017a4981365
parent2e160dee97a4badbc318561f76ea56451c916d2f
Cancel TRIM / initialize on FAULTED non-writeable vdevs

When a device which is actively trimming or initializing becomes
FAULTED, and therefore no longer writable, cancel the active
TRIM or initialization.  When the device is merely taken offline
with `zpool offline` then stop the operation but do not cancel it.
When the device is brought back online the operation will be
resumed if possible.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Vipin Kumar Verma <vipin.verma@hpe.com>
Signed-off-by: Srikanth N S <srikanth.nagasubbaraoseetharaman@hpe.com>
Closes #11588
module/zfs/vdev_initialize.c
module/zfs/vdev_trim.c
tests/runfiles/common.run
tests/zfs-tests/tests/functional/cli_root/zpool_initialize/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_fault_export_import_online.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zpool_trim/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_trim/zpool_trim_fault_export_import_online.ksh [new file with mode: 0755]