This is a note to let you know that I've just added the patch titled btrfs: return errors from btrfs_del_csums in cleanup_ref_head to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: btrfs-return-errors-from-btrfs_del_csums-in-cleanup_ref_head.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 856bd270dc4db209c779ce1e9555c7641ffbc88e Mon Sep 17 00:00:00 2001 From: Josef Bacik <josef@xxxxxxxxxxxxxx> Date: Wed, 19 May 2021 10:52:46 -0400 Subject: btrfs: return errors from btrfs_del_csums in cleanup_ref_head From: Josef Bacik <josef@xxxxxxxxxxxxxx> commit 856bd270dc4db209c779ce1e9555c7641ffbc88e upstream. We are unconditionally returning 0 in cleanup_ref_head, despite the fact that btrfs_del_csums could fail. We need to return the error so the transaction gets aborted properly, fix this by returning ret from btrfs_del_csums in cleanup_ref_head. Reviewed-by: Qu Wenruo <wqu@xxxxxxxx> CC: stable@xxxxxxxxxxxxxxx # 4.19+ Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx> Reviewed-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/btrfs/extent-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -1879,7 +1879,7 @@ static int cleanup_ref_head(struct btrfs trace_run_delayed_ref_head(fs_info, head, 0); btrfs_delayed_ref_unlock(head); btrfs_put_delayed_ref_head(head); - return 0; + return ret; } static struct btrfs_delayed_ref_head *btrfs_obtain_ref_head( Patches currently in stable-queue which might be from josef@xxxxxxxxxxxxxx are queue-5.4/btrfs-fixup-error-handling-in-fixup_inode_link_counts.patch queue-5.4/btrfs-tree-checker-do-not-error-out-if-extent-ref-ha.patch queue-5.4/btrfs-mark-ordered-extent-and-inode-with-error-if-we-fail-to-finish.patch queue-5.4/btrfs-fix-error-handling-in-btrfs_del_csums.patch queue-5.4/btrfs-return-errors-from-btrfs_del_csums-in-cleanup_ref_head.patch