diff options
author | Filipe Manana <fdmanana@suse.com> | 2023-09-27 12:09:22 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-10-04 01:04:28 +0200 |
commit | a2caab29884397e583d09be6546259a83ebfbdb1 (patch) | |
tree | 5b390b208d2d753876b15fedb06ebb38898d587a /tools/testing/selftests/bpf/prog_tests/sockmap_basic.c | |
parent | 48774f3bf8b4dd3b1a0e155825c9ce48483db14c (diff) |
btrfs: error when COWing block from a root that is being deleted
At btrfs_cow_block() we check if the block being COWed belongs to a root
that is being deleted and if so we log an error message. However this is
an unexpected case and it indicates a bug somewhere, so we should return
an error and abort the transaction. So change this in the following ways:
1) Abort the transaction with -EUCLEAN, so that if the issue ever happens
it can easily be noticed;
2) Change the logged message level from error to critical, and change the
message itself to print the block's logical address and the ID of the
root;
3) Return -EUCLEAN to the caller;
4) As this is an unexpected scenario, that should never happen, mark the
check as unlikely, allowing the compiler to potentially generate better
code.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/sockmap_basic.c')
0 files changed, 0 insertions, 0 deletions