summaryrefslogtreecommitdiff
path: root/arch/riscv
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2023-06-08 13:27:45 +0300
committerDavid Sterba <dsterba@suse.com>2023-06-19 14:59:39 +0300
commiteced687e224eb3cc5a501cf53ad9291337c8dbc5 (patch)
tree7bdec09ce305a166fe8563af7eb454bdd1bec3ee /arch/riscv
parent725026ed593f1b6da66fe7e3777cd891dbf7343f (diff)
downloadlinux-eced687e224eb3cc5a501cf53ad9291337c8dbc5.tar.xz
btrfs: abort transaction at update_ref_for_cow() when ref count is zero
At update_ref_for_cow() we are calling btrfs_handle_fs_error() if we find that the extent buffer has an unexpected ref count of zero, however we can simply use btrfs_abort_transaction(), which achieves the same purposes: to turn the fs to error state, abort the current transaction and turn the fs to RO mode as well. Besides that, btrfs_abort_transaction() also prints a stack trace which makes it more useful. Also, as this is a very unexpected situation, indicating a serious corruption/inconsistency, tag the if branch as 'unlikely', set the error code to -EUCLEAN instead of -EROFS, and log an explicit message. Reviewed-by: Qu Wenruo <wqu@suse.com> 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 'arch/riscv')
0 files changed, 0 insertions, 0 deletions