From ff12c4a83bb897501f6e10c1bfe3a69f3dc6cdb9 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Wed, 1 Jul 2015 08:28:07 +0530 Subject: 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 [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 Reviewed-by: Kaleb KEITHLEY CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System --- xlators/mount/fuse/src/fuse-bridge.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'xlators') 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:" -- cgit