2018-02-08 12:36:02

by Yunlong Song

[permalink] [raw]
Subject: [PATCH] f2fs: set_code_data in move_data_block

Signed-off-by: Yunlong Song <[email protected]>
---
fs/f2fs/gc.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index b9d93fd..2095630 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -692,6 +692,7 @@ static void move_data_block(struct inode *inode, block_t bidx,
fio.op = REQ_OP_WRITE;
fio.op_flags = REQ_SYNC;
fio.new_blkaddr = newaddr;
+ set_cold_data(fio.page);
err = f2fs_submit_page_write(&fio);
if (err) {
if (PageWriteback(fio.encrypted_page))
--
1.8.5.2



2018-02-11 03:36:02

by Yunlong Song

[permalink] [raw]
Subject: Re: [PATCH] f2fs: set_code_data in move_data_block

Ping...

move_data_block misses set_cold_data, then the F2FS_WB_CP_DATA will
lack these data pages in move_data_block, and write_checkpoint can
not make sure this pages committed to the flash.

On 2018/2/8 20:33, Yunlong Song wrote:
> Signed-off-by: Yunlong Song <[email protected]>
> ---
> fs/f2fs/gc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index b9d93fd..2095630 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -692,6 +692,7 @@ static void move_data_block(struct inode *inode, block_t bidx,
> fio.op = REQ_OP_WRITE;
> fio.op_flags = REQ_SYNC;
> fio.new_blkaddr = newaddr;
> + set_cold_data(fio.page);
> err = f2fs_submit_page_write(&fio);
> if (err) {
> if (PageWriteback(fio.encrypted_page))
>

--
Thanks,
Yunlong Song


2018-02-11 03:51:26

by Chao Yu

[permalink] [raw]
Subject: Re: [PATCH] f2fs: set_code_data in move_data_block

On 2018/2/11 11:34, Yunlong Song wrote:
> Ping...
>
> move_data_block misses set_cold_data, then the F2FS_WB_CP_DATA will
> lack these data pages in move_data_block, and write_checkpoint can
> not make sure this pages committed to the flash.

Hmm.. data block migration is running based on meta inode, so it will
be safe since checkpoint will flush all meta pages including encrypted
pages cached in meta inode?

Thanks,

>
> On 2018/2/8 20:33, Yunlong Song wrote:
>> Signed-off-by: Yunlong Song <[email protected]>
>> ---
>> fs/f2fs/gc.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
>> index b9d93fd..2095630 100644
>> --- a/fs/f2fs/gc.c
>> +++ b/fs/f2fs/gc.c
>> @@ -692,6 +692,7 @@ static void move_data_block(struct inode *inode, block_t bidx,
>> fio.op = REQ_OP_WRITE;
>> fio.op_flags = REQ_SYNC;
>> fio.new_blkaddr = newaddr;
>> + set_cold_data(fio.page);
>> err = f2fs_submit_page_write(&fio);
>> if (err) {
>> if (PageWriteback(fio.encrypted_page))
>>
>


2018-02-11 03:52:33

by heyunlei

[permalink] [raw]
Subject: RE: [PATCH] f2fs: set_code_data in move_data_block



>-----Original Message-----
>From: Songyunlong (Euler)
>Sent: Sunday, February 11, 2018 11:35 AM
>To: [email protected]; [email protected]; Yuchao (T); [email protected]
>Cc: miaoxie (A); Wangbintian; shengyong (A); heyunlei; [email protected]; [email protected]
>Subject: Re: [PATCH] f2fs: set_code_data in move_data_block
>
>Ping...
>
>move_data_block misses set_cold_data, then the F2FS_WB_CP_DATA will
>lack these data pages in move_data_block, and write_checkpoint can
>not make sure this pages committed to the flash.
>

Here, we write encrypted_page back, which belong to meta mapping.

Thanks.


>On 2018/2/8 20:33, Yunlong Song wrote:
>> Signed-off-by: Yunlong Song <[email protected]>
>> ---
>> fs/f2fs/gc.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
>> index b9d93fd..2095630 100644
>> --- a/fs/f2fs/gc.c
>> +++ b/fs/f2fs/gc.c
>> @@ -692,6 +692,7 @@ static void move_data_block(struct inode *inode, block_t bidx,
>> fio.op = REQ_OP_WRITE;
>> fio.op_flags = REQ_SYNC;
>> fio.new_blkaddr = newaddr;
>> + set_cold_data(fio.page);
>> err = f2fs_submit_page_write(&fio);
>> if (err) {
>> if (PageWriteback(fio.encrypted_page))
>>
>
>--
>Thanks,
>Yunlong Song

2018-02-11 06:19:09

by Yunlong Song

[permalink] [raw]
Subject: Re: [PATCH] f2fs: set_code_data in move_data_block

OK, Got it.

On 2018/2/11 11:50, Chao Yu wrote:
> On 2018/2/11 11:34, Yunlong Song wrote:
>> Ping...
>>
>> move_data_block misses set_cold_data, then the F2FS_WB_CP_DATA will
>> lack these data pages in move_data_block, and write_checkpoint can
>> not make sure this pages committed to the flash.
>
> Hmm.. data block migration is running based on meta inode, so it will
> be safe since checkpoint will flush all meta pages including encrypted
> pages cached in meta inode?
>
> Thanks,
>
>>
>> On 2018/2/8 20:33, Yunlong Song wrote:
>>> Signed-off-by: Yunlong Song <[email protected]>
>>> ---
>>> fs/f2fs/gc.c | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
>>> index b9d93fd..2095630 100644
>>> --- a/fs/f2fs/gc.c
>>> +++ b/fs/f2fs/gc.c
>>> @@ -692,6 +692,7 @@ static void move_data_block(struct inode *inode, block_t bidx,
>>> fio.op = REQ_OP_WRITE;
>>> fio.op_flags = REQ_SYNC;
>>> fio.new_blkaddr = newaddr;
>>> + set_cold_data(fio.page);
>>> err = f2fs_submit_page_write(&fio);
>>> if (err) {
>>> if (PageWriteback(fio.encrypted_page))
>>>
>>
>
>
> .
>

--
Thanks,
Yunlong Song