All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] f2fs: fix to update new block address correctly for OPU
@ 2018-11-24 22:17 Jia Zhu
  2018-11-26  2:01 ` Chao Yu
  0 siblings, 1 reply; 4+ messages in thread
From: Jia Zhu @ 2018-11-24 22:17 UTC (permalink / raw)
  To: jaegeuk, chao, yuchao0; +Cc: jaizhu.zj, Jia Zhu, linux-f2fs-devel

Previously, we allocated a new block address for OPU mode in direct_IO.

But the new address couldn't be assigned to @map->m_pblk correctly.

This patch fix it.

Signed-off-by: Jia Zhu <zhujia13@huawei.com>
---
 fs/f2fs/data.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 7226300..a3a567a 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1110,8 +1110,10 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map,
 		if (test_opt(sbi, LFS) && flag == F2FS_GET_BLOCK_DIO &&
 							map->m_may_create) {
 			err = __allocate_data_block(&dn, map->m_seg_type);
-			if (!err)
+			if (!err) {
+				blkaddr = dn.data_blkaddr;
 				set_inode_flag(inode, FI_APPEND_WRITE);
+			}
 		}
 	} else {
 		if (create) {
-- 
2.10.1

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

* Re: [PATCH] f2fs: fix to update new block address correctly for OPU
  2018-11-24 22:17 [PATCH] f2fs: fix to update new block address correctly for OPU Jia Zhu
@ 2018-11-26  2:01 ` Chao Yu
  2018-11-26  3:48   ` Zhujia (Euler)
  0 siblings, 1 reply; 4+ messages in thread
From: Chao Yu @ 2018-11-26  2:01 UTC (permalink / raw)
  To: Jia Zhu, jaegeuk, chao; +Cc: jaizhu.zj, linux-f2fs-devel

On 2018/11/25 6:17, Jia Zhu wrote:
> Previously, we allocated a new block address for OPU mode in direct_IO.
> 
> But the new address couldn't be assigned to @map->m_pblk correctly.
> 
> This patch fix it.

Sorry to introduce this bug...

It needs to Cc stable kernel mailing list and add 'Fixes' tag line.

> 
> Signed-off-by: Jia Zhu <zhujia13@huawei.com>

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

Thanks,

> ---
>  fs/f2fs/data.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 7226300..a3a567a 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -1110,8 +1110,10 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map,
>  		if (test_opt(sbi, LFS) && flag == F2FS_GET_BLOCK_DIO &&
>  							map->m_may_create) {
>  			err = __allocate_data_block(&dn, map->m_seg_type);
> -			if (!err)
> +			if (!err) {
> +				blkaddr = dn.data_blkaddr;
>  				set_inode_flag(inode, FI_APPEND_WRITE);
> +			}
>  		}
>  	} else {
>  		if (create) {
> 

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

* Re: [PATCH] f2fs: fix to update new block address correctly for OPU
  2018-11-26  2:01 ` Chao Yu
@ 2018-11-26  3:48   ` Zhujia (Euler)
  2018-11-26  7:08     ` Chao Yu
  0 siblings, 1 reply; 4+ messages in thread
From: Zhujia (Euler) @ 2018-11-26  3:48 UTC (permalink / raw)
  To: Chao Yu, jaegeuk, chao; +Cc: jaizhu.zj, linux-f2fs-devel

Hi  Chao,

On 2018/11/26 10:01, Chao Yu wrote:
> On 2018/11/25 6:17, Jia Zhu wrote:
>> Previously, we allocated a new block address for OPU mode in direct_IO.
>>
>> But the new address couldn't be assigned to @map->m_pblk correctly.
>>
>> This patch fix it.
> Sorry to introduce this bug...
>
> It needs to Cc stable kernel mailing list and add 'Fixes' tag line.

I have checked the stable kernel branch and it hasn't merged the previous patch yet.

Shall we still need to cc stable kernel mailing list and add 'Fixes' tag line?

Thanks,

Jia Zhu

>> Signed-off-by: Jia Zhu <zhujia13@huawei.com>
> Reviewed-by: Chao Yu <yuchao0@huawei.com>
>
> Thanks,
>
>> ---
>>  fs/f2fs/data.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
>> index 7226300..a3a567a 100644
>> --- a/fs/f2fs/data.c
>> +++ b/fs/f2fs/data.c
>> @@ -1110,8 +1110,10 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map,
>>  		if (test_opt(sbi, LFS) && flag == F2FS_GET_BLOCK_DIO &&
>>  							map->m_may_create) {
>>  			err = __allocate_data_block(&dn, map->m_seg_type);
>> -			if (!err)
>> +			if (!err) {
>> +				blkaddr = dn.data_blkaddr;
>>  				set_inode_flag(inode, FI_APPEND_WRITE);
>> +			}
>>  		}
>>  	} else {
>>  		if (create) {
>>
>
> .
>

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

* Re: [PATCH] f2fs: fix to update new block address correctly for OPU
  2018-11-26  3:48   ` Zhujia (Euler)
@ 2018-11-26  7:08     ` Chao Yu
  0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2018-11-26  7:08 UTC (permalink / raw)
  To: Zhujia (Euler), jaegeuk, chao; +Cc: jaizhu.zj, linux-f2fs-devel

Hi Jia,

On 2018/11/26 11:48, Zhujia (Euler) wrote:
> Hi  Chao,
> 
> On 2018/11/26 10:01, Chao Yu wrote:
>> On 2018/11/25 6:17, Jia Zhu wrote:
>>> Previously, we allocated a new block address for OPU mode in direct_IO.
>>>
>>> But the new address couldn't be assigned to @map->m_pblk correctly.
>>>
>>> This patch fix it.
>> Sorry to introduce this bug...
>>
>> It needs to Cc stable kernel mailing list and add 'Fixes' tag line.
> 
> I have checked the stable kernel branch and it hasn't merged the previous patch yet.
> 
> Shall we still need to cc stable kernel mailing list and add 'Fixes' tag line?

Yes, please.

I think it will be useful to track important fixes to troubleshoot user
reported bug in mailing list or bugzilla, in addition, I think it can be
the hint for maintainers of other distribution of linux e.g. redhat, suse..
to backport fixes to their own version of kernel.

Thanks,

> 
> Thanks,
> 
> Jia Zhu
> 
>>> Signed-off-by: Jia Zhu <zhujia13@huawei.com>
>> Reviewed-by: Chao Yu <yuchao0@huawei.com>
>>
>> Thanks,
>>
>>> ---
>>>  fs/f2fs/data.c | 4 +++-
>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
>>> index 7226300..a3a567a 100644
>>> --- a/fs/f2fs/data.c
>>> +++ b/fs/f2fs/data.c
>>> @@ -1110,8 +1110,10 @@ int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map,
>>>  		if (test_opt(sbi, LFS) && flag == F2FS_GET_BLOCK_DIO &&
>>>  							map->m_may_create) {
>>>  			err = __allocate_data_block(&dn, map->m_seg_type);
>>> -			if (!err)
>>> +			if (!err) {
>>> +				blkaddr = dn.data_blkaddr;
>>>  				set_inode_flag(inode, FI_APPEND_WRITE);
>>> +			}
>>>  		}
>>>  	} else {
>>>  		if (create) {
>>>
>>
>> .
>>
> 
> 
> .
> 

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

end of thread, other threads:[~2018-11-26  7:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-24 22:17 [PATCH] f2fs: fix to update new block address correctly for OPU Jia Zhu
2018-11-26  2:01 ` Chao Yu
2018-11-26  3:48   ` Zhujia (Euler)
2018-11-26  7:08     ` Chao Yu

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.