[Virtio-fs] [PATCH] virtiofs: fix return value of iomap_begin_upgrade_mapping
Vivek Goyal
vgoyal at redhat.com
Fri Aug 23 12:52:23 UTC 2019
On Fri, Aug 23, 2019 at 08:22:20AM +0800, piaojun wrote:
>
>
> On 2019/8/23 4:16, Vivek Goyal 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>
> >> ---
> >> 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;
> >
> > Thanks. I initialized ret = 0 in the beginning itself now.
>
> This probably would not work as ret will be set -EIO again immediately.
I changed that ret = -EIO as well. I now set it only when error happens.
Vivek
More information about the Virtio-fs
mailing list