]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ubifs: Correct the total block count by deducting journal reservation
authorZhihao Cheng <chengzhihao1@huawei.com>
Thu, 5 Sep 2024 01:09:09 +0000 (09:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:20 +0000 (19:51 +0100)
commit2b19d2fd58becd1042ecb55f3b96cc3d7a810018
tree29b6f74bbbc7d58c76c4376a45ce3df27b76f03c
parent246f621d363988e7040f4546d20203dc713fa3e1
ubifs: Correct the total block count by deducting journal reservation

[ Upstream commit 84a2bee9c49769310efa19601157ef50a1df1267 ]

Since commit e874dcde1cbf ("ubifs: Reserve one leb for each journal
head while doing budget"), available space is calulated by deducting
reservation for all journal heads. However, the total block count (
which is only used by statfs) is not updated yet, which will cause
the wrong displaying for used space(total - available).
Fix it by deducting reservation for all journal heads from total
block count.

Fixes: e874dcde1cbf ("ubifs: Reserve one leb for each journal head while doing budget")
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/super.c