]> git.baikalelectronics.ru Git - kernel.git/commit
ubifs: Rectify space amount budget for mkdir/tmpfile operations
authorZhihao Cheng <chengzhihao1@huawei.com>
Mon, 27 Dec 2021 03:22:38 +0000 (11:22 +0800)
committerRichard Weinberger <richard@nod.at>
Mon, 10 Jan 2022 21:12:14 +0000 (22:12 +0100)
commita687f752b4087c2ed21fdf90d6f25ad2cd93a7f6
tree1ead936774a40b19aa58ab453b510c1add64f53d
parentb5e4de1ddd249fb8b505972d29d7cd947000d41b
ubifs: Rectify space amount budget for mkdir/tmpfile operations

UBIFS should make sure the flash has enough space to store dirty (Data
that is newer than disk) data (in memory), space budget is exactly
designed to do that. If space budget calculates less data than we need,
'make_reservation()' will do more work(return -ENOSPC if no free space
lelf, sometimes we can see "cannot reserve xxx bytes in jhead xxx, error
-28" in ubifs error messages) with ubifs inodes locked, which may effect
other syscalls.

A simple way to decide how much space do we need when make a budget:
See how much space is needed by 'make_reservation()' in ubifs_jnl_xxx()
function according to corresponding operation.

It's better to report ENOSPC in ubifs_budget_space(), as early as we can.

Fixes: 3eb439a8d42cc3b ("ubifs: Implement O_TMPFILE")
Fixes: 974763da840dbf0 ("UBIFS: add new flash file system")
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/dir.c