All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Peng Tao <tao.peng@linux.alibaba.com>
Cc: virtio-fs@redhat.com, Catherine Ho <catherine.hecx@gmail.com>
Subject: Re: [Virtio-fs] [PATCH] virtiofsd: fix double fuse_mbuf_iter_advance when do_removemapping
Date: Thu, 5 Dec 2019 10:41:07 +0000	[thread overview]
Message-ID: <20191205104107.GD2824@work-vm> (raw)
In-Reply-To: <dae2e70f-099d-bcfc-d3b4-8fb1b9491955@linux.alibaba.com>

* Peng Tao (tao.peng@linux.alibaba.com) wrote:
> 
> 
> On 2019/12/5 17:34, Catherine Ho wrote:
> > Hi Peng
> > 
> > On Thu, 5 Dec 2019 at 17:19, Peng Tao <tao.peng@linux.alibaba.com> wrote:
> > > 
> > > On 2019/12/5 17:01, Catherine Ho wrote:
> > > > Commit 8e92b1fc98f7 ("DAX: virtiofsd: make FUSE_REMOVEMAPPING support
> > > > multiple entries") forgot to remove one fuse_mbuf_iter_advance in
> > > > do_removemapping.
> > > No, we do need to advance twice. One for fuse_removemapping_in, another
> > > for an array of fuse_removemapping_one.
> > > 
> > But seems it advances for 3 times. What I mean is the 2nd advance of *one*
> > is pointless.
> > Please see [1] [2]
> > [1]https://gitlab.com/virtio-fs/qemu/blob/virtio-fs-dev/contrib/virtiofsd/fuse_lowlevel.c#L1888
> > [2]https://gitlab.com/virtio-fs/qemu/blob/virtio-fs-dev/contrib/virtiofsd/fuse_lowlevel.c#L1896
> > 
> oops, that does look like a merge hunk. I don't have it in my local branch.
> After pulling the latest code I can see it too. And there was a branch reset
> at some point.
> 
> From https://gitlab.com/virtio-fs/qemu
>  + 42db960...5a356e6 virtio-fs-dev -> virtiofs/virtio-fs-dev  (forced
> update)
> 
> Now your patch looks good to me. Thanks!

That's probably my screwup sometime during a rebase.

Catherine: Thanks; I'll find the right place to merge your fix in.

Dave

> Cheers,
> Tao
> > Best Regards
> > Catherine
> > > > 
> > > > Without this patch, virtiofsd will report:
> > > > [ID: 00000123] do_removemapping: invalid in, expected 1 * 16, has 60 - 60
> > > > [ID: 00000123]    unique: 232, error: -22 (Invalid argument), outsize: 16
> > > > 
> > > What kernel version are you using? It appears that the remove mapping
> > > request does not container a proper fuse_removemapping_one struct.
> > > 
> > > > Fixes: 8e92b1fc98f7 ("DAX: virtiofsd: make FUSE_REMOVEMAPPING support multiple entries")
> > > > Cc: Peng Tao <tao.peng@linux.alibaba.com>
> > > > Signed-off-by: Catherine Ho <catherine.hecx@gmail.com>
> Reviewed-by: Peng Tao <tao.peng@linux.alibaba.com>
> 
> > > > ---
> > > >    contrib/virtiofsd/fuse_lowlevel.c | 8 --------
> > > >    1 file changed, 8 deletions(-)
> > > > 
> > > > diff --git a/contrib/virtiofsd/fuse_lowlevel.c b/contrib/virtiofsd/fuse_lowlevel.c
> > > > index bde66c72c3..752e7d97b9 100644
> > > > --- a/contrib/virtiofsd/fuse_lowlevel.c
> > > > +++ b/contrib/virtiofsd/fuse_lowlevel.c
> > > > @@ -1894,14 +1894,6 @@ static void do_removemapping(fuse_req_t req, fuse_ino_t nodeid,
> > > >                return;
> > > >        }
> > > > 
> > > > -     one = fuse_mbuf_iter_advance(iter, sizeof(*one));
> > > > -     if (!one) {
> > > > -             fuse_log(FUSE_LOG_ERR, "do_removemapping: invalid in, expected %d * %ld, has %ld - %ld\n",
> > > > -                      arg->count, sizeof(*one), iter->size, iter->pos);
> > > > -             fuse_reply_err(req, EINVAL);
> > > > -             return;
> > > > -     }
> > > > -
> > > >        if (req->se->op.removemapping)
> > > >                req->se->op.removemapping(req, req->se, nodeid, arg->count, one);
> > > The patch is wrong itself, as `one` is not assigned here.
> > > 
> 
> -- 
> Into something rich and strange.
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


      reply	other threads:[~2019-12-05 10:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05  9:01 [Virtio-fs] [PATCH] virtiofsd: fix double fuse_mbuf_iter_advance when do_removemapping Catherine Ho
2019-12-05  9:19 ` Peng Tao
2019-12-05  9:34   ` Catherine Ho
2019-12-05 10:04     ` Peng Tao
2019-12-05 10:41       ` Dr. David Alan Gilbert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191205104107.GD2824@work-vm \
    --to=dgilbert@redhat.com \
    --cc=catherine.hecx@gmail.com \
    --cc=tao.peng@linux.alibaba.com \
    --cc=virtio-fs@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.