ubifs: Rectify space budget for ubifs_xrename()
authorZhihao Cheng <chengzhihao1@huawei.com>
Tue, 11 Oct 2022 03:47:28 +0000 (11:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:57:24 +0000 (13:57 +0100)
commit8e166cc9b64b8dac0f7ea9e33c34e6c71e729b0c
tree74f4479dcaea0ad976aa9861c370058e86b8ad1a
parentde6d6bf150b79c44b73d69377623f7a8b34833b1
ubifs: Rectify space budget for ubifs_xrename()

[ Upstream commit 1b2ba09060e41adb356b9ae58ef94a7390928004 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ubifs/dir.c