linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: check total CP pack block count correctly
@ 2018-08-01  3:46 Sheng Yong
  2018-08-01  6:56 ` Chao Yu
  0 siblings, 1 reply; 5+ messages in thread
From: Sheng Yong @ 2018-08-01  3:46 UTC (permalink / raw)
  To: jaegeuk, yuchao0; +Cc: miaoxie, tony.zhangxiaobo, linux-f2fs-devel

Fixes: 652d19558a347 ('f2fs: fix to do sanity check with block address in main area')
Reported-by: Zhang Xiaobo <tony.zhangxiaobo@huawei.com>
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
---
 fs/f2fs/checkpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 3587aa53dc90..c32ee10a1384 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -809,7 +809,7 @@ static struct page *validate_checkpoint(struct f2fs_sb_info *sbi,
 		goto invalid_cp1;
 
 	if (le32_to_cpu(cp_block->cp_pack_total_block_count) >
-					sbi->log_blocks_per_seg) {
+					sbi->blocks_per_seg - 1) {
 		f2fs_msg(sbi->sb, KERN_WARNING,
 			"invalid cp_pack_total_block_count:%u",
 			le32_to_cpu(cp_block->cp_pack_total_block_count));
-- 
2.17.1


------------------------------------------------------------------------------
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 related	[flat|nested] 5+ messages in thread

* Re: [PATCH] f2fs: check total CP pack block count correctly
  2018-08-01  3:46 [PATCH] f2fs: check total CP pack block count correctly Sheng Yong
@ 2018-08-01  6:56 ` Chao Yu
  2018-08-01  7:36   ` Sheng Yong
  0 siblings, 1 reply; 5+ messages in thread
From: Chao Yu @ 2018-08-01  6:56 UTC (permalink / raw)
  To: Sheng Yong, jaegeuk; +Cc: miaoxie, tony.zhangxiaobo, linux-f2fs-devel

Hi Sheng,

On 2018/8/1 11:46, Sheng Yong wrote:
> Fixes: 652d19558a347 ('f2fs: fix to do sanity check with block address in main area')
> Reported-by: Zhang Xiaobo <tony.zhangxiaobo@huawei.com>
> Signed-off-by: Sheng Yong <shengyong1@huawei.com>

That's my bad, and thanks for the fix.

Do you mind merge this into buggy patch, since the patch has not been upstreamed
yet.

Thanks,

> ---
>  fs/f2fs/checkpoint.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index 3587aa53dc90..c32ee10a1384 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -809,7 +809,7 @@ static struct page *validate_checkpoint(struct f2fs_sb_info *sbi,
>  		goto invalid_cp1;
>  
>  	if (le32_to_cpu(cp_block->cp_pack_total_block_count) >
> -					sbi->log_blocks_per_seg) {
> +					sbi->blocks_per_seg - 1) {
>  		f2fs_msg(sbi->sb, KERN_WARNING,
>  			"invalid cp_pack_total_block_count:%u",
>  			le32_to_cpu(cp_block->cp_pack_total_block_count));
> 


------------------------------------------------------------------------------
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] 5+ messages in thread

* Re: [PATCH] f2fs: check total CP pack block count correctly
  2018-08-01  6:56 ` Chao Yu
@ 2018-08-01  7:36   ` Sheng Yong
  2018-08-01 10:26     ` Chao Yu
  0 siblings, 1 reply; 5+ messages in thread
From: Sheng Yong @ 2018-08-01  7:36 UTC (permalink / raw)
  To: Chao Yu, jaegeuk; +Cc: miaoxie, tony.zhangxiaobo, linux-f2fs-devel



On 2018/8/1 14:56, Chao Yu wrote:
> Hi Sheng,
> 
> On 2018/8/1 11:46, Sheng Yong wrote:
>> Fixes: 652d19558a347 ('f2fs: fix to do sanity check with block address in main area')
>> Reported-by: Zhang Xiaobo <tony.zhangxiaobo@huawei.com>
>> Signed-off-by: Sheng Yong <shengyong1@huawei.com>
> 
> That's my bad, and thanks for the fix.
> 
> Do you mind merge this into buggy patch, since the patch has not been upstreamed
> yet.

No, of course not :)

Thanks,

> 
> Thanks,
> 
>> ---
>>   fs/f2fs/checkpoint.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
>> index 3587aa53dc90..c32ee10a1384 100644
>> --- a/fs/f2fs/checkpoint.c
>> +++ b/fs/f2fs/checkpoint.c
>> @@ -809,7 +809,7 @@ static struct page *validate_checkpoint(struct f2fs_sb_info *sbi,
>>   		goto invalid_cp1;
>>   
>>   	if (le32_to_cpu(cp_block->cp_pack_total_block_count) >
>> -					sbi->log_blocks_per_seg) {
>> +					sbi->blocks_per_seg - 1) {
>>   		f2fs_msg(sbi->sb, KERN_WARNING,
>>   			"invalid cp_pack_total_block_count:%u",
>>   			le32_to_cpu(cp_block->cp_pack_total_block_count));
>>
> 
> 
> .
> 


------------------------------------------------------------------------------
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] 5+ messages in thread

* Re: [PATCH] f2fs: check total CP pack block count correctly
  2018-08-01  7:36   ` Sheng Yong
@ 2018-08-01 10:26     ` Chao Yu
  2018-08-01 10:58       ` Sheng Yong
  0 siblings, 1 reply; 5+ messages in thread
From: Chao Yu @ 2018-08-01 10:26 UTC (permalink / raw)
  To: Sheng Yong, jaegeuk; +Cc: miaoxie, tony.zhangxiaobo, linux-f2fs-devel

On 2018/8/1 15:36, Sheng Yong wrote:
> 
> 
> On 2018/8/1 14:56, Chao Yu wrote:
>> Hi Sheng,
>>
>> On 2018/8/1 11:46, Sheng Yong wrote:
>>> Fixes: 652d19558a347 ('f2fs: fix to do sanity check with block address in main area')
>>> Reported-by: Zhang Xiaobo <tony.zhangxiaobo@huawei.com>
>>> Signed-off-by: Sheng Yong <shengyong1@huawei.com>
>>
>> That's my bad, and thanks for the fix.
>>
>> Do you mind merge this into buggy patch, since the patch has not been upstreamed
>> yet.
> 
> No, of course not :)
> 
> Thanks,
> 
>>
>> Thanks,
>>
>>> ---
>>>   fs/f2fs/checkpoint.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
>>> index 3587aa53dc90..c32ee10a1384 100644
>>> --- a/fs/f2fs/checkpoint.c
>>> +++ b/fs/f2fs/checkpoint.c
>>> @@ -809,7 +809,7 @@ static struct page *validate_checkpoint(struct f2fs_sb_info *sbi,
>>>   		goto invalid_cp1;
>>>   
>>>   	if (le32_to_cpu(cp_block->cp_pack_total_block_count) >
>>> -					sbi->log_blocks_per_seg) {
>>> +					sbi->blocks_per_seg - 1) {

actually, cp_pack_total_block_count can be sbi->blocks_per_seg?

Thanks,

>>>   		f2fs_msg(sbi->sb, KERN_WARNING,
>>>   			"invalid cp_pack_total_block_count:%u",
>>>   			le32_to_cpu(cp_block->cp_pack_total_block_count));
>>>
>>
>>
>> .
>>
> 
> 
> .
> 


------------------------------------------------------------------------------
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] 5+ messages in thread

* Re: [PATCH] f2fs: check total CP pack block count correctly
  2018-08-01 10:26     ` Chao Yu
@ 2018-08-01 10:58       ` Sheng Yong
  0 siblings, 0 replies; 5+ messages in thread
From: Sheng Yong @ 2018-08-01 10:58 UTC (permalink / raw)
  To: Chao Yu, jaegeuk; +Cc: miaoxie, tony.zhangxiaobo, linux-f2fs-devel



On 2018/8/1 18:26, Chao Yu wrote:
> On 2018/8/1 15:36, Sheng Yong wrote:
>>
>>
>> On 2018/8/1 14:56, Chao Yu wrote:
>>> Hi Sheng,
>>>
>>> On 2018/8/1 11:46, Sheng Yong wrote:
>>>> Fixes: 652d19558a347 ('f2fs: fix to do sanity check with block address in main area')
>>>> Reported-by: Zhang Xiaobo <tony.zhangxiaobo@huawei.com>
>>>> Signed-off-by: Sheng Yong <shengyong1@huawei.com>
>>>
>>> That's my bad, and thanks for the fix.
>>>
>>> Do you mind merge this into buggy patch, since the patch has not been upstreamed
>>> yet.
>>
>> No, of course not :)
>>
>> Thanks,
>>
>>>
>>> Thanks,
>>>
>>>> ---
>>>>    fs/f2fs/checkpoint.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
>>>> index 3587aa53dc90..c32ee10a1384 100644
>>>> --- a/fs/f2fs/checkpoint.c
>>>> +++ b/fs/f2fs/checkpoint.c
>>>> @@ -809,7 +809,7 @@ static struct page *validate_checkpoint(struct f2fs_sb_info *sbi,
>>>>    		goto invalid_cp1;
>>>>    
>>>>    	if (le32_to_cpu(cp_block->cp_pack_total_block_count) >
>>>> -					sbi->log_blocks_per_seg) {
>>>> +					sbi->blocks_per_seg - 1) {
> 
> actually, cp_pack_total_block_count can be sbi->blocks_per_seg?
> 
Oh, right, it can be sbi->blocks_per_seg :)

Thanks
> Thanks,
> 
>>>>    		f2fs_msg(sbi->sb, KERN_WARNING,
>>>>    			"invalid cp_pack_total_block_count:%u",
>>>>    			le32_to_cpu(cp_block->cp_pack_total_block_count));
>>>>
>>>
>>>
>>> .
>>>
>>
>>
>> .
>>
> 
> 
> .
> 


------------------------------------------------------------------------------
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] 5+ messages in thread

end of thread, other threads:[~2018-08-01 10:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-01  3:46 [PATCH] f2fs: check total CP pack block count correctly Sheng Yong
2018-08-01  6:56 ` Chao Yu
2018-08-01  7:36   ` Sheng Yong
2018-08-01 10:26     ` Chao Yu
2018-08-01 10:58       ` Sheng Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).