diff options
author | Nikolay Borisov <nborisov@suse.com> | 2021-02-22 18:40:42 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-11 14:04:59 +0100 |
commit | db1dde1bf1c98aa4a5c80ae453fd9c82fe032926 (patch) | |
tree | f74670884c98a0c100373e744f8977111300d924 /fs | |
parent | f27ce3a7c51a8259dca1cb8ad91cbed7beaee892 (diff) | |
download | linux-stable-db1dde1bf1c98aa4a5c80ae453fd9c82fe032926.tar.gz linux-stable-db1dde1bf1c98aa4a5c80ae453fd9c82fe032926.tar.bz2 linux-stable-db1dde1bf1c98aa4a5c80ae453fd9c82fe032926.zip |
btrfs: free correct amount of space in btrfs_delayed_inode_reserve_metadata
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@vger.kernel.org # 4.19+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/delayed-inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 14855972dee3..fea5ccfade5c 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -642,7 +642,7 @@ static int btrfs_delayed_inode_reserve_metadata( 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; } |