[Virtio-fs] [PATCH v3] virtiofsd: Prevent multiply running with same vhost_user_socket

Dr. David Alan Gilbert dgilbert at redhat.com
Tue Aug 20 19:05:20 UTC 2019


* Stefan Hajnoczi (stefanha at redhat.com) wrote:
> On Tue, Aug 13, 2019 at 04:06:45PM -0400, Masayoshi Mizuma wrote:
> 
> Two minor comments below.  They can be squashed in when merging this
> patch.
> 
> If users find it problematic that pid files are never deleted we could
> make this feature optional with --pidfile=PATH.  But I think we can
> merge this patch for now and see if anyone encounters issues before the
> next virtio-fs release.
> 
> Reviewed-by: Stefan Hajnoczi <stefanha at redhat.com>
> 
> > +static int fv_socket_lock(struct fuse_session *se)
> > +{
> > +        char *dir, *sk_name;
> > +        Error *local_err = NULL;
> > +        int ret = -1;
> > +
> > +        dir = qemu_get_local_state_pathname("run/virtiofsd");
> > +
> > +        if (g_mkdir_with_parents(dir, S_IRWXU) < -1) {
> > +                fuse_err("%s: Failed to create directory %s: %s",
> > +                        __func__, dir, strerror(errno));
> 
> Missing g_free(dir).
> 
> > @@ -876,6 +916,17 @@ static int fv_create_listen_socket(struct fuse_session *se)
> >                  return -1;
> >          }
> >  
> > +        if (!strlen(se->vu_socket_path)) {
> > +                fuse_err("Socket path is NULL\n");
> 
> s/NULL/empty/


Thanks; applied with those changes, plus also I found I had
to move the #include of osdep.h and error.h to the top of the include
list to avoid glib compilation errors.

Dave

> _______________________________________________
> Virtio-fs mailing list
> Virtio-fs at redhat.com
> https://www.redhat.com/mailman/listinfo/virtio-fs

--
Dr. David Alan Gilbert / dgilbert at redhat.com / Manchester, UK




More information about the Virtio-fs mailing list