]> git.hungrycats.org Git - linux/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>
Thu, 5 Dec 2024 12:54:28 +0000 (13:54 +0100)
commit6d1505741f8e97805b537a1355a7b9e7c968f714
treebc3b2fb00167062cf23c84158ce53e3b12e6a003
parentec869b6ae9a99cb02cb761b46f36acfcfdc3b5e1
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