在 2024/1/3 4:45, Richard Weinberger 写道:
----- Ursprüngliche Mail -----
Von: "chengzhihao1" <chengzhihao1@xxxxxxxxxx>
I come up with another way to implement fsck.ubifs:
There are three modes:
1. common mode(no options): Ask user whether to fix as long as a problem
is detected.
Makes sense.
2. safe mode(-a option): Auto repair as long as no data/files lost(eg.
nlink, isize, xattr_cnt, which can be corrected without dropping nodes),
otherwise returns error code.
Makes sense.
3. dangerous mode(-y option): Fix is always successful, unless
superblock is corrupted. There are 2 situations:
Please not use "-y". Usually "-y" stands for "answer yes to all questions".
But selecting names for command line flags is currently my least concern.
a) TNC is valid: fsck will print which file is dropped and which
file's data is dropped
Sounds also good.
b) TNC is invalid: fsck will scan all nodes without referencing TNC,
same as this patchset does
I'd make this a distinct mode.
It can be used to rebuild index and LEB property trees.
This is basically a "drop trees and rebuild" mode.
OK, then fsck will have four modes.