[PATCH 0/9] ubifs: Fix a serious of inconsistent problems when powercut happens

From: Zhihao Cheng
Date: Wed Apr 10 2024 - 03:46:52 EST


UBIFS is tolerant of powercut, this patchset fix some inconsistent
problems when powercut happens.
Xfstests,mtd-utils and powercut tests[1] are passed(Enable chk* debugging)
after this patchset applied.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=218309

performance regression:

4GB nandsim 256KB PEB 4KB page

1. fio

direct=0
bs=4k
sync=0
iodepth=128
rw=write
iodepth_batch_complete=1
iodepth_batch=1
numjobs=1
directory=/root/temp
size=1G
runtime=20s
time_based=1
before after
1 thread seq write 412MiB/s 409MiB/s
1 thread random write 402MiB/s 397MiB/s
4 thread seq write 163MiB/s 164MiB/s
4 thread random write 162MiB/s 160MiB/s

2. fsmark
fs_mark -d /root/temp -s 10240 -n 1000
before after
7131 Files/sec 7090 Files/sec


Zhihao Cheng (9):
ubifs: Fix unattached xattr inode if powercut happens after deleting
ubifs: Don't add xattr inode into orphan area
Revert "ubifs: ubifs_symlink: Fix memleak of inode->i_link in error
path"
ubifs: Remove insert_dead_orphan from replaying orphan process
ubifs: Fix adding orphan entry twice for the same inode
ubifs: Move ui->data initialization after initializing security
ubifs: Fix space leak when powercut happens in linking tmpfile
ubifs: Fix unattached inode when powercut happens in creating
ubifs: dbg_orphan_check: Fix missed key type checking

fs/ubifs/dir.c | 91 +++++++++++++++-----------
fs/ubifs/journal.c | 14 +++-
fs/ubifs/orphan.c | 155 ++++++++-------------------------------------
fs/ubifs/ubifs.h | 7 +-
fs/ubifs/xattr.c | 2 +-
5 files changed, 92 insertions(+), 177 deletions(-)

--
2.39.2