UBIFS: ubifs_recover_leb() always execute fix_unclean_leb() even all the nodes are valid

韩仁杰 hanrenjie123 at gmail.com
Thu Dec 23 23:58:38 PST 2021


I've been working on Linux 4.4.60 recently When using UBIFS file system,

I recently encountered a problem that every time I power off and restart,

I will enter the recovery process of UBIFS.



I do understand the reason for entering recovery during startup, and the

main  purpose of ubifs_recover_leb() is to deal with an invalid node and

make ubifs mount successfully. But even if there are no invalid nodes,

ubifs_recover_leb() will call  fix_unclean_leb(), which results in flash’s erase

and write operations during startup.



I checked the modify history of kernel/fs/ubifs/recovery.c, and found a related

commit:

  http://git.infradead.org/linux.git/commitdiff/7c47bfd0dbb20e5d7fa4e37cfd76bb7

3d39b32b4?hp=617992069513c1e789c707c4d75ff03bf7dd0fb0.



In the commit, variable "need_clean" was deleted. My question is that
whether it is

necessary to execute fix_unclean_leb() if there are no invalid node ?
I am not sure if

there are some additional considerations I didn't think of ?



Thank you very much for any insight you can provide



-Han Renjie



More information about the linux-mtd mailing list