diff mbox series

[1/2] virtiofsd: Allow use "-o xattrmap" without "-o xattr"

Message ID 20210414201207.3612432-2-jose.carlos.venegas.munoz@intel.com (mailing list archive)
State New, archived
Headers show
Series virtiofsd: Enable xattr if xattrmap is used | expand

Commit Message

Venegas Munoz, Jose Carlos April 14, 2021, 8:12 p.m. UTC
When -o xattrmap is used, it will not work unless xattr is enabled.

This patch enables xattr when -o xattrmap is used.

Signed-off-by: Carlos Venegas <jose.carlos.venegas.munoz@intel.com>
---
 tools/virtiofsd/passthrough_ll.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Greg Kurz April 16, 2021, 11:05 a.m. UTC | #1
On Wed, 14 Apr 2021 20:12:06 +0000
Carlos Venegas <jose.carlos.venegas.munoz@intel.com> wrote:

> When -o xattrmap is used, it will not work unless xattr is enabled.
> 
> This patch enables xattr when -o xattrmap is used.
> 
> Signed-off-by: Carlos Venegas <jose.carlos.venegas.munoz@intel.com>
> ---
>  tools/virtiofsd/passthrough_ll.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
> index ddaf57305c..2337ea5a58 100644
> --- a/tools/virtiofsd/passthrough_ll.c
> +++ b/tools/virtiofsd/passthrough_ll.c
> @@ -3939,6 +3939,7 @@ int main(int argc, char *argv[])
>      }
>  
>      if (lo.xattrmap) {
> +        lo.xattr = 1;
>          parse_xattrmap(&lo);
>      }
>  

This seems reasonable. I'm just wondering if we should also
add an explicit error if the user tries something silly
like -o xattrmap=MAPPING,no_xattr instead of silently
ignoring no_xattr...
Vivek Goyal April 19, 2021, 6:55 p.m. UTC | #2
On Fri, Apr 16, 2021 at 01:05:37PM +0200, Greg Kurz wrote:
> On Wed, 14 Apr 2021 20:12:06 +0000
> Carlos Venegas <jose.carlos.venegas.munoz@intel.com> wrote:
> 
> > When -o xattrmap is used, it will not work unless xattr is enabled.
> > 
> > This patch enables xattr when -o xattrmap is used.
> > 
> > Signed-off-by: Carlos Venegas <jose.carlos.venegas.munoz@intel.com>
> > ---
> >  tools/virtiofsd/passthrough_ll.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
> > index ddaf57305c..2337ea5a58 100644
> > --- a/tools/virtiofsd/passthrough_ll.c
> > +++ b/tools/virtiofsd/passthrough_ll.c
> > @@ -3939,6 +3939,7 @@ int main(int argc, char *argv[])
> >      }
> >  
> >      if (lo.xattrmap) {
> > +        lo.xattr = 1;
> >          parse_xattrmap(&lo);
> >      }
> >  
> 
> This seems reasonable. I'm just wondering if we should also
> add an explicit error if the user tries something silly
> like -o xattrmap=MAPPING,no_xattr instead of silently
> ignoring no_xattr...

That's a good point. Will be nice to error out if user provides
conflicting options.

Vivek
Dr. David Alan Gilbert May 6, 2021, 10 a.m. UTC | #3
* Greg Kurz (groug@kaod.org) wrote:
> On Wed, 14 Apr 2021 20:12:06 +0000
> Carlos Venegas <jose.carlos.venegas.munoz@intel.com> wrote:
> 
> > When -o xattrmap is used, it will not work unless xattr is enabled.
> > 
> > This patch enables xattr when -o xattrmap is used.
> > 
> > Signed-off-by: Carlos Venegas <jose.carlos.venegas.munoz@intel.com>
> > ---
> >  tools/virtiofsd/passthrough_ll.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
> > index ddaf57305c..2337ea5a58 100644
> > --- a/tools/virtiofsd/passthrough_ll.c
> > +++ b/tools/virtiofsd/passthrough_ll.c
> > @@ -3939,6 +3939,7 @@ int main(int argc, char *argv[])
> >      }
> >  
> >      if (lo.xattrmap) {
> > +        lo.xattr = 1;
> >          parse_xattrmap(&lo);
> >      }
> >  
> 
> This seems reasonable. I'm just wondering if we should also
> add an explicit error if the user tries something silly
> like -o xattrmap=MAPPING,no_xattr instead of silently
> ignoring no_xattr...

That would be a nice addition, although I'll take this set is for now.

Dave

> _______________________________________________
> Virtio-fs mailing list
> Virtio-fs@redhat.com
> https://listman.redhat.com/mailman/listinfo/virtio-fs
diff mbox series

Patch

diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index ddaf57305c..2337ea5a58 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -3939,6 +3939,7 @@  int main(int argc, char *argv[])
     }
 
     if (lo.xattrmap) {
+        lo.xattr = 1;
         parse_xattrmap(&lo);
     }