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

Richard Weinberger richard at nod.at
Wed Jan 3 05:33:00 PST 2024


----- Ursprüngliche Mail -----
> Von: "chengzhihao1" <chengzhihao1 at huawei.com>
>> 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



More information about the linux-mtd mailing list