linux-stable/fs/ubifs
Zhihao Cheng 2dc49f58a2 ubifs: Rectify space amount budget for mkdir/tmpfile operations
[ Upstream commit a6dab6607d ]

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-13 21:00:53 +02:00
..
auth.c ubifs: Fix memleak in ubifs_init_authentication 2021-03-04 11:37:51 +01:00
budget.c ubifs: Limit the number of pages in shrink_liability 2019-08-22 17:25:33 +02:00
commit.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
compress.c
crypto.c
debug.c ubifs: dent: Fix some potential memory leaks while iterating entries 2020-09-17 22:55:51 +02:00
debug.h
dir.c ubifs: Rectify space amount budget for mkdir/tmpfile operations 2022-04-13 21:00:53 +02:00
file.c ubifs: Fix to add refcount once page is set private 2022-04-08 14:40:39 +02:00
find.c
gc.c treewide: Change list_sort to use const pointers 2021-09-30 10:11:04 +02:00
io.c ubifs: Fix read out-of-bounds in ubifs_wbuf_write_nolock() 2022-04-08 14:40:39 +02:00
ioctl.c ubifs: setflags: Make dirtied_ino_d 8 bytes aligned 2022-04-08 14:40:39 +02:00
journal.c ubifs: journal: Fix error return code in ubifs_jnl_write_inode() 2021-07-20 16:05:51 +02:00
Kconfig fscrypt: Allow modular crypto algorithms 2019-12-31 10:33:51 -06:00
key.h ubifs: allow both hash and disk name to be provided in no-key names 2020-01-22 14:49:56 -08:00
log.c
lprops.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
lpt.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
lpt_commit.c mm: remove the pgprot argument to __vmalloc 2020-06-02 10:59:11 -07:00
Makefile
master.c ubifs: use crypto_shash_tfm_digest() 2020-05-08 15:32:15 +10:00
misc.c
misc.h ubifs: misc.h: delete a duplicated word 2020-08-02 22:59:03 +02:00
orphan.c ubifs: xattr: Fix some potential memory leaks while iterating entries 2020-09-17 22:55:41 +02:00
recovery.c
replay.c treewide: Change list_sort to use const pointers 2021-09-30 10:11:04 +02:00
sb.c ubifs: add option to specify version for new file systems 2020-08-02 22:23:46 +02:00
scan.c
shrinker.c
super.c ubifs: Error path in ubifs_remount_rw() seems to wrongly free write buffers 2022-01-27 10:54:24 +01:00
tnc.c This pull request contains fixes for UBI and UBIFS 2020-10-18 09:56:50 -07:00
tnc_commit.c ubifs: ubifs_tnc_start_commit: Fix OOB in layout_in_gaps 2019-11-17 22:22:54 +01:00
tnc_misc.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
ubifs-media.h
ubifs.h ubifs: Fix races between xattr_{set|get} and listxattr operations 2021-07-19 09:45:00 +02:00
xattr.c ubifs: Fix off-by-one error 2021-07-20 16:05:51 +02:00