On Tue, Mar 13, 2018 at 05:19:51PM +0800, guoweichao wrote:
> 
> 
> On 2018/3/13 16:49, Sahitya Tummala wrote:
> > On Thu, Mar 08, 2018 at 05:10:40AM +0800, Weichao Guo wrote:
> >> @@ -159,8 +162,12 @@ bool f2fs_inode_chksum_verify(struct f2fs_sb_info 
> >> *sbi, struct page *page)
> >>    struct f2fs_inode *ri;
> >>    __u32 provided, calculated;
> >>  
> >> +#ifdef CONFIG_F2FS_CHECK_FS
> >> +  if (!f2fs_enable_inode_chksum(sbi, page))
> >> +#else
> >>    if (!f2fs_enable_inode_chksum(sbi, page) ||
> >>                    PageDirty(page) || PageWriteback(page))
> > 
> > I see that f2fs_inode_chksum_set() is set only if CONFIG_F2FS_CHECK_FS is
> f2fs_inode_chksum_set is also called in allocate_data_block when fs write 
> back inode to disk.

yes, I got it now. Thanks for providing the clarification.

> > enabled. So in this #else case, if sb has inode checksum enabled but
> > PageDirty() or PageWriteback() is not set, then we may proceed below and do
> So when the inode is read from disk, e.g. PageDirty / PageWriteback is not 
> set,
> the checksum verify process should be ok.
> > the comparison between provided and calculated check sum and it may fail
> > resulting into checksum invalid error?
> > 

--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to