Jaegeuk,

On 5/26/17 17:16, Chao Yu wrote:
> On 2017/5/26 16:04, Damien Le Moal wrote:
>> clear_prefree_segments() issues small discards after discarding full
>> segments. These small discards may not be section aligned, so not zone
>> aligned on a zoned block device, causing __f2fs_iissue_discard_zone() to 
>> fail.
>> Fix this by not issuing small discards for a volume mounted with the BLKZONED
>> feature enabled.
>>
>> Signed-off-by: Damien Le Moal <[email protected]>
> 
> This version looks good to me.
> 
> Reviewed-by: Chao Yu <[email protected]>
> 
> Thanks,
> 
>> ---
>>  fs/f2fs/segment.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>> index 9684585..1279650 100644
>> --- a/fs/f2fs/segment.c
>> +++ b/fs/f2fs/segment.c
>> @@ -1322,7 +1322,8 @@ void clear_prefree_segments(struct f2fs_sb_info *sbi, 
>> struct cp_control *cpc)
>>                                      sbi->blocks_per_seg, cur_pos);
>>                      len = next_pos - cur_pos;
>>  
>> -                    if (force && len < cpc->trim_minlen)
>> +                    if (f2fs_sb_mounted_blkzoned(sbi->sb) ||
>> +                        (force && len < cpc->trim_minlen))
>>                              goto skip;
>>  
>>                      f2fs_issue_discard(sbi, entry->start_blkaddr + cur_pos,
>>

It looks like this patch was not included in 4.12, so we are still
getting a lot of "unaligned discard" on zoned block devices.
Is there a problem with this patch or was that an oversight ?

Please consider adding this patch.

Best regards.

-- 
Damien Le Moal,
Western Digital

------------------------------------------------------------------------------
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