[Virtio-fs] [PATCH] virtiofs: fix return value of iomap_begin_upgrade_mapping
piaojun
piaojun at huawei.com
Wed Aug 21 06:19:48 UTC 2019
On 2019/8/21 14:17, Eryu Guan wrote:
> On Wed, Aug 21, 2019 at 02:10:38PM +0800, Liu Bo wrote:
>> Set ret = 0 if everything runs fine.
>>
>> Signed-off-by: Liu Bo <bo.liu at linux.alibaba.com>
>
> FYI, this fixes generic/344 failure.
>
>> ---
>> fs/fuse/file.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
>> index eb7543a..d3c5e45 100644
>> --- a/fs/fuse/file.c
>> +++ b/fs/fuse/file.c
>> @@ -1985,6 +1985,7 @@ static int iomap_begin_upgrade_mapping(struct inode *inode, loff_t pos,
>>
>> out_fill_iomap:
>> fuse_fill_iomap(inode, pos, length, iomap, dmap, flags);
>> + ret = 0;
>
> I'd prefer setting ret in the if (dmap->writable) case, which seems more
> clear to me. i.e.
>
> if (dmap->writable) {
> ret = 0;
> goto out_fill_iomap;
> }
Agreed, and feel free to add:
Reviewed-by: Jun Piao <piaojun at huawei.com>
Jun
More information about the Virtio-fs
mailing list