linux/fs/ubifs
Zhihao Cheng d95e0367fd ubifs: Rectify space amount budget for mkdir/tmpfile operations
[ Upstream commit a6dab6607d4681d227905d5198710b575dbdb519 ]

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: 474b93704f ("ubifs: Implement O_TMPFILE")
Fixes: 1e51764a3c ("UBIFS: add new flash file system")
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-15 14:18:31 +02:00
..
auth.c
budget.c
commit.c
compress.c
crypto.c
debug.c
debug.h
dir.c ubifs: Rectify space amount budget for mkdir/tmpfile operations 2022-04-15 14:18:31 +02:00
file.c
find.c
gc.c
io.c ubifs: Fix read out-of-bounds in ubifs_wbuf_write_nolock() 2022-04-15 14:18:28 +02:00
ioctl.c ubifs: setflags: Make dirtied_ino_d 8 bytes aligned 2022-04-15 14:18:28 +02:00
journal.c
Kconfig
key.h
log.c
lprops.c
lpt_commit.c
lpt.c
Makefile
master.c
misc.c
misc.h
orphan.c
recovery.c
replay.c
sb.c
scan.c
shrinker.c
super.c
tnc_commit.c
tnc_misc.c
tnc.c
ubifs-media.h
ubifs.h
xattr.c