Hi Chao,

On 2018/3/8 17:11, Chao Yu wrote:
> Hi Weichao,
> 
> On 2018/3/8 15:56, guoweichao wrote:
>> Hi Chao,
>>
>> On 2018/3/8 14:15, Chao Yu wrote:
>>> On 2018/3/8 5:10, Weichao Guo wrote:
>>>> Only enable in-memory inode checksum to protect metadata blocks
>>>> from in-memory scribbles when checking consistency, which has no
>>>> performance requirements.
>>>
>>> Once we modify the node page of inode, we will call set_page_dirty, not 
>>> sure,
>>> can you check that we can just call f2fs_inode_chksum_set in set_page_dirty?
>>>
>> In most cases, we call set_page_dirty after modifying the node page of inode.
>> But in the case of update_inode, set_page_dirty is called before modifying 
>> the node page.
> 
> IIRC, we can not change that order, but we can add addition
> f2fs_inode_chksum_set in the end of update_inode.
> 
>> And in fsync_node_pages, if the node page of inode is already dirtied, 
>> set_page_dirty will
>> be skipped.
I reviewed this case: we call __write_node_page after set dentry/fsync flag in 
node footer of
the inode page, and no need to update inode checksum here. It's safe.

Another case is f2fs_do_tmpfile, when init_inode_metadata, if inode is not in 
FI_NEW_INODE state,
cold bit in the node footer is set and there is no set_page_dirty followed.
IMO, the inode should be FI_NEW_INODE in init_inode_metada when creating temp 
file.
So we don't have to worry about it.

Thanks,
> 
> We can handle that exception by adding f2fs_inode_chksum_set there too.
> 
> Thanks,
> 
>>
>> IMO, calling f2fs_inode_chksum_set in set_page_dirty is more clear and 
>> reasonable.
>> Can we add or move set_page_dirty in the exceptional cases?
>>
>> Thank,
>>
>>> Thanks,
>>>
>>>
>>> .
>>>
>>
>>
>> .
>>
> 
> 
> .
> 


------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to