Re: [PATCH RFC 00/17] ubifs: Add filesystem repair support

From: Richard Weinberger
Date: Wed Jan 03 2024 - 08:34:00 EST


----- Ursprüngliche Mail -----
> Von: "chengzhihao1" <chengzhihao1@xxxxxxxxxx>
>> 2. Journal replay is also needed after a clean umount. The reason is that
>> UBIFS does no commit at umount time.
>
> I agree, there exists one situation that UBIFS replays journal even
> after clean umount.
> P1 ubifs_bgt umount
> mkdir
> run_bg_commit
> c->cmt_state = COMMIT_RUNNING_BACKGROUND
> do_commit
> ubifs_log_start_commit(c, &new_ltail_lnum) // log start
> up_write(&c->commit_sem)
> touch
> ubifs_jnl_update // new buds added
> cleanup_mnt
> deactivate_super
> fs->kill_sb
> generic_shutdown_super
> sync_filesystem
> ubifs_sync_fs
> ubifs_run_commit
> wait_for_commit // wait bg commit,
> 'touch' won't be commited, it will be replayed in next mount

BTW: I was imprecise, sorry for that.
The issue is that even after a commit you need to replay the journal.

Thanks,
//richard