All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v3] f2fs: in-memory inode checksum when checking consistency
       [not found] <20180226192843.26680-1-guoweichao@huawei.com>
@ 2018-02-27 10:37 ` Chao Yu
  2018-02-28  5:59   ` Jaegeuk Kim
  2018-02-28  9:58 ` Chao Yu
  1 sibling, 1 reply; 4+ messages in thread
From: Chao Yu @ 2018-02-27 10:37 UTC (permalink / raw)
  To: Weichao Guo, jaegeuk; +Cc: heyunlei, linux-f2fs-devel

On 2018/2/27 3:28, Weichao Guo wrote:
> Enable in-memory inode checksum to protect metadata blocks
> from in-memory scribbles only when checking consistency with
> no performance requirements.
> 
> Signed-off-by: Weichao Guo <guoweichao@huawei.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] f2fs: in-memory inode checksum when checking consistency
  2018-02-27 10:37 ` [PATCH v3] f2fs: in-memory inode checksum when checking consistency Chao Yu
@ 2018-02-28  5:59   ` Jaegeuk Kim
  0 siblings, 0 replies; 4+ messages in thread
From: Jaegeuk Kim @ 2018-02-28  5:59 UTC (permalink / raw)
  To: Chao Yu; +Cc: heyunlei, linux-f2fs-devel

On 02/27, Chao Yu wrote:
> On 2018/2/27 3:28, Weichao Guo wrote:
> > Enable in-memory inode checksum to protect metadata blocks
> > from in-memory scribbles only when checking consistency with
> > no performance requirements.
> > 
> > Signed-off-by: Weichao Guo <guoweichao@huawei.com>
> 
> Reviewed-by: Chao Yu <yuchao0@huawei.com>

This gives a panic easily by fsstress. Could you please check it again?

Thanks,

> 
> Thanks,

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] f2fs: in-memory inode checksum when checking consistency
       [not found] <20180226192843.26680-1-guoweichao@huawei.com>
  2018-02-27 10:37 ` [PATCH v3] f2fs: in-memory inode checksum when checking consistency Chao Yu
@ 2018-02-28  9:58 ` Chao Yu
  2018-02-28 12:34   ` guoweichao
  1 sibling, 1 reply; 4+ messages in thread
From: Chao Yu @ 2018-02-28  9:58 UTC (permalink / raw)
  To: Weichao Guo, jaegeuk; +Cc: heyunlei, linux-f2fs-devel

On 2018/2/27 3:28, Weichao Guo wrote:
> Enable in-memory inode checksum to protect metadata blocks
> from in-memory scribbles only when checking consistency with
> no performance requirements.
> 
> Signed-off-by: Weichao Guo <guoweichao@huawei.com>
> ---
>  fs/f2fs/inode.c | 7 +++++++
>  fs/f2fs/node.c  | 4 +++-
>  2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
> index 205add3d0f3a..b04129d23d21 100644
> --- a/fs/f2fs/inode.c
> +++ b/fs/f2fs/inode.c
> @@ -159,8 +159,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))
> +#endif
>  		return true;
>  
>  	ri = &F2FS_NODE(page)->i;
> @@ -464,6 +468,9 @@ void update_inode_page(struct inode *inode)
>  		return;
>  	}
>  	update_inode(inode, node_page);
> +#ifdef CONFIG_F2FS_CHECK_FS
> +	f2fs_inode_chksum_set(sbi, node_page);
> +#endif

> This gives a panic easily by fsstress. Could you please check it again?

Sorry, I missed some cases, it looks that we need to cover updating place of all
fields like i_addr, inline_xxx, footer with f2fs_inode_chksum_set.

Thanks,

>  	f2fs_put_page(node_page, 1);
>  }
>  
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index 177c438e4a56..2adeb74ae055 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -1113,8 +1113,10 @@ static int read_node_page(struct page *page, int op_flags)
>  		.encrypted_page = NULL,
>  	};
>  
> -	if (PageUptodate(page))
> +	if (PageUptodate(page)) {
> +		f2fs_bug_on(sbi, !f2fs_inode_chksum_verify(sbi, page));
>  		return LOCKED_PAGE;
> +	}
>  
>  	get_node_info(sbi, page->index, &ni);
>  
> 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] f2fs: in-memory inode checksum when checking consistency
  2018-02-28  9:58 ` Chao Yu
@ 2018-02-28 12:34   ` guoweichao
  0 siblings, 0 replies; 4+ messages in thread
From: guoweichao @ 2018-02-28 12:34 UTC (permalink / raw)
  To: Chao Yu, jaegeuk; +Cc: heyunlei, linux-f2fs-devel



On 2018/2/28 17:58, Chao Yu wrote:
> On 2018/2/27 3:28, Weichao Guo wrote:
>> Enable in-memory inode checksum to protect metadata blocks
>> from in-memory scribbles only when checking consistency with
>> no performance requirements.
>>
>> Signed-off-by: Weichao Guo <guoweichao@huawei.com>
>> ---
>>  fs/f2fs/inode.c | 7 +++++++
>>  fs/f2fs/node.c  | 4 +++-
>>  2 files changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
>> index 205add3d0f3a..b04129d23d21 100644
>> --- a/fs/f2fs/inode.c
>> +++ b/fs/f2fs/inode.c
>> @@ -159,8 +159,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))
>> +#endif
>>  		return true;
>>  
>>  	ri = &F2FS_NODE(page)->i;
>> @@ -464,6 +468,9 @@ void update_inode_page(struct inode *inode)
>>  		return;
>>  	}
>>  	update_inode(inode, node_page);
>> +#ifdef CONFIG_F2FS_CHECK_FS
>> +	f2fs_inode_chksum_set(sbi, node_page);
>> +#endif
> 
>> This gives a panic easily by fsstress. Could you please check it again?
> 
> Sorry, I missed some cases, it looks that we need to cover updating place of all
> fields like i_addr, inline_xxx, footer with f2fs_inode_chksum_set.
> 
Sorry for that , I will do more test in the following.
Thanks,

> Thanks,
> 
>>  	f2fs_put_page(node_page, 1);
>>  }
>>  
>> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
>> index 177c438e4a56..2adeb74ae055 100644
>> --- a/fs/f2fs/node.c
>> +++ b/fs/f2fs/node.c
>> @@ -1113,8 +1113,10 @@ static int read_node_page(struct page *page, int op_flags)
>>  		.encrypted_page = NULL,
>>  	};
>>  
>> -	if (PageUptodate(page))
>> +	if (PageUptodate(page)) {
>> +		f2fs_bug_on(sbi, !f2fs_inode_chksum_verify(sbi, page));
>>  		return LOCKED_PAGE;
>> +	}
>>  
>>  	get_node_info(sbi, page->index, &ni);
>>  
>>
> 
> 
> .
> 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-28 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20180226192843.26680-1-guoweichao@huawei.com>
2018-02-27 10:37 ` [PATCH v3] f2fs: in-memory inode checksum when checking consistency Chao Yu
2018-02-28  5:59   ` Jaegeuk Kim
2018-02-28  9:58 ` Chao Yu
2018-02-28 12:34   ` guoweichao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.