提交 224566ba 编写于 作者: N Nikolay Borisov 提交者: Zheng Zengkai

btrfs: free correct amount of space in btrfs_delayed_inode_reserve_metadata

stable inclusion
from stable-5.10.22
commit 37ffce966821eb5098bda58eef91786cc99c602c
bugzilla: 50796

--------------------------------

commit 0f9c03d8 upstream.

Following commit f218ea6c ("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: f218ea6c ("btrfs: delayed-inode: Remove wrong qgroup meta reservation calls")
CC: stable@vger.kernel.org # 4.19+
Reviewed-by: NQu Wenruo <wqu@suse.com>
Signed-off-by: NNikolay Borisov <nborisov@suse.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: N  Weilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 add6454d
...@@ -649,7 +649,7 @@ static int btrfs_delayed_inode_reserve_metadata( ...@@ -649,7 +649,7 @@ static int btrfs_delayed_inode_reserve_metadata(
btrfs_ino(inode), btrfs_ino(inode),
num_bytes, 1); num_bytes, 1);
} else { } else {
btrfs_qgroup_free_meta_prealloc(root, fs_info->nodesize); btrfs_qgroup_free_meta_prealloc(root, num_bytes);
} }
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册