ubifs: Rectify space budget for ubifs_xrename()
authorZhihao Cheng <chengzhihao1@huawei.com>
Tue, 11 Oct 2022 03:47:28 +0000 (11:47 +0800)
committerRichard Weinberger <richard@nod.at>
Thu, 2 Feb 2023 20:13:37 +0000 (21:13 +0100)
commit1b2ba09060e41adb356b9ae58ef94a7390928004
tree5b9a3b23aed8f63d6db6daf397f239d916c5a5fc
parentc2c36cc6ca23e614f9e4238d0ecf48549ee9002a
ubifs: Rectify space budget for ubifs_xrename()

There is no space budget for ubifs_xrename(). It may let
make_reservation() return with -ENOSPC, which could turn
ubifs to read-only mode in do_writepage() process.
Fix it by adding space budget for ubifs_xrename().

Fetch a reproducer in [Link].

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216569
Fixes: 9ec64962afb170 ("ubifs: Implement RENAME_EXCHANGE")
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/dir.c