]> www.infradead.org Git - users/willy/xarray.git/commit
ubifs: Remove insert_dead_orphan from replaying orphan process
authorZhihao Cheng <chengzhihao1@huawei.com>
Wed, 10 Apr 2024 07:37:46 +0000 (15:37 +0800)
committerRichard Weinberger <richard@nod.at>
Fri, 12 Jul 2024 19:38:22 +0000 (21:38 +0200)
commit6376d7503b02796cc6109198d555ddebfb4f5f81
treeaf3960831bbbbb1cf49480352829c183845fd499
parent7bed61a1cf166b5c113047fc8f60ff22dcb04893
ubifs: Remove insert_dead_orphan from replaying orphan process

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: Richard Weinberger <richard@nod.at>
fs/ubifs/orphan.c