Bug 13330 - VFS module for GlusterFS fails to compile with too few arguments
VFS module for GlusterFS fails to compile with too few arguments
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules
4.8.0
x64 Linux
: P5 normal
: ---
Assigned To: Guenther Deschner
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-14 12:42 UTC by Anoop C S
Modified: 2018-04-04 14:05 UTC (History)
1 user (show)

See Also:


Attachments
test-patch (3.86 KB, patch)
2018-04-04 14:05 UTC, Anoop C S
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anoop C S 2018-03-14 12:42:22 UTC
Following errors are seen when Samba's VFS module for GlusterFS is compiled against glusterfs api:

../source3/modules/vfs_glusterfs.c: In function ‘vfs_gluster_pread’:
../source3/modules/vfs_glusterfs.c:605:9: error: too few arguments to function ‘glfs_pread’
  return glfs_pread(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle, fsp), data, n, offset, 0);
         ^~~~~~~~~~
In file included from ../source3/modules/vfs_glusterfs.c:41:0:
/usr/local/include/glusterfs/api/glfs.h:538:9: note: declared here
 ssize_t glfs_pread (glfs_fd_t *fd, void *buf, size_t count, off_t offset,
         ^~~~~~~~~~
../source3/modules/vfs_glusterfs.c: In function ‘vfs_gluster_pread_send’:
../source3/modules/vfs_glusterfs.c:814:31: warning: passing argument 6 of ‘glfs_pread_async’ from incompatible pointer type [-Wincompatible-pointer-types]
     fsp), data, n, offset, 0, aio_glusterfs_done,
                               ^~~~~~~~~~~~~~~~~~
In file included from ../source3/modules/vfs_glusterfs.c:41:0:
/usr/local/include/glusterfs/api/glfs.h:545:5: note: expected ‘glfs_io_cbk {aka void (*)(struct glfs_fd *, long int,  struct stat *, struct stat *, void *)}’ but argument is of type ‘void (*)(glfs_fd_t *, ssize_t,  void *) {aka void (*)(struct glfs_fd *, long int,  void *)}’
 int glfs_pread_async (glfs_fd_t *fd, void *buf, size_t count, off_t offset,
     ^~~~~~~~~~~~~~~~
../source3/modules/vfs_glusterfs.c: In function ‘vfs_gluster_pwrite_send’:
../source3/modules/vfs_glusterfs.c:850:31: warning: passing argument 6 of ‘glfs_pwrite_async’ from incompatible pointer type [-Wincompatible-pointer-types]
     fsp), data, n, offset, 0, aio_glusterfs_done,
                               ^~~~~~~~~~~~~~~~~~
In file included from ../source3/modules/vfs_glusterfs.c:41:0:
/usr/local/include/glusterfs/api/glfs.h:548:5: note: expected ‘glfs_io_cbk {aka void (*)(struct glfs_fd *, long int,  struct stat *, struct stat *, void *)}’ but argument is of type ‘void (*)(glfs_fd_t *, ssize_t,  void *) {aka void (*)(struct glfs_fd *, long int,  void *)}’
 int glfs_pwrite_async (glfs_fd_t *fd, const void *buf, int count, off_t offset,
     ^~~~~~~~~~~~~~~~~
../source3/modules/vfs_glusterfs.c: In function ‘vfs_gluster_pwrite’:
../source3/modules/vfs_glusterfs.c:900:9: error: too few arguments to function ‘glfs_pwrite’
  return glfs_pwrite(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle, fsp), data, n, offset, 0);
         ^~~~~~~~~~~
In file included from ../source3/modules/vfs_glusterfs.c:41:0:
/usr/local/include/glusterfs/api/glfs.h:541:9: note: declared here
 ssize_t glfs_pwrite (glfs_fd_t *fd, const void *buf, size_t count,
         ^~~~~~~~~~~
../source3/modules/vfs_glusterfs.c: In function ‘vfs_gluster_fsync’:
../source3/modules/vfs_glusterfs.c:937:9: error: too few arguments to function ‘glfs_fsync’
  return glfs_fsync(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle, fsp));
         ^~~~~~~~~~
In file included from ../source3/modules/vfs_glusterfs.c:41:0:
/usr/local/include/glusterfs/api/glfs.h:590:5: note: declared here
 int glfs_fsync (glfs_fd_t *fd, struct stat *prestat,
     ^~~~~~~~~~
../source3/modules/vfs_glusterfs.c: In function ‘vfs_gluster_fsync_send’:
../source3/modules/vfs_glusterfs.c:964:11: warning: passing argument 2 of ‘glfs_fsync_async’ from incompatible pointer type [-Wincompatible-pointer-types]
     fsp), aio_glusterfs_done, state);
           ^~~~~~~~~~~~~~~~~~
In file included from ../source3/modules/vfs_glusterfs.c:41:0:
/usr/local/include/glusterfs/api/glfs.h:593:5: note: expected ‘glfs_io_cbk {aka void (*)(struct glfs_fd *, long int,  struct stat *, struct stat *, void *)}’ but argument is of type ‘void (*)(glfs_fd_t *, ssize_t,  void *) {aka void (*)(struct glfs_fd *, long int,  void *)}’
 int glfs_fsync_async (glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW
     ^~~~~~~~~~~~~~~~
../source3/modules/vfs_glusterfs.c: In function ‘vfs_gluster_ftruncate’:
../source3/modules/vfs_glusterfs.c:1147:9: error: too few arguments to function ‘glfs_ftruncate’
  return glfs_ftruncate(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle, fsp), offset);
         ^~~~~~~~~~~~~~
In file included from ../source3/modules/vfs_glusterfs.c:41:0:
/usr/local/include/glusterfs/api/glfs.h:576:5: note: declared here
 int glfs_ftruncate (glfs_fd_t *fd, off_t length, struct stat *prestat,
     ^~~~~~~~~~~~~~
Waf: Leaving directory `/root/samba.git/bin'
Build failed:  -> task failed (err #1): 
	{task: cc vfs_glusterfs.c -> vfs_glusterfs_89.o}
make: *** [Makefile:8: all] Error 1

source code HEAD
----------------
GlusterFS master @ a96c7e748fccfa796a712b6aac92206212915cdc
Samba master @ 7f625f9b27b229f74a88dfe6d86fadd060c47160

Additional note:
See below for recent commits from GlusterFS which changed signature for some APIs used in vfs_glusterfs:

http://git.gluster.org/cgit/glusterfs.git/commit/?id=d01f7244e9d9f7e3ef84e0ba7b48ef1b1b09d809

http://git.gluster.org/cgit/glusterfs.git/commit/?id=09943beb499617212f2985ca8ea9ecd1ed1b470e

http://git.gluster.org/cgit/glusterfs.git/commit/?id=248152767b0599986bbb6bb35fc27197f6be6964

http://git.gluster.org/cgit/glusterfs.git/commit/?id=384562b294e9a7847403961e878a4daa0fff33eb
Comment 1 Anoop C S 2018-04-04 14:02:29 UTC
(In reply to Anoop C S from comment #0)
The signature changes from GlusterFS API are incomplete as of now. Waiting for those changes to stabilize for the upcoming major version..

For the time being the attached patch works.
Comment 2 Anoop C S 2018-04-04 14:05:04 UTC
Created attachment 14102 [details]
test-patch