+0
−49
Loading
maillist inclusion category: cleanup bugzilla: https://gitee.com/openeuler/kernel/issues/I9MWEQ CVE: NA Reference: https://lore.kernel.org/lkml/20240410073751.2522830-8-chengzhihao1@huawei.com/T/ -------------------------------- UBIFS will do commit at the end of mounting process(rw mode), dead orphans(added by insert_dead_orphan in replaying orphan) are deleted by ubifs_orphan_end_commit(). The only reason why dead orphans are added into orphan list is that old orpans may be lost when powercut happens in ubifs_orphan_end_commit(): ubifs_orphan_end_commit // TNC(updated by orphans) is not written yet if (c->cmt_orphans != 0) commit_orphans consolidate // traverse orphan list write_orph_nodes // rewrite all orphans by ubifs_leb_change // If dead orphans are not in list, they will be lost when powercut // happens, then TNC won't be updated by old orphans in next mounting. Luckily, the condition 'c->cmt_orphans != 0' will never be true in mounting process, there can't be new orphans added into orphan list before mounting returned, but commit will be done at the end of mounting. Signed-off-by:Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by:
ZhaoLong Wang <wangzhaolong1@huawei.com>