]> git.proxmox.com Git - mirror_zfs.git/commit - tests/zfs-tests/tests/Makefile.am
Fixes in persistent error log
authorGeorge Amanakis <gamanakis@gmail.com>
Tue, 28 Mar 2023 23:51:58 +0000 (01:51 +0200)
committerGitHub <noreply@github.com>
Tue, 28 Mar 2023 23:51:58 +0000 (16:51 -0700)
commit431083f75bdd3efaee992bdd672625ec7240d252
tree9795844e36c83621d347ab2d930676b32ab7022e
parent65d10bd87c408bfa13fa27bb6ad3ecc0e2e3775b
Fixes in persistent error log

Address the following bugs in persistent error log:

1) Check nested clones, eg "fs->snap->clone->snap2->clone2".

2) When deleting files containing error blocks in those clones (from
   "clone" the example above), do not break the check chain.

3) When deleting files in the originating fs before syncing the errlog
   to disk, do not break the check chain. This happens because at the
   time of introducing the error block in the error list, we do not have
   its birth txg and the head filesystem. If the original file is
   deleted before the error list is synced to the error log (which is
   when we actually lookup the birth txg and the head filesystem), then
   we do not have access to this info anymore and break the check chain.

The most prominent change is related to achieving (3). We expand the
spa_error_entry_t structure to accommodate the newly introduced
zbookmark_err_phys_t structure (containing the birth txg of the error
block).Due to compatibility reasons we cannot remove the
zbookmark_phys_t structure and we also need to place the new structure
after se_avl, so it is not accounted for in avl_find(). Then we modify
spa_log_error() to also provide the birth txg of the error block. With
these changes in place we simplify the previously introduced function
get_head_and_birth_txg() (now named get_head_ds()).

We chose not to follow the same approach for the head filesystem (thus
completely removing get_head_ds()) to avoid introducing new lock
contentions.

The stack sizes of nested functions (as measured by checkstack.pl in the
linux kernel) are:
check_filesystem [zfs]: 272 (was 912)
check_clones [zfs]: 64

We also introduced two new tests covering the above changes.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Amanakis <gamanakis@gmail.com>
Closes #14633
16 files changed:
include/sys/spa.h
include/sys/spa_impl.h
include/sys/zio.h
man/man7/zpool-features.7
module/zfs/arc.c
module/zfs/dbuf.c
module/zfs/dmu_send.c
module/zfs/dsl_scan.c
module/zfs/spa_errlog.c
module/zfs/zio.c
tests/runfiles/common.run
tests/zfs-tests/tests/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_003_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_005_pos.ksh
tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_006_pos.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_007_pos.ksh [new file with mode: 0755]