Hi Jaegeuk,
On 2017/3/2 3:32, Jaegeuk Kim wrote:
> On 03/01, Chao Yu wrote:
>> On 2017/2/28 20:32, Yunlei He wrote:
>>> This patch fix a error return value in truncate_partial_data_page
>>>
>>> Signed-off-by: Yunlei He <heyun...@huawei.com>
>>> ---
>>>  fs/f2fs/file.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
>>> index c6ca00c..c186d75 100644
>>> --- a/fs/f2fs/file.c
>>> +++ b/fs/f2fs/file.c
>>> @@ -529,7 +529,7 @@ static int truncate_partial_data_page(struct inode 
>>> *inode, u64 from,
>>>
>>>     page = get_lock_data_page(inode, index, true);
>>>     if (IS_ERR(page))
>>> -           return 0;
>>> +           return page;
>>
>> return PTR_ERR(page);
>
> Do we need this?

Yes, you are right, we need this if file has holes.

Thanks.

>
> return PTR_ERR(page) == -ENOENT ? 0 : PTR_ERR(page);
>
> Thanks,
>
>>
>> Thanks,
>>
>>>  truncate_out:
>>>     f2fs_wait_on_page_writeback(page, DATA, true);
>>>     zero_user(page, offset, PAGE_SIZE - offset);
>>>
>
> .
>


------------------------------------------------------------------------------
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
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to