[PATCH] Fix compilation error with vfs_glusterfs

Anoop C S anoopcs at cryptolab.net
Wed Jan 23 03:54:50 UTC 2019


On Wed, 2019-01-23 at 11:58 +1100, Amitay Isaacs wrote:
> Hi Anoop,
> 
> On Wed, Jan 23, 2019 at 4:03 AM Anoop C S via samba-technical
> <samba-technical at lists.samba.org> wrote:
> > On Tue, 2018-03-20 at 16:35 +0530, Anoop C S wrote:
> > > On Tue, 2018-03-20 at 10:23 +0100, Stefan Metzmacher wrote:
> > > > Hi Anoop,
> > > > 
> > > > > Please see the attached patch which fixes errors reported via
> > > > > https://bugzilla.samba.org/show_bug.cgi?id=13330 while
> > > > > compiling
> > > > > Samba
> > > > > with vfs_glusterfs.
> > > > > 
> > > > > Reviews are appreciated.
> > > > 
> > > > And then the build should fail with an older gluster version???
> > > > 
> > > > I think it needs to compile with both versions.
> > > 
> > > Thanks for pointing that out. I think I will have to compile and
> > > check
> > > for the new signature during configure and act accordingly. I
> > > will
> > > come
> > > up with a modified version shortly.
> > 
> > Attaching the modified version as underlying GlusterFS API
> > signatures
> > have been finalized recently.
> > 
> 
> While you are fixing this issue, would you also fix the build problem
> on freebsd?
> 
> [3398/3906] Compiling source3/modules/vfs_glusterfs_fuse.c
> ../../source3/modules/vfs_glusterfs_fuse.c:45:16: error: use of
> undeclared identifier 'ENODATA'
>                 if (errno == ENODATA) {
>                              ^
> 1 error generated.
> 
> As you can see, on freebsd ENODATA is not defined.

Please see the attached patch which adds a generic #ifndef for ENODATA.
I hope this need not be platform specific especially in this particular
context where error returned for getxattr() is validated.

I have also added check for ENOATTR considering platforms which
directly return ENOATTR for getxattr() in the absence of an extended
attribute. ENOATTR should be always defined based on the following
#ifndef from source3/includes/includes.h

...
#ifndef ENOATTR
#if defined(ENODATA)
#define ENOATTR ENODATA
#else
#define ENOATTR ENOENT
#endif
#endif
...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ENODATA-ENOATTR.patch
Type: text/x-patch
Size: 3253 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190123/6aa5921c/ENODATA-ENOATTR.bin>


More information about the samba-technical mailing list