diff options
author | Ravishankar N <ravishankar@redhat.com> | 2015-07-01 08:28:07 +0530 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2016-02-06 21:56:46 -0800 |
commit | ff12c4a83bb897501f6e10c1bfe3a69f3dc6cdb9 (patch) | |
tree | dfb72ae9191a62192c41b86a6aafe91826b29109 /xlators/mount/fuse/src | |
parent | c7d2037b8c6293663280a759a2e447d5aef130bd (diff) |
fuse: update fuse_kernel.h to version 23
The following changes were made upstream:
- add FUSE_WRITEBACK_CACHE
- add time_gran to fuse_init_out
- add reserved space to fuse_init_out
- add FATTR_CTIME
- add ctime and ctimensec to fuse_setattr_in
- add FUSE_RENAME2 request
- add FUSE_NO_OPEN_SUPPORT flag
Including these changes will make it easier to backport support for
lseek().
Because the fuse_init_out structure changed its size, older versions of
FUSE would fail initializing. When an older version of FUSE is detected,
the fuse_init_out structure is reduced to the previous size. This is
harmless, as the attributes that are not passed, are not used for
earlier versions anyway.
BUG: 1220173
Change-Id: I58c74e161638b2d4ce12fc91a206fdc1b96de14d
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
[ndevos: splitted from http://review.gluster.org/11474
old version fuse_init_out size correction]
Reviewed-on: http://review.gluster.org/11537
Smoke: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/mount/fuse/src')
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index dd8ac1b1c74..dabef3598cc 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -3923,6 +3923,7 @@ fuse_init (xlator_t *this, fuse_in_header_t *finh, void *msg) struct fuse_init_in *fini = msg; struct fuse_init_out fino = {0,}; fuse_private_t *priv = NULL; + size_t size = 0; int ret = 0; #if FUSE_KERNEL_MINOR_VERSION >= 9 pthread_t messenger; @@ -4060,7 +4061,15 @@ fuse_init (xlator_t *this, fuse_in_header_t *finh, void *msg) if (fini->flags & FUSE_ASYNC_DIO) fino.flags |= FUSE_ASYNC_DIO; #endif - ret = send_fuse_obj (this, finh, &fino); + /* FUSE 7.23 and newer added attributes to the fuse_init_out struct */ + if (fini->minor > 22) { + size = sizeof (fino); + } else { + /* reduce the size, chop off unused attributes from &fino */ + size = FUSE_COMPAT_22_INIT_OUT_SIZE; + } + + ret = send_fuse_data (this, finh, &fino, size); if (ret == 0) gf_log ("glusterfs-fuse", GF_LOG_INFO, "FUSE inited with protocol versions:" |