Hello, On 2019/10/28 14:37, 王矛 wrote: > Hi Chao, > > Sorry to bother you again with last question about this topic. :) > > "Actually, APP can update data during CP disabling, unless there is no enough > free space" > So we don't prevent app update data during CP disabling, but we prevent the > dirty node/data information to be synced into storage, right? > > From code i can see below sync operation will return directly if find CP is > disabled: > f2fs_sync_fs() > f2fs_do_sync_file() > if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED))) > return 0; > > My question is, i didn't find any code to check CP is disabled in the > Wribe-Back > procedure. > As you know, WB procedure would be executed periodically and flush dirty data > into storage. > Thus if WB is not prevented during CP disabled, data still be updated onto > flash, this is out of expectation of UDC, is this right?
We don't need to take care of WB, if CP and fsync is disabled, after sudden power-cut, we will rollback to previous CP, which will not contain writebacked data/node. Thanks, > > Thanks, > Mao > > > At 2019-10-24 21:15:20, "王矛" <[email protected]> wrote: > > Chao, > > Very appreciated for your kind and prompt reply. :) > > Let me try to spend more time on the f2fs UDC related code and get back > later if I have further questions. > > Thanks! > Mao > > At 2019-10-23 17:42:03, "Chao Yu" <[email protected]> wrote: > >Hello, > > > >On 2019/10/23 16:35, 王矛 wrote: > > > >[snip] > > > >> When CP is disabled, I saw many f2fs operations are prevented(listed > above). > >> > >> If so, during the period CP disabled, app can’t do any change to f2fs? > > > >Please Cc f2fs mailing list for any f2fs question. > > > >Actually, APP can update data during CP disabling, unless there is no > enough > >free space, the logic was indicated by below codes: > > > >static inline bool f2fs_is_checkpoint_ready(struct f2fs_sb_info *sbi) > >{ > > if (likely(!is_sbi_flag_set(sbi, SBI_CP_DISABLED))) > > return true; > > if (likely(!has_not_enough_free_secs(sbi, 0, 0))) > > return true; > > return false; > >} > > > >static int f2fs_mknod(struct inode *dir, struct dentry *dentry, > > umode_t mode, dev_t rdev) > >{ > > struct f2fs_sb_info *sbi = F2FS_I_SB(dir); > > struct inode *inode; > > int err = 0; > > > > if (unlikely(f2fs_cp_error(sbi))) > > return -EIO; > > if (!f2fs_is_checkpoint_ready(sbi)) > > return -ENOSPC; > >... > >} > > > >Once all data was updated by Android, we can terminate CP disabling > status, and > >trigger a checkpoint to persist all previous updates. > > > >Thanks, > > > >> > >> If yes, how it implemented the checkpoint function? > >> > >> Maybe the patch I > >> found(https://sourceforge.net/p/linux-f2fs/mailman/message/36425511/) > is not the > >> whole implementation of this feaute…. > >> > >> > >> > >> > >> Thanks, > >> > >> Mao > >> > >> > >> > >> > >> > > > > > > > > > _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
