This is a note to let you know that I've just added the patch titled btrfs: free correct amount of space in btrfs_delayed_inode_reserve_metadata 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-free-correct-amount-of-space-in-btrfs_delayed_inode_reserve_metadata.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 0f9c03d824f6f522d3bc43629635c9765546ebc5 Mon Sep 17 00:00:00 2001 From: Nikolay Borisov <nborisov@xxxxxxxx> Date: Mon, 22 Feb 2021 18:40:42 +0200 Subject: btrfs: free correct amount of space in btrfs_delayed_inode_reserve_metadata From: Nikolay Borisov <nborisov@xxxxxxxx> commit 0f9c03d824f6f522d3bc43629635c9765546ebc5 upstream. Following commit f218ea6c4792 ("btrfs: delayed-inode: Remove wrong qgroup meta reservation calls") this function now reserves num_bytes, rather than the fixed amount of nodesize. As such this requires the same amount to be freed in case of failure. Fix this by adjusting the amount we are freeing. Fixes: f218ea6c4792 ("btrfs: delayed-inode: Remove wrong qgroup meta reservation calls") CC: stable@xxxxxxxxxxxxxxx # 4.19+ Reviewed-by: Qu Wenruo <wqu@xxxxxxxx> Signed-off-by: Nikolay Borisov <nborisov@xxxxxxxx> Reviewed-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/btrfs/delayed-inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -649,7 +649,7 @@ static int btrfs_delayed_inode_reserve_m btrfs_ino(inode), num_bytes, 1); } else { - btrfs_qgroup_free_meta_prealloc(root, fs_info->nodesize); + btrfs_qgroup_free_meta_prealloc(root, num_bytes); } return ret; } Patches currently in stable-queue which might be from nborisov@xxxxxxxx are queue-5.4/btrfs-free-correct-amount-of-space-in-btrfs_delayed_inode_reserve_metadata.patch queue-5.4/btrfs-unlock-extents-in-btrfs_zero_range-in-case-of-quota-reservation-errors.patch