• Zhihao Cheng's avatar
    ubifs: Remove insert_dead_orphan from replaying orphan process · 6376d750
    Zhihao Cheng authored
    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: default avatarZhihao Cheng <chengzhihao1@huawei.com>
    Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
    6376d750
orphan.c 23.6 KB