mirror of
https://github.com/samba-team/samba.git
synced 2025-09-18 09:44:19 +03:00
s3-vfs_glusterfs: always disable write-behind translator
The "pass-through" option has now been merged upstream as of: https://github.com/gluster/glusterfs/pull/1640 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14486 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Pair-Programmed-With: Anoop C S <anoopcs@samba.org> Pair-Programmed-With: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Nov 4 22:53:49 UTC 2020 on sn-devel-184
This commit is contained in:
committed by
Jeremy Allison
parent
80ff5a37c7
commit
a51cda69ec
@@ -363,6 +363,7 @@ static int vfs_gluster_connect(struct vfs_handle_struct *handle,
|
|||||||
glfs_t *fs = NULL;
|
glfs_t *fs = NULL;
|
||||||
TALLOC_CTX *tmp_ctx;
|
TALLOC_CTX *tmp_ctx;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
bool write_behind_pass_through_set = false;
|
||||||
|
|
||||||
tmp_ctx = talloc_new(NULL);
|
tmp_ctx = talloc_new(NULL);
|
||||||
if (tmp_ctx == NULL) {
|
if (tmp_ctx == NULL) {
|
||||||
@@ -435,6 +436,17 @@ static int vfs_gluster_connect(struct vfs_handle_struct *handle,
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_GFAPI_VER_7_9
|
||||||
|
ret = glfs_set_xlator_option(fs, "*-write-behind", "pass-through",
|
||||||
|
"true");
|
||||||
|
if (ret < 0) {
|
||||||
|
DBG_ERR("%s: Failed to set xlator option: pass-through\n",
|
||||||
|
volume);
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
write_behind_pass_through_set = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
ret = glfs_set_logging(fs, logfile, loglevel);
|
ret = glfs_set_logging(fs, logfile, loglevel);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
DEBUG(0, ("%s: Failed to set logfile %s loglevel %d\n",
|
DEBUG(0, ("%s: Failed to set logfile %s loglevel %d\n",
|
||||||
@@ -449,9 +461,11 @@ static int vfs_gluster_connect(struct vfs_handle_struct *handle,
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = check_for_write_behind_translator(tmp_ctx, fs, volume);
|
if (!write_behind_pass_through_set) {
|
||||||
if (ret < 0) {
|
ret = check_for_write_behind_translator(tmp_ctx, fs, volume);
|
||||||
goto done;
|
if (ret < 0) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = glfs_set_preopened(volume, handle->conn->connectpath, fs);
|
ret = glfs_set_preopened(volume, handle->conn->connectpath, fs);
|
||||||
|
@@ -1766,6 +1766,9 @@ main() {
|
|||||||
conf.CHECK_CFG(package='glusterfs-api', args='"glusterfs-api >= 7.6" --cflags --libs',
|
conf.CHECK_CFG(package='glusterfs-api', args='"glusterfs-api >= 7.6" --cflags --libs',
|
||||||
msg='Checking for glusterfs-api >= 7.6',
|
msg='Checking for glusterfs-api >= 7.6',
|
||||||
uselib_store="GFAPI_VER_7_6")
|
uselib_store="GFAPI_VER_7_6")
|
||||||
|
conf.CHECK_CFG(package='glusterfs-api', args='"glusterfs-api >= 7.9" --cflags --libs',
|
||||||
|
msg='Checking for glusterfs-api >= 7.9',
|
||||||
|
uselib_store="GFAPI_VER_7_9")
|
||||||
else:
|
else:
|
||||||
conf.SET_TARGET_TYPE('gfapi', 'EMPTY')
|
conf.SET_TARGET_TYPE('gfapi', 'EMPTY')
|
||||||
conf.undefine('HAVE_GLUSTERFS')
|
conf.undefine('HAVE_GLUSTERFS')
|
||||||
|
Reference in New Issue
Block a user