diff -Nru glusterfs-5.5/api/examples/Makefile.in glusterfs-6.3/api/examples/Makefile.in --- glusterfs-5.5/api/examples/Makefile.in 2019-03-15 13:23:46.087478997 +0000 +++ glusterfs-6.3/api/examples/Makefile.in 2019-06-11 13:15:01.873128945 +0000 @@ -174,6 +174,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_GNFS = @BUILD_GNFS@ BUILD_PYTHON_SITE_PACKAGES = @BUILD_PYTHON_SITE_PACKAGES@ BUILD_PYTHON_SITE_PACKAGES_EXPANDED = @BUILD_PYTHON_SITE_PACKAGES_EXPANDED@ CC = @CC@ @@ -214,9 +215,6 @@ GF_NO_UNDEFINED = @GF_NO_UNDEFINED@ GF_XLATOR_DEFAULT_LDFLAGS = @GF_XLATOR_DEFAULT_LDFLAGS@ GF_XLATOR_LDFLAGS = @GF_XLATOR_LDFLAGS@ -GLUPY_SUBDIR = @GLUPY_SUBDIR@ -GLUPY_SUBDIR_MAKEFILE = @GLUPY_SUBDIR_MAKEFILE@ -GLUPY_SUBDIR_SRC_MAKEFILE = @GLUPY_SUBDIR_SRC_MAKEFILE@ GLUSTERD_VOLFILE = @GLUSTERD_VOLFILE@ GLUSTERD_WORKDIR = @GLUSTERD_WORKDIR@ GLUSTERFSD_MISCDIR = @GLUSTERFSD_MISCDIR@ @@ -243,7 +241,6 @@ LIBAIO = @LIBAIO@ LIBGFCHANGELOG_LT_VERSION = @LIBGFCHANGELOG_LT_VERSION@ LIBGFCHANGELOG_VERSION = @LIBGFCHANGELOG_VERSION@ -LIBGFDB_VERSION = @LIBGFDB_VERSION@ LIBGFRPC_LT_VERSION = @LIBGFRPC_LT_VERSION@ LIBGFXDR_LT_VERSION = @LIBGFXDR_LT_VERSION@ LIBGLUSTERFS_LT_VERSION = @LIBGLUSTERFS_LT_VERSION@ @@ -297,8 +294,6 @@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_LONG_LONG = @SIZEOF_LONG_LONG@ SIZEOF_SHORT = @SIZEOF_SHORT@ -SQLITE_CFLAGS = @SQLITE_CFLAGS@ -SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ SYNCDAEMON_COMPILE = @SYNCDAEMON_COMPILE@ SYNCDAEMON_SUBDIR = @SYNCDAEMON_SUBDIR@ diff -Nru glusterfs-5.5/api/Makefile.in glusterfs-6.3/api/Makefile.in --- glusterfs-5.5/api/Makefile.in 2019-03-15 13:23:46.026478860 +0000 +++ glusterfs-6.3/api/Makefile.in 2019-06-11 13:15:01.817128777 +0000 @@ -182,6 +182,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_GNFS = @BUILD_GNFS@ BUILD_PYTHON_SITE_PACKAGES = @BUILD_PYTHON_SITE_PACKAGES@ BUILD_PYTHON_SITE_PACKAGES_EXPANDED = @BUILD_PYTHON_SITE_PACKAGES_EXPANDED@ CC = @CC@ @@ -222,9 +223,6 @@ GF_NO_UNDEFINED = @GF_NO_UNDEFINED@ GF_XLATOR_DEFAULT_LDFLAGS = @GF_XLATOR_DEFAULT_LDFLAGS@ GF_XLATOR_LDFLAGS = @GF_XLATOR_LDFLAGS@ -GLUPY_SUBDIR = @GLUPY_SUBDIR@ -GLUPY_SUBDIR_MAKEFILE = @GLUPY_SUBDIR_MAKEFILE@ -GLUPY_SUBDIR_SRC_MAKEFILE = @GLUPY_SUBDIR_SRC_MAKEFILE@ GLUSTERD_VOLFILE = @GLUSTERD_VOLFILE@ GLUSTERD_WORKDIR = @GLUSTERD_WORKDIR@ GLUSTERFSD_MISCDIR = @GLUSTERFSD_MISCDIR@ @@ -251,7 +249,6 @@ LIBAIO = @LIBAIO@ LIBGFCHANGELOG_LT_VERSION = @LIBGFCHANGELOG_LT_VERSION@ LIBGFCHANGELOG_VERSION = @LIBGFCHANGELOG_VERSION@ -LIBGFDB_VERSION = @LIBGFDB_VERSION@ LIBGFRPC_LT_VERSION = @LIBGFRPC_LT_VERSION@ LIBGFXDR_LT_VERSION = @LIBGFXDR_LT_VERSION@ LIBGLUSTERFS_LT_VERSION = @LIBGLUSTERFS_LT_VERSION@ @@ -305,8 +302,6 @@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_LONG_LONG = @SIZEOF_LONG_LONG@ SIZEOF_SHORT = @SIZEOF_SHORT@ -SQLITE_CFLAGS = @SQLITE_CFLAGS@ -SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ SYNCDAEMON_COMPILE = @SYNCDAEMON_COMPILE@ SYNCDAEMON_SUBDIR = @SYNCDAEMON_SUBDIR@ diff -Nru glusterfs-5.5/api/src/gfapi.aliases glusterfs-6.3/api/src/gfapi.aliases --- glusterfs-5.5/api/src/gfapi.aliases 2019-03-15 13:23:38.361461656 +0000 +++ glusterfs-6.3/api/src/gfapi.aliases 2019-06-11 13:14:55.544110024 +0000 @@ -18,30 +18,24 @@ _pub_glfs_set_xlator_option _glfs_set_xlator_option$GFAPI_3.4.0 _pub_glfs_read _glfs_read$GFAPI_3.4.0 _pub_glfs_write _glfs_write$GFAPI_3.4.0 -_pub_glfs_read_async _glfs_read_async$GFAPI_3.4.0 -_pub_glfs_write_async _glfs_write_async$GFAPI_3.4.0 _pub_glfs_readv _glfs_readv$GFAPI_3.4.0 _pub_glfs_writev _glfs_writev$GFAPI_3.4.0 -_pub_glfs_readv_async _glfs_readv_async$GFAPI_3.4.0 -_pub_glfs_writev_async _glfs_writev_async$GFAPI_3.4.0 -_pub_glfs_pread _glfs_pread$GFAPI_3.4.0 -_pub_glfs_pwrite _glfs_pwrite$GFAPI_3.4.0 -_pub_glfs_pread_async _glfs_pread_async$GFAPI_3.4.0 -_pub_glfs_pwrite_async _glfs_pwrite_async$GFAPI_3.4.0 +_pub_glfs_pread34 _glfs_pread$GFAPI_3.4.0 +_pub_glfs_pwrite34 _glfs_pwrite$GFAPI_3.4.0 +_pub_glfs_pread_async34 _glfs_pread_async$GFAPI_3.4.0 +_pub_glfs_pwrite_async34 _glfs_pwrite_async$GFAPI_3.4.0 _pub_glfs_preadv _glfs_preadv$GFAPI_3.4.0 _pub_glfs_pwritev _glfs_pwritev$GFAPI_3.4.0 -_pub_glfs_preadv_async _glfs_preadv_async$GFAPI_3.4.0 -_pub_glfs_pwritev_async _glfs_pwritev_async$GFAPI_3.4.0 _pub_glfs_lseek _glfs_lseek$GFAPI_3.4.0 -_pub_glfs_ftruncate _glfs_ftruncate$GFAPI_3.4.0 -_pub_glfs_ftruncate_async _glfs_ftruncate_async$GFAPI_3.4.0 +_pub_glfs_ftruncate34 _glfs_ftruncate$GFAPI_3.4.0 +_pub_glfs_ftruncate_async34 _glfs_ftruncate_async$GFAPI_3.4.0 _pub_glfs_lstat _glfs_lstat$GFAPI_3.4.0 _pub_glfs_stat _glfs_stat$GFAPI_3.4.0 _pub_glfs_fstat _glfs_fstat$GFAPI_3.4.0 -_pub_glfs_fsync _glfs_fsync$GFAPI_3.4.0 -_pub_glfs_fsync_async _glfs_fsync_async$GFAPI_3.4.0 -_pub_glfs_fdatasync _glfs_fdatasync$GFAPI_3.4.0 -_pub_glfs_fdatasync_async _glfs_fdatasync_async$GFAPI_3.4.0 +_pub_glfs_fsync34 _glfs_fsync$GFAPI_3.4.0 +_pub_glfs_fsync_async34 _glfs_fsync_async$GFAPI_3.4.0 +_pub_glfs_fdatasync34 _glfs_fdatasync$GFAPI_3.4.0 +_pub_glfs_fdatasync_async34 _glfs_fdatasync_async$GFAPI_3.4.0 _pub_glfs_access _glfs_access$GFAPI_3.4.0 _pub_glfs_symlink _glfs_symlink$GFAPI_3.4.0 _pub_glfs_readlink _glfs_readlink$GFAPI_3.4.0 @@ -112,9 +106,7 @@ _pub_glfs_readdirplus _glfs_readdirplus$GFAPI_3.5.0 _pub_glfs_fallocate _glfs_fallocate$GFAPI_3.5.0 _pub_glfs_discard _glfs_discard$GFAPI_3.5.0 -_pub_glfs_discard_async _glfs_discard_async$GFAPI_3.5.0 _pub_glfs_zerofill _glfs_zerofill$GFAPI_3.5.0 -_pub_glfs_zerofill_async _glfs_zerofill_async$GFAPI_3.5.0 _pub_glfs_caller_specific_init _glfs_caller_specific_init$GFAPI_3.5.0 _pub_glfs_h_setxattrs _glfs_h_setxattrs$GFAPI_3.5.0 @@ -177,3 +169,29 @@ _pub_glfs_h_lease _glfs_h_lease$GFAPI_4.0.0 _pub_glfs_upcall_lease_get_object _glfs_upcall_lease_get_object$GFAPI_4.1.6 _pub_glfs_upcall_lease_get_lease_type _glfs_upcall_lease_get_lease_type$GFAPI_4.1.6 + +_priv_glfs_statx _glfs_statx$GFAPI_6.0 +_priv_glfs_iatt_from_statx _glfs_iatt_from_statx$GFAPI_6.0 +_priv_glfs_setfspid _glfs_setfspid$GFAPI_6.1 + +_pub_glfs_read_async _glfs_read_async$GFAPI_6.0 +_pub_glfs_write_async _glfs_write_async$GFAPI_6.0 +_pub_glfs_readv_async _glfs_readv_async$GFAPI_6.0 +_pub_glfs_writev_async _glfs_writev_async$GFAPI_6.0 +_pub_glfs_pread _glfs_pread$GFAPI_6.0 +_pub_glfs_pwrite _glfs_pwrite$GFAPI_6.0 +_pub_glfs_pread_async _glfs_pread_async$GFAPI_6.0 +_pub_glfs_pwrite_async _glfs_pwrite_async$GFAPI_6.0 +_pub_glfs_preadv_async _glfs_preadv_async$GFAPI_6.0 +_pub_glfs_pwritev_async _glfs_pwritev_async$GFAPI_6.0 +_pub_glfs_fsync _glfs_fsync$GFAPI_6.0 +_pub_glfs_fsync_async _glfs_fsync_async$GFAPI_6.0 +_pub_glfs_fdatasync _glfs_fdatasync$GFAPI_6.0 +_pub_glfs_fdatasync_async _glfs_fdatasync_async$GFAPI_6.0 +_pub_glfs_ftruncate _glfs_ftruncate$GFAPI_6.0 +_pub_glfs_ftruncate_async _glfs_ftruncate_async$GFAPI_6.0 +_pub_glfs_discard_async _glfs_discard_async$GFAPI_6.0 +_pub_glfs_zerofill_async _glfs_zerofill_async$GFAPI_6.0 +_pub_glfs_copy_file_range _glfs_copy_file_range$GFAPI_6.0 +_pub_glfs_fsetattr _glfs_fsetattr$GFAPI_6.0 +_pub_glfs_setattr _glfs_setattr$GFAPI_6.0 diff -Nru glusterfs-5.5/api/src/gfapi.map glusterfs-6.3/api/src/gfapi.map --- glusterfs-5.5/api/src/gfapi.map 2019-03-15 13:23:38.361461656 +0000 +++ glusterfs-6.3/api/src/gfapi.map 2019-06-11 13:14:55.544110024 +0000 @@ -24,25 +24,30 @@ glfs_set_xlator_option; glfs_read; glfs_write; - glfs_read_async; - glfs_write_async; + glfs_read_async; + glfs_write_async; glfs_readv; glfs_writev; - glfs_readv_async; - glfs_writev_async; - glfs_pread_async; - glfs_pwrite_async; + glfs_readv_async; + glfs_writev_async; + glfs_pread; + glfs_pwrite; + glfs_pread_async; + glfs_pwrite_async; glfs_preadv; glfs_pwritev; - glfs_preadv_async; - glfs_pwritev_async; + glfs_preadv_async; + glfs_pwritev_async; glfs_lseek; - glfs_ftruncate_async; + glfs_ftruncate; + glfs_ftruncate_async; glfs_lstat; glfs_stat; glfs_fstat; - glfs_fsync_async; - glfs_fdatasync_async; + glfs_fsync; + glfs_fsync_async; + glfs_fdatasync; + glfs_fdatasync_async; glfs_access; glfs_symlink; glfs_readlink; @@ -82,20 +87,9 @@ glfs_getcwd; glfs_chdir; glfs_fchdir; + glfs_realpath; glfs_posix_lock; glfs_dup; - glfs_pread; - glfs_pwrite; - glfs_pread_async; - glfs_pwrite_async; - glfs_ftruncate; - glfs_ftruncate_async; - glfs_fsync; - glfs_fsync_async; - glfs_fdatasync; - glfs_fdatasync_async; - glfs_realpath; - glfs_h_lookupat; } GFAPI_PRIVATE_3.4.0; GFAPI_3.4.2 { @@ -130,9 +124,9 @@ glfs_readdirplus; glfs_fallocate; glfs_discard; - glfs_discard_async; + glfs_discard_async; glfs_zerofill; - glfs_zerofill_async; + glfs_zerofill_async; glfs_caller_specific_init; glfs_h_setxattrs; } GFAPI_3.4.2; @@ -214,7 +208,7 @@ glfs_xreaddirplus_r; glfs_xreaddirplus_r_get_stat; glfs_xreaddirplus_r_get_object; - glfs_object_copy; + glfs_object_copy; } GFAPI_3.10.7; GFAPI_PRIVATE_3.12.0 { @@ -223,17 +217,17 @@ } GFAPI_3.11.0; GFAPI_3.13.0 { - global: - glfs_upcall_register; - glfs_upcall_unregister; + global: + glfs_upcall_register; + glfs_upcall_unregister; } GFAPI_PRIVATE_3.12.0; GFAPI_4.0.0 { - global: - glfs_setfsleaseid; - glfs_file_lock; - glfs_lease; - glfs_h_lease; + global: + glfs_setfsleaseid; + glfs_file_lock; + glfs_lease; + glfs_h_lease; } GFAPI_3.13.0; GFAPI_4.1.6 { @@ -241,3 +235,39 @@ glfs_upcall_lease_get_object; glfs_upcall_lease_get_lease_type; } GFAPI_4.0.0; + +GFAPI_PRIVATE_6.0 { + global: + glfs_statx; + glfs_iatt_from_statx; +} GFAPI_4.1.6; + +GFAPI_6.0 { + global: + glfs_read_async; + glfs_write_async; + glfs_readv_async; + glfs_writev_async; + glfs_pread; + glfs_pwrite; + glfs_pread_async; + glfs_pwrite_async; + glfs_preadv_async; + glfs_pwritev_async; + glfs_fsync; + glfs_fsync_async; + glfs_fdatasync; + glfs_fdatasync_async; + glfs_ftruncate; + glfs_ftruncate_async; + glfs_discard_async; + glfs_zerofill_async; + glfs_copy_file_range; + glfs_setattr; + glfs_fsetattr; +} GFAPI_PRIVATE_6.0; + +GFAPI_PRIVATE_6.1 { + global: + glfs_setfspid; +} GFAPI_6.0; diff -Nru glusterfs-5.5/api/src/gfapi-messages.h glusterfs-6.3/api/src/gfapi-messages.h --- glusterfs-5.5/api/src/gfapi-messages.h 2019-03-15 13:23:38.361461656 +0000 +++ glusterfs-6.3/api/src/gfapi-messages.h 2019-06-11 13:14:55.543110021 +0000 @@ -11,7 +11,7 @@ #ifndef _GFAPI_MESSAGES_H__ #define _GFAPI_MESSAGES_H__ -#include "glfs-message-id.h" +#include /* To add new message IDs, append new identifiers at the end of the list. * diff -Nru glusterfs-5.5/api/src/glfs.c glusterfs-6.3/api/src/glfs.c --- glusterfs-5.5/api/src/glfs.c 2019-03-15 13:23:38.364461663 +0000 +++ glusterfs-6.3/api/src/glfs.c 2019-06-11 13:14:55.549110039 +0000 @@ -34,17 +34,17 @@ #include #endif -#include "glusterfs.h" -#include "logging.h" -#include "stack.h" -#include "gf-event.h" +#include +#include +#include +#include #include "glfs-mem-types.h" -#include "common-utils.h" -#include "syncop.h" -#include "call-stub.h" -#include "hashfn.h" +#include +#include +#include +#include #include "rpc-clnt.h" -#include "statedump.h" +#include #include "gfapi-messages.h" #include "glfs.h" @@ -197,7 +197,7 @@ master->ctx = fs->ctx; master->private = fs; - master->options = get_new_dict(); + master->options = dict_new(); if (!master->options) goto err; @@ -1231,17 +1231,20 @@ DECLARE_OLD_THIS; - __GLFS_ENTRY_VALIDATE_FS(fs, invalid_fs); + if (!fs) { + errno = EINVAL; + goto invalid_fs; + } ctx = fs->ctx; if (!ctx) { goto free_fs; } + THIS = fs->ctx->master; + if (ctx->mgmt) { rpc_clnt_disable(ctx->mgmt); - rpc_clnt_unref(ctx->mgmt); - ctx->mgmt = NULL; } call_pool = fs->ctx->pool; @@ -1359,6 +1362,13 @@ ret = -1; } + /* Avoid dispatching events to mgmt after freed, + * unreference mgmt after the event_dispatch_destroy */ + if (ctx->mgmt) { + rpc_clnt_unref(ctx->mgmt); + ctx->mgmt = NULL; + } + /* log infra has to be brought down before destroying * timer registry, as logging uses timer infra */ @@ -1451,6 +1461,21 @@ GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_ipc, 3.12.0); +int +priv_glfs_setfspid(struct glfs *fs, pid_t pid) +{ + cmd_args_t *cmd_args = NULL; + int ret = 0; + + cmd_args = &fs->ctx->cmd_args; + cmd_args->client_pid = pid; + cmd_args->client_pid_set = 1; + ret = syncopctx_setfspid(&pid); + + return ret; +} +GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_setfspid, 6.1); + void pub_glfs_free(void *ptr) { @@ -1539,7 +1564,7 @@ struct glfs_object * pub_glfs_upcall_lease_get_object(struct glfs_upcall_lease *arg) { - return arg->object; + return arg->object; } GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_upcall_lease_get_object, 4.1.6); diff -Nru glusterfs-5.5/api/src/glfs-fops.c glusterfs-6.3/api/src/glfs-fops.c --- glusterfs-5.5/api/src/glfs-fops.c 2019-03-15 13:23:38.362461659 +0000 +++ glusterfs-6.3/api/src/glfs-fops.c 2019-06-11 13:14:55.545110027 +0000 @@ -18,12 +18,13 @@ #include "glfs-internal.h" #include "glfs-mem-types.h" -#include "syncop.h" +#include #include "glfs.h" #include "gfapi-messages.h" -#include "compat-errno.h" +#include #include #include "glusterfs3.h" +#include #ifdef NAME_MAX #define GF_NAME_MAX NAME_MAX @@ -206,6 +207,201 @@ stat->st_dev = fs->dev_id; } +void +glfs_iatt_to_statx(struct glfs *fs, const struct iatt *iatt, + struct glfs_stat *statx) +{ + statx->glfs_st_mask = 0; + + statx->glfs_st_mode = 0; + if (IATT_TYPE_VALID(iatt->ia_flags)) { + statx->glfs_st_mode |= st_mode_type_from_ia(iatt->ia_type); + statx->glfs_st_mask |= GLFS_STAT_TYPE; + } + + if (IATT_MODE_VALID(iatt->ia_flags)) { + statx->glfs_st_mode |= st_mode_prot_from_ia(iatt->ia_prot); + statx->glfs_st_mask |= GLFS_STAT_MODE; + } + + if (IATT_NLINK_VALID(iatt->ia_flags)) { + statx->glfs_st_nlink = iatt->ia_nlink; + statx->glfs_st_mask |= GLFS_STAT_NLINK; + } + + if (IATT_UID_VALID(iatt->ia_flags)) { + statx->glfs_st_uid = iatt->ia_uid; + statx->glfs_st_mask |= GLFS_STAT_UID; + } + + if (IATT_GID_VALID(iatt->ia_flags)) { + statx->glfs_st_gid = iatt->ia_gid; + statx->glfs_st_mask |= GLFS_STAT_GID; + } + + if (IATT_ATIME_VALID(iatt->ia_flags)) { + statx->glfs_st_atime.tv_sec = iatt->ia_atime; + statx->glfs_st_atime.tv_nsec = iatt->ia_atime_nsec; + statx->glfs_st_mask |= GLFS_STAT_ATIME; + } + + if (IATT_MTIME_VALID(iatt->ia_flags)) { + statx->glfs_st_mtime.tv_sec = iatt->ia_mtime; + statx->glfs_st_mtime.tv_nsec = iatt->ia_mtime_nsec; + statx->glfs_st_mask |= GLFS_STAT_MTIME; + } + + if (IATT_CTIME_VALID(iatt->ia_flags)) { + statx->glfs_st_ctime.tv_sec = iatt->ia_ctime; + statx->glfs_st_ctime.tv_nsec = iatt->ia_ctime_nsec; + statx->glfs_st_mask |= GLFS_STAT_CTIME; + } + + if (IATT_BTIME_VALID(iatt->ia_flags)) { + statx->glfs_st_btime.tv_sec = iatt->ia_btime; + statx->glfs_st_btime.tv_nsec = iatt->ia_btime_nsec; + statx->glfs_st_mask |= GLFS_STAT_BTIME; + } + + if (IATT_INO_VALID(iatt->ia_flags)) { + statx->glfs_st_ino = iatt->ia_ino; + statx->glfs_st_mask |= GLFS_STAT_INO; + } + + if (IATT_SIZE_VALID(iatt->ia_flags)) { + statx->glfs_st_size = iatt->ia_size; + statx->glfs_st_mask |= GLFS_STAT_SIZE; + } + + if (IATT_BLOCKS_VALID(iatt->ia_flags)) { + statx->glfs_st_blocks = iatt->ia_blocks; + statx->glfs_st_mask |= GLFS_STAT_BLOCKS; + } + + /* unconditionally present, encode as is */ + statx->glfs_st_blksize = iatt->ia_blksize; + statx->glfs_st_rdev_major = ia_major(iatt->ia_rdev); + statx->glfs_st_rdev_minor = ia_minor(iatt->ia_rdev); + statx->glfs_st_dev_major = ia_major(fs->dev_id); + statx->glfs_st_dev_minor = ia_minor(fs->dev_id); + + /* At present we do not read any localFS attributes and pass them along, + * so setting this to 0. As we start supporting file attributes we can + * populate the same here as well */ + statx->glfs_st_attributes = 0; + statx->glfs_st_attributes_mask = 0; +} + +void +priv_glfs_iatt_from_statx(struct iatt *iatt, const struct glfs_stat *statx) +{ + /* Most code in xlators are not checking validity flags before accessing + the items. Hence zero everything before setting valid items */ + memset(iatt, 0, sizeof(struct iatt)); + + if (GLFS_STAT_TYPE_VALID(statx->glfs_st_mask)) { + iatt->ia_type = ia_type_from_st_mode(statx->glfs_st_mode); + iatt->ia_flags |= IATT_TYPE; + } + + if (GLFS_STAT_MODE_VALID(statx->glfs_st_mask)) { + iatt->ia_prot = ia_prot_from_st_mode(statx->glfs_st_mode); + iatt->ia_flags |= IATT_MODE; + } + + if (GLFS_STAT_NLINK_VALID(statx->glfs_st_mask)) { + iatt->ia_nlink = statx->glfs_st_nlink; + iatt->ia_flags |= IATT_NLINK; + } + + if (GLFS_STAT_UID_VALID(statx->glfs_st_mask)) { + iatt->ia_uid = statx->glfs_st_uid; + iatt->ia_flags |= IATT_UID; + } + + if (GLFS_STAT_GID_VALID(statx->glfs_st_mask)) { + iatt->ia_gid = statx->glfs_st_gid; + iatt->ia_flags |= IATT_GID; + } + + if (GLFS_STAT_ATIME_VALID(statx->glfs_st_mask)) { + iatt->ia_atime = statx->glfs_st_atime.tv_sec; + iatt->ia_atime_nsec = statx->glfs_st_atime.tv_nsec; + iatt->ia_flags |= IATT_ATIME; + } + + if (GLFS_STAT_MTIME_VALID(statx->glfs_st_mask)) { + iatt->ia_mtime = statx->glfs_st_mtime.tv_sec; + iatt->ia_mtime_nsec = statx->glfs_st_mtime.tv_nsec; + iatt->ia_flags |= IATT_MTIME; + } + + if (GLFS_STAT_CTIME_VALID(statx->glfs_st_mask)) { + iatt->ia_ctime = statx->glfs_st_ctime.tv_sec; + iatt->ia_ctime_nsec = statx->glfs_st_ctime.tv_nsec; + iatt->ia_flags |= IATT_CTIME; + } + + if (GLFS_STAT_BTIME_VALID(statx->glfs_st_mask)) { + iatt->ia_btime = statx->glfs_st_btime.tv_sec; + iatt->ia_btime_nsec = statx->glfs_st_btime.tv_nsec; + iatt->ia_flags |= IATT_BTIME; + } + + if (GLFS_STAT_INO_VALID(statx->glfs_st_mask)) { + iatt->ia_ino = statx->glfs_st_ino; + iatt->ia_flags |= IATT_INO; + } + + if (GLFS_STAT_SIZE_VALID(statx->glfs_st_mask)) { + iatt->ia_size = statx->glfs_st_size; + iatt->ia_flags |= IATT_SIZE; + } + + if (GLFS_STAT_BLOCKS_VALID(statx->glfs_st_mask)) { + iatt->ia_blocks = statx->glfs_st_blocks; + iatt->ia_flags |= IATT_BLOCKS; + } + + /* unconditionally present, encode as is */ + iatt->ia_blksize = statx->glfs_st_blksize; + iatt->ia_rdev = makedev(statx->glfs_st_rdev_major, + statx->glfs_st_rdev_minor); + iatt->ia_dev = makedev(statx->glfs_st_dev_major, statx->glfs_st_dev_minor); + iatt->ia_attributes = statx->glfs_st_attributes; + iatt->ia_attributes_mask = statx->glfs_st_attributes_mask; +} +GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_iatt_from_statx, 6.0); + +void +glfsflags_from_gfapiflags(struct glfs_stat *stat, int *glvalid) +{ + *glvalid = 0; + if (stat->glfs_st_mask & GLFS_STAT_MODE) { + *glvalid |= GF_SET_ATTR_MODE; + } + + if (stat->glfs_st_mask & GLFS_STAT_SIZE) { + *glvalid |= GF_SET_ATTR_SIZE; + } + + if (stat->glfs_st_mask & GLFS_STAT_UID) { + *glvalid |= GF_SET_ATTR_UID; + } + + if (stat->glfs_st_mask & GLFS_STAT_GID) { + *glvalid |= GF_SET_ATTR_GID; + } + + if (stat->glfs_st_mask & GLFS_STAT_ATIME) { + *glvalid |= GF_SET_ATTR_ATIME; + } + + if (stat->glfs_st_mask & GLFS_STAT_MTIME) { + *glvalid |= GF_SET_ATTR_MTIME; + } +} + int glfs_loc_unlink(loc_t *loc) { @@ -456,6 +652,61 @@ GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_stat, 3.4.0); int +priv_glfs_statx(struct glfs *fs, const char *path, const unsigned int mask, + struct glfs_stat *statxbuf) +{ + int ret = -1; + xlator_t *subvol = NULL; + loc_t loc = { + 0, + }; + struct iatt iatt = { + 0, + }; + int reval = 0; + + DECLARE_OLD_THIS; + __GLFS_ENTRY_VALIDATE_FS(fs, invalid_fs); + + if (path == NULL) { + ret = -1; + errno = EINVAL; + goto out; + } + + if (mask & ~GLFS_STAT_ALL) { + ret = -1; + errno = EINVAL; + goto out; + } + + subvol = glfs_active_subvol(fs); + if (!subvol) { + ret = -1; + errno = EIO; + goto out; + } + +retry: + ret = glfs_resolve(fs, subvol, path, &loc, &iatt, reval); + ESTALE_RETRY(ret, errno, reval, &loc, retry); + + if (ret == 0 && statxbuf) + glfs_iatt_to_statx(fs, &iatt, statxbuf); +out: + loc_wipe(&loc); + + glfs_subvol_done(fs, subvol); + + __GLFS_EXIT_FS; + +invalid_fs: + return ret; +} + +GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_statx, 6.0); + +int pub_glfs_fstat(struct glfs_fd *glfd, struct stat *stat) { int ret = -1; @@ -763,9 +1014,9 @@ GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lseek, 3.4.0); -ssize_t -pub_glfs_preadv(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, - off_t offset, int flags) +static ssize_t +glfs_preadv_common(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, + off_t offset, int flags, struct glfs_stat *poststat) { xlator_t *subvol = NULL; ssize_t ret = -1; @@ -774,6 +1025,9 @@ int cnt = 0; struct iobref *iobref = NULL; fd_t *fd = NULL; + struct iatt iatt = { + 0, + }; dict_t *fop_attr = NULL; DECLARE_OLD_THIS; @@ -801,10 +1055,13 @@ if (ret) gf_msg_debug("gfapi", 0, "Getting leaseid from thread failed"); - ret = syncop_readv(subvol, fd, size, offset, 0, &iov, &cnt, &iobref, + ret = syncop_readv(subvol, fd, size, offset, 0, &iov, &cnt, &iobref, &iatt, fop_attr, NULL); DECODE_SYNCOP_ERR(ret); + if (ret >= 0 && poststat) + glfs_iatt_to_statx(glfd->fs, &iatt, poststat); + if (ret <= 0) goto out; @@ -834,6 +1091,13 @@ return ret; } +ssize_t +pub_glfs_preadv(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, + off_t offset, int flags) +{ + return glfs_preadv_common(glfd, iovec, iovcnt, offset, flags, NULL); +} + GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_preadv, 3.4.0); ssize_t @@ -855,8 +1119,8 @@ GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_read, 3.4.0); ssize_t -pub_glfs_pread(struct glfs_fd *glfd, void *buf, size_t count, off_t offset, - int flags) +pub_glfs_pread34(struct glfs_fd *glfd, void *buf, size_t count, off_t offset, + int flags) { struct iovec iov = { 0, @@ -871,7 +1135,26 @@ return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pread, 3.4.0); +GFAPI_SYMVER_PUBLIC(glfs_pread34, glfs_pread, 3.4.0); + +ssize_t +pub_glfs_pread(struct glfs_fd *glfd, void *buf, size_t count, off_t offset, + int flags, struct glfs_stat *poststat) +{ + struct iovec iov = { + 0, + }; + ssize_t ret = 0; + + iov.iov_base = buf; + iov.iov_len = count; + + ret = glfs_preadv_common(glfd, &iov, 1, offset, flags, poststat); + + return ret; +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pread, 6.0); ssize_t pub_glfs_readv(struct glfs_fd *glfd, const struct iovec *iov, int count, @@ -893,19 +1176,26 @@ struct iovec *iov; int count; int flags; - glfs_io_cbk fn; + gf_boolean_t oldcb; + union { + glfs_io_cbk34 fn34; + glfs_io_cbk fn; + }; void *data; }; static int glfs_io_async_cbk(int op_ret, int op_errno, call_frame_t *frame, void *cookie, - struct iovec *iovec, int count) + struct iovec *iovec, int count, struct iatt *prebuf, + struct iatt *postbuf) { struct glfs_io *gio = NULL; xlator_t *subvol = NULL; struct glfs *fs = NULL; struct glfs_fd *glfd = NULL; int ret = -1; + struct glfs_stat prestat = {}, *prestatp = NULL; + struct glfs_stat poststat = {}, *poststatp = NULL; GF_VALIDATE_OR_GOTO("gfapi", frame, inval); GF_VALIDATE_OR_GOTO("gfapi", cookie, inval); @@ -936,8 +1226,21 @@ out: errno = op_errno; - gio->fn(gio->glfd, op_ret, gio->data); + if (gio->oldcb) { + gio->fn34(gio->glfd, op_ret, gio->data); + } else { + if (prebuf) { + prestatp = &prestat; + glfs_iatt_to_statx(fs, prebuf, prestatp); + } + if (postbuf) { + poststatp = &poststat; + glfs_iatt_to_statx(fs, postbuf, poststatp); + } + + gio->fn(gio->glfd, op_ret, prestatp, poststatp, gio->data); + } err: fd_unref(glfd->fd); /* Since the async operation is complete @@ -961,15 +1264,16 @@ int op_ret, int op_errno, struct iovec *iovec, int count, struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { - glfs_io_async_cbk(op_ret, op_errno, frame, cookie, iovec, count); + glfs_io_async_cbk(op_ret, op_errno, frame, cookie, iovec, count, NULL, + stbuf); return 0; } -int -pub_glfs_preadv_async(struct glfs_fd *glfd, const struct iovec *iovec, - int count, off_t offset, int flags, glfs_io_cbk fn, - void *data) +static int +glfs_preadv_async_common(struct glfs_fd *glfd, const struct iovec *iovec, + int count, off_t offset, int flags, gf_boolean_t oldcb, + glfs_io_cbk fn, void *data) { struct glfs_io *gio = NULL; int ret = 0; @@ -1026,6 +1330,7 @@ gio->count = count; gio->offset = offset; gio->flags = flags; + gio->oldcb = oldcb; gio->fn = fn; gio->data = data; @@ -1065,7 +1370,47 @@ return -1; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_preadv_async, 3.4.0); +int +pub_glfs_preadv_async34(struct glfs_fd *glfd, const struct iovec *iovec, + int count, off_t offset, int flags, glfs_io_cbk34 fn, + void *data) +{ + return glfs_preadv_async_common(glfd, iovec, count, offset, flags, _gf_true, + (void *)fn, data); +} + +GFAPI_SYMVER_PUBLIC(glfs_preadv_async34, glfs_preadv_async, 3.4.0); + +int +pub_glfs_preadv_async(struct glfs_fd *glfd, const struct iovec *iovec, + int count, off_t offset, int flags, glfs_io_cbk fn, + void *data) +{ + return glfs_preadv_async_common(glfd, iovec, count, offset, flags, + _gf_false, fn, data); +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_preadv_async, 6.0); + +int +pub_glfs_read_async34(struct glfs_fd *glfd, void *buf, size_t count, int flags, + glfs_io_cbk34 fn, void *data) +{ + struct iovec iov = { + 0, + }; + ssize_t ret = 0; + + iov.iov_base = buf; + iov.iov_len = count; + + ret = glfs_preadv_async_common(glfd, &iov, 1, glfd->offset, flags, _gf_true, + (void *)fn, data); + + return ret; +} + +GFAPI_SYMVER_PUBLIC(glfs_read_async34, glfs_read_async, 3.4.0); int pub_glfs_read_async(struct glfs_fd *glfd, void *buf, size_t count, int flags, @@ -1079,12 +1424,33 @@ iov.iov_base = buf; iov.iov_len = count; - ret = pub_glfs_preadv_async(glfd, &iov, 1, glfd->offset, flags, fn, data); + ret = glfs_preadv_async_common(glfd, &iov, 1, glfd->offset, flags, + _gf_false, fn, data); + + return ret; +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_read_async, 6.0); + +int +pub_glfs_pread_async34(struct glfs_fd *glfd, void *buf, size_t count, + off_t offset, int flags, glfs_io_cbk34 fn, void *data) +{ + struct iovec iov = { + 0, + }; + ssize_t ret = 0; + + iov.iov_base = buf; + iov.iov_len = count; + + ret = glfs_preadv_async_common(glfd, &iov, 1, offset, flags, _gf_true, + (void *)fn, data); return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_read_async, 3.4.0); +GFAPI_SYMVER_PUBLIC(glfs_pread_async34, glfs_pread_async, 3.4.0); int pub_glfs_pread_async(struct glfs_fd *glfd, void *buf, size_t count, @@ -1098,12 +1464,26 @@ iov.iov_base = buf; iov.iov_len = count; - ret = pub_glfs_preadv_async(glfd, &iov, 1, offset, flags, fn, data); + ret = glfs_preadv_async_common(glfd, &iov, 1, offset, flags, _gf_false, fn, + data); + + return ret; +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pread_async, 6.0); +int +pub_glfs_readv_async34(struct glfs_fd *glfd, const struct iovec *iov, int count, + int flags, glfs_io_cbk34 fn, void *data) +{ + ssize_t ret = 0; + + ret = glfs_preadv_async_common(glfd, iov, count, glfd->offset, flags, + _gf_true, (void *)fn, data); return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pread_async, 3.4.0); +GFAPI_SYMVER_PUBLIC(glfs_readv_async34, glfs_readv_async, 3.4.0); int pub_glfs_readv_async(struct glfs_fd *glfd, const struct iovec *iov, int count, @@ -1111,16 +1491,17 @@ { ssize_t ret = 0; - ret = pub_glfs_preadv_async(glfd, iov, count, glfd->offset, flags, fn, - data); + ret = glfs_preadv_async_common(glfd, iov, count, glfd->offset, flags, + _gf_false, fn, data); return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readv_async, 3.4.0); +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readv_async, 6.0); -ssize_t -pub_glfs_pwritev(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, - off_t offset, int flags) +static ssize_t +glfs_pwritev_common(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, + off_t offset, int flags, struct glfs_stat *prestat, + struct glfs_stat *poststat) { xlator_t *subvol = NULL; int ret = -1; @@ -1130,6 +1511,13 @@ 0, }; fd_t *fd = NULL; + struct iatt preiatt = + { + 0, + }, + postiatt = { + 0, + }; dict_t *fop_attr = NULL; DECLARE_OLD_THIS; @@ -1160,27 +1548,187 @@ if (ret) gf_msg_debug("gfapi", 0, "Getting leaseid from thread failed"); - ret = syncop_writev(subvol, fd, &iov, 1, offset, iobref, flags, fop_attr, - NULL); - DECODE_SYNCOP_ERR(ret); + ret = syncop_writev(subvol, fd, &iov, 1, offset, iobref, flags, &preiatt, + &postiatt, fop_attr, NULL); + DECODE_SYNCOP_ERR(ret); + + if (ret >= 0) { + if (prestat) + glfs_iatt_to_statx(glfd->fs, &preiatt, prestat); + if (poststat) + glfs_iatt_to_statx(glfd->fs, &postiatt, poststat); + } + + if (ret <= 0) + goto out; + + glfd->offset = (offset + iov.iov_len); +out: + if (iobuf) + iobuf_unref(iobuf); + if (iobref) + iobref_unref(iobref); + if (fd) + fd_unref(fd); + if (glfd) + GF_REF_PUT(glfd); + if (fop_attr) + dict_unref(fop_attr); + + glfs_subvol_done(glfd->fs, subvol); + + __GLFS_EXIT_FS; + +invalid_fs: + return ret; +} + +ssize_t +pub_glfs_copy_file_range(struct glfs_fd *glfd_in, off64_t *off_in, + struct glfs_fd *glfd_out, off64_t *off_out, size_t len, + unsigned int flags, struct glfs_stat *statbuf, + struct glfs_stat *prestat, struct glfs_stat *poststat) +{ + xlator_t *subvol = NULL; + int ret = -1; + fd_t *fd_in = NULL; + fd_t *fd_out = NULL; + struct iatt preiatt = + { + 0, + }, + iattbuf = + { + 0, + }, + postiatt = { + 0, + }; + dict_t *fop_attr = NULL; + off64_t pos_in; + off64_t pos_out; + + DECLARE_OLD_THIS; + __GLFS_ENTRY_VALIDATE_FD(glfd_in, invalid_fs); + __GLFS_ENTRY_VALIDATE_FD(glfd_out, invalid_fs); + + GF_REF_GET(glfd_in); + GF_REF_GET(glfd_out); + + if (glfd_in->fs != glfd_out->fs) { + ret = -1; + errno = EXDEV; + goto out; + } + + subvol = glfs_active_subvol(glfd_in->fs); + if (!subvol) { + ret = -1; + errno = EIO; + goto out; + } + + fd_in = glfs_resolve_fd(glfd_in->fs, subvol, glfd_in); + if (!fd_in) { + ret = -1; + errno = EBADFD; + goto out; + } + + fd_out = glfs_resolve_fd(glfd_out->fs, subvol, glfd_out); + if (!fd_out) { + ret = -1; + errno = EBADFD; + goto out; + } + + /* + * This is based on how the vfs layer in the kernel handles + * copy_file_range call. Upon receiving it follows the + * below method to consider the offset. + * if (off_in != NULL) + * use the value off_in to perform the op + * else if off_in == NULL + * use the current file offset position to perform the op + * + * For gfapi, glfd->offset is used. For a freshly opened + * fd, the offset is set to 0. + */ + if (off_in) + pos_in = *off_in; + else + pos_in = glfd_in->offset; + + if (off_out) + pos_out = *off_out; + else + pos_out = glfd_out->offset; + + ret = get_fop_attr_thrd_key(&fop_attr); + if (ret) + gf_msg_debug("gfapi", 0, "Getting leaseid from thread failed"); + + ret = syncop_copy_file_range(subvol, fd_in, pos_in, fd_out, pos_out, len, + flags, &iattbuf, &preiatt, &postiatt, fop_attr, + NULL); + DECODE_SYNCOP_ERR(ret); + + if (ret >= 0) { + pos_in += ret; + pos_out += ret; + + if (off_in) + *off_in = pos_in; + if (off_out) + *off_out = pos_out; + + if (statbuf) + glfs_iatt_to_statx(glfd_in->fs, &iattbuf, statbuf); + if (prestat) + glfs_iatt_to_statx(glfd_in->fs, &preiatt, prestat); + if (poststat) + glfs_iatt_to_statx(glfd_in->fs, &postiatt, poststat); + } if (ret <= 0) goto out; - glfd->offset = (offset + iov.iov_len); + /* + * If *off_in is NULL, then there is no offset info that can + * obtained from the input argument. Hence follow below method. + * If *off_in is NULL, then + * glfd->offset = offset + ret; + * else + * do nothing. + * + * According to the man page of copy_file_range, if off_in is + * NULL, then the offset of the source file is advanced by + * the return value of the fop. The same applies to off_out as + * well. Otherwise, if *off_in is not NULL, then the offset + * is not advanced by the filesystem. The entity which sends + * the copy_file_range call is supposed to advance the offset + * value in its buffer (pointed to by *off_in or *off_out) + * by the return value of copy_file_range. + */ + if (!off_in) + glfd_in->offset += ret; + + if (!off_out) + glfd_out->offset += ret; + out: - if (iobuf) - iobuf_unref(iobuf); - if (iobref) - iobref_unref(iobref); - if (fd) - fd_unref(fd); - if (glfd) - GF_REF_PUT(glfd); + if (fd_in) + fd_unref(fd_in); + if (fd_out) + fd_unref(fd_out); + if (glfd_in) + GF_REF_PUT(glfd_in); + if (glfd_out) + GF_REF_PUT(glfd_out); if (fop_attr) dict_unref(fop_attr); - glfs_subvol_done(glfd->fs, subvol); + glfs_subvol_done(glfd_in->fs, subvol); __GLFS_EXIT_FS; @@ -1188,6 +1736,15 @@ return ret; } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_copy_file_range, 6.0); + +ssize_t +pub_glfs_pwritev(struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, + off_t offset, int flags) +{ + return glfs_pwritev_common(glfd, iovec, iovcnt, offset, flags, NULL, NULL); +} + GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwritev, 3.4.0); ssize_t @@ -1222,8 +1779,8 @@ GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_writev, 3.4.0); ssize_t -pub_glfs_pwrite(struct glfs_fd *glfd, const void *buf, size_t count, - off_t offset, int flags) +pub_glfs_pwrite34(struct glfs_fd *glfd, const void *buf, size_t count, + off_t offset, int flags) { struct iovec iov = { 0, @@ -1238,7 +1795,27 @@ return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwrite, 3.4.0); +GFAPI_SYMVER_PUBLIC(glfs_pwrite34, glfs_pwrite, 3.4.0); + +ssize_t +pub_glfs_pwrite(struct glfs_fd *glfd, const void *buf, size_t count, + off_t offset, int flags, struct glfs_stat *prestat, + struct glfs_stat *poststat) +{ + struct iovec iov = { + 0, + }; + ssize_t ret = 0; + + iov.iov_base = (void *)buf; + iov.iov_len = count; + + ret = glfs_pwritev_common(glfd, &iov, 1, offset, flags, prestat, poststat); + + return ret; +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwrite, 6.0); extern glfs_t * pub_glfs_from_glfd(glfs_fd_t *); @@ -1248,15 +1825,16 @@ int op_ret, int op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { - glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0); + glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0, prebuf, + postbuf); return 0; } -int -pub_glfs_pwritev_async(struct glfs_fd *glfd, const struct iovec *iovec, - int count, off_t offset, int flags, glfs_io_cbk fn, - void *data) +static int +glfs_pwritev_async_common(struct glfs_fd *glfd, const struct iovec *iovec, + int count, off_t offset, int flags, + gf_boolean_t oldcb, glfs_io_cbk fn, void *data) { struct glfs_io *gio = NULL; int ret = -1; @@ -1297,6 +1875,7 @@ gio->glfd = glfd; gio->offset = offset; gio->flags = flags; + gio->oldcb = oldcb; gio->fn = fn; gio->data = data; gio->count = 1; @@ -1356,7 +1935,47 @@ return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwritev_async, 3.4.0); +int +pub_glfs_pwritev_async34(struct glfs_fd *glfd, const struct iovec *iovec, + int count, off_t offset, int flags, glfs_io_cbk34 fn, + void *data) +{ + return glfs_pwritev_async_common(glfd, iovec, count, offset, flags, + _gf_true, (void *)fn, data); +} + +GFAPI_SYMVER_PUBLIC(glfs_pwritev_async34, glfs_pwritev_async, 3.4.0); + +int +pub_glfs_pwritev_async(struct glfs_fd *glfd, const struct iovec *iovec, + int count, off_t offset, int flags, glfs_io_cbk fn, + void *data) +{ + return glfs_pwritev_async_common(glfd, iovec, count, offset, flags, + _gf_false, fn, data); +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwritev_async, 6.0); + +int +pub_glfs_write_async34(struct glfs_fd *glfd, const void *buf, size_t count, + int flags, glfs_io_cbk34 fn, void *data) +{ + struct iovec iov = { + 0, + }; + ssize_t ret = 0; + + iov.iov_base = (void *)buf; + iov.iov_len = count; + + ret = glfs_pwritev_async_common(glfd, &iov, 1, glfd->offset, flags, + _gf_true, (void *)fn, data); + + return ret; +} + +GFAPI_SYMVER_PUBLIC(glfs_write_async34, glfs_write_async, 3.4.0); int pub_glfs_write_async(struct glfs_fd *glfd, const void *buf, size_t count, @@ -1370,12 +1989,33 @@ iov.iov_base = (void *)buf; iov.iov_len = count; - ret = pub_glfs_pwritev_async(glfd, &iov, 1, glfd->offset, flags, fn, data); + ret = glfs_pwritev_async_common(glfd, &iov, 1, glfd->offset, flags, + _gf_false, fn, data); + + return ret; +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_write_async, 6.0); + +int +pub_glfs_pwrite_async34(struct glfs_fd *glfd, const void *buf, int count, + off_t offset, int flags, glfs_io_cbk34 fn, void *data) +{ + struct iovec iov = { + 0, + }; + ssize_t ret = 0; + + iov.iov_base = (void *)buf; + iov.iov_len = count; + + ret = glfs_pwritev_async_common(glfd, &iov, 1, offset, flags, _gf_true, + (void *)fn, data); return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_write_async, 3.4.0); +GFAPI_SYMVER_PUBLIC(glfs_pwrite_async34, glfs_pwrite_async, 3.4.0); int pub_glfs_pwrite_async(struct glfs_fd *glfd, const void *buf, int count, @@ -1389,12 +2029,26 @@ iov.iov_base = (void *)buf; iov.iov_len = count; - ret = pub_glfs_pwritev_async(glfd, &iov, 1, offset, flags, fn, data); + ret = glfs_pwritev_async_common(glfd, &iov, 1, offset, flags, _gf_false, fn, + data); + + return ret; +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwrite_async, 6.0); + +int +pub_glfs_writev_async34(struct glfs_fd *glfd, const struct iovec *iov, + int count, int flags, glfs_io_cbk34 fn, void *data) +{ + ssize_t ret = 0; + ret = glfs_pwritev_async_common(glfd, iov, count, glfd->offset, flags, + _gf_true, (void *)fn, data); return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwrite_async, 3.4.0); +GFAPI_SYMVER_PUBLIC(glfs_writev_async34, glfs_writev_async, 3.4.0); int pub_glfs_writev_async(struct glfs_fd *glfd, const struct iovec *iov, int count, @@ -1402,19 +2056,27 @@ { ssize_t ret = 0; - ret = pub_glfs_pwritev_async(glfd, iov, count, glfd->offset, flags, fn, - data); + ret = glfs_pwritev_async_common(glfd, iov, count, glfd->offset, flags, + _gf_false, fn, data); return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_writev_async, 3.4.0); +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_writev_async, 6.0); -int -pub_glfs_fsync(struct glfs_fd *glfd) +static int +glfs_fsync_common(struct glfs_fd *glfd, struct glfs_stat *prestat, + struct glfs_stat *poststat) { int ret = -1; xlator_t *subvol = NULL; fd_t *fd = NULL; + struct iatt preiatt = + { + 0, + }, + postiatt = { + 0, + }; dict_t *fop_attr = NULL; DECLARE_OLD_THIS; @@ -1440,9 +2102,15 @@ if (ret) gf_msg_debug("gfapi", 0, "Getting leaseid from thread failed"); - ret = syncop_fsync(subvol, fd, 0, fop_attr, NULL); + ret = syncop_fsync(subvol, fd, 0, &preiatt, &postiatt, fop_attr, NULL); DECODE_SYNCOP_ERR(ret); + if (ret >= 0) { + if (prestat) + glfs_iatt_to_statx(glfd->fs, &preiatt, prestat); + if (poststat) + glfs_iatt_to_statx(glfd->fs, &postiatt, poststat); + } out: if (fd) fd_unref(fd); @@ -1459,21 +2127,37 @@ return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsync, 3.4.0); +int +pub_glfs_fsync34(struct glfs_fd *glfd) +{ + return glfs_fsync_common(glfd, NULL, NULL); +} + +GFAPI_SYMVER_PUBLIC(glfs_fsync34, glfs_fsync, 3.4.0); + +int +pub_glfs_fsync(struct glfs_fd *glfd, struct glfs_stat *prestat, + struct glfs_stat *poststat) +{ + return glfs_fsync_common(glfd, prestat, poststat); +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsync, 6.0); static int glfs_fsync_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { - glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0); + glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0, prebuf, + postbuf); return 0; } static int -glfs_fsync_async_common(struct glfs_fd *glfd, glfs_io_cbk fn, void *data, - int dataonly) +glfs_fsync_async_common(struct glfs_fd *glfd, gf_boolean_t oldcb, + glfs_io_cbk fn, void *data, int dataonly) { struct glfs_io *gio = NULL; int ret = 0; @@ -1517,6 +2201,7 @@ gio->op = GF_FOP_FSYNC; gio->glfd = glfd; gio->flags = dataonly; + gio->oldcb = oldcb; gio->fn = fn; gio->data = data; @@ -1540,14 +2225,14 @@ } int -pub_glfs_fsync_async(struct glfs_fd *glfd, glfs_io_cbk fn, void *data) +pub_glfs_fsync_async34(struct glfs_fd *glfd, glfs_io_cbk34 fn, void *data) { int ret = -1; DECLARE_OLD_THIS; __GLFS_ENTRY_VALIDATE_FD(glfd, invalid_fs); - ret = glfs_fsync_async_common(glfd, fn, data, 0); + ret = glfs_fsync_async_common(glfd, _gf_true, (void *)fn, data, 0); __GLFS_EXIT_FS; @@ -1555,14 +2240,40 @@ return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsync_async, 3.4.0); +GFAPI_SYMVER_PUBLIC(glfs_fsync_async34, glfs_fsync_async, 3.4.0); int -pub_glfs_fdatasync(struct glfs_fd *glfd) +pub_glfs_fsync_async(struct glfs_fd *glfd, glfs_io_cbk fn, void *data) +{ + int ret = -1; + + DECLARE_OLD_THIS; + __GLFS_ENTRY_VALIDATE_FD(glfd, invalid_fs); + + ret = glfs_fsync_async_common(glfd, _gf_false, fn, data, 0); + + __GLFS_EXIT_FS; + +invalid_fs: + return ret; +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsync_async, 6.0); + +static int +glfs_fdatasync_common(struct glfs_fd *glfd, struct glfs_stat *prestat, + struct glfs_stat *poststat) { int ret = -1; xlator_t *subvol = NULL; fd_t *fd = NULL; + struct iatt preiatt = + { + 0, + }, + postiatt = { + 0, + }; dict_t *fop_attr = NULL; DECLARE_OLD_THIS; @@ -1588,9 +2299,15 @@ if (ret) gf_msg_debug("gfapi", 0, "Getting leaseid from thread failed"); - ret = syncop_fsync(subvol, fd, 1, fop_attr, NULL); + ret = syncop_fsync(subvol, fd, 1, &preiatt, &postiatt, fop_attr, NULL); DECODE_SYNCOP_ERR(ret); + if (ret >= 0) { + if (prestat) + glfs_iatt_to_statx(glfd->fs, &preiatt, prestat); + if (poststat) + glfs_iatt_to_statx(glfd->fs, &postiatt, poststat); + } out: if (fd) fd_unref(fd); @@ -1607,17 +2324,32 @@ return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fdatasync, 3.4.0); +int +pub_glfs_fdatasync34(struct glfs_fd *glfd) +{ + return glfs_fdatasync_common(glfd, NULL, NULL); +} + +GFAPI_SYMVER_PUBLIC(glfs_fdatasync34, glfs_fdatasync, 3.4.0); int -pub_glfs_fdatasync_async(struct glfs_fd *glfd, glfs_io_cbk fn, void *data) +pub_glfs_fdatasync(struct glfs_fd *glfd, struct glfs_stat *prestat, + struct glfs_stat *poststat) +{ + return glfs_fdatasync_common(glfd, prestat, poststat); +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fdatasync, 6.0); + +int +pub_glfs_fdatasync_async34(struct glfs_fd *glfd, glfs_io_cbk34 fn, void *data) { int ret = -1; DECLARE_OLD_THIS; __GLFS_ENTRY_VALIDATE_FD(glfd, invalid_fs); - ret = glfs_fsync_async_common(glfd, fn, data, 1); + ret = glfs_fsync_async_common(glfd, _gf_true, (void *)fn, data, 1); __GLFS_EXIT_FS; @@ -1625,14 +2357,40 @@ return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fdatasync_async, 3.4.0); +GFAPI_SYMVER_PUBLIC(glfs_fdatasync_async34, glfs_fdatasync_async, 3.4.0); int -pub_glfs_ftruncate(struct glfs_fd *glfd, off_t offset) +pub_glfs_fdatasync_async(struct glfs_fd *glfd, glfs_io_cbk fn, void *data) +{ + int ret = -1; + + DECLARE_OLD_THIS; + __GLFS_ENTRY_VALIDATE_FD(glfd, invalid_fs); + + ret = glfs_fsync_async_common(glfd, _gf_false, fn, data, 1); + + __GLFS_EXIT_FS; + +invalid_fs: + return ret; +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fdatasync_async, 6.0); + +static int +glfs_ftruncate_common(struct glfs_fd *glfd, off_t offset, + struct glfs_stat *prestat, struct glfs_stat *poststat) { int ret = -1; xlator_t *subvol = NULL; fd_t *fd = NULL; + struct iatt preiatt = + { + 0, + }, + postiatt = { + 0, + }; dict_t *fop_attr = NULL; DECLARE_OLD_THIS; @@ -1658,9 +2416,16 @@ if (ret) gf_msg_debug("gfapi", 0, "Getting leaseid from thread failed"); - ret = syncop_ftruncate(subvol, fd, offset, fop_attr, NULL); + ret = syncop_ftruncate(subvol, fd, offset, &preiatt, &postiatt, fop_attr, + NULL); DECODE_SYNCOP_ERR(ret); + if (ret >= 0) { + if (prestat) + glfs_iatt_to_statx(glfd->fs, &preiatt, prestat); + if (poststat) + glfs_iatt_to_statx(glfd->fs, &postiatt, poststat); + } out: if (fd) fd_unref(fd); @@ -1677,7 +2442,22 @@ return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_ftruncate, 3.4.0); +int +pub_glfs_ftruncate34(struct glfs_fd *glfd, off_t offset) +{ + return glfs_ftruncate_common(glfd, offset, NULL, NULL); +} + +GFAPI_SYMVER_PUBLIC(glfs_ftruncate34, glfs_ftruncate, 3.4.0); + +int +pub_glfs_ftruncate(struct glfs_fd *glfd, off_t offset, + struct glfs_stat *prestat, struct glfs_stat *poststat) +{ + return glfs_ftruncate_common(glfd, offset, prestat, poststat); +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_ftruncate, 6.0); int pub_glfs_truncate(struct glfs *fs, const char *path, off_t length) @@ -1731,14 +2511,15 @@ int32_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) { - glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0); + glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0, prebuf, + postbuf); return 0; } -int -pub_glfs_ftruncate_async(struct glfs_fd *glfd, off_t offset, glfs_io_cbk fn, - void *data) +static int +glfs_ftruncate_async_common(struct glfs_fd *glfd, off_t offset, + gf_boolean_t oldcb, glfs_io_cbk fn, void *data) { struct glfs_io *gio = NULL; int ret = -1; @@ -1782,6 +2563,7 @@ gio->op = GF_FOP_FTRUNCATE; gio->glfd = glfd; gio->offset = offset; + gio->oldcb = oldcb; gio->fn = fn; gio->data = data; @@ -1816,7 +2598,24 @@ return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_ftruncate_async, 3.4.0); +int +pub_glfs_ftruncate_async34(struct glfs_fd *glfd, off_t offset, glfs_io_cbk34 fn, + void *data) +{ + return glfs_ftruncate_async_common(glfd, offset, _gf_true, (void *)fn, + data); +} + +GFAPI_SYMVER_PUBLIC(glfs_ftruncate_async34, glfs_ftruncate_async, 3.4.0); + +int +pub_glfs_ftruncate_async(struct glfs_fd *glfd, off_t offset, glfs_io_cbk fn, + void *data) +{ + return glfs_ftruncate_async_common(glfd, offset, _gf_false, fn, data); +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_ftruncate_async, 6.0); int pub_glfs_access(struct glfs *fs, const char *path, int mode) @@ -2634,14 +3433,15 @@ struct iatt *preop_stbuf, struct iatt *postop_stbuf, dict_t *xdata) { - glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0); + glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0, preop_stbuf, + postop_stbuf); return 0; } -int -pub_glfs_discard_async(struct glfs_fd *glfd, off_t offset, size_t len, - glfs_io_cbk fn, void *data) +static int +glfs_discard_async_common(struct glfs_fd *glfd, off_t offset, size_t len, + gf_boolean_t oldcb, glfs_io_cbk fn, void *data) { struct glfs_io *gio = NULL; int ret = -1; @@ -2686,6 +3486,7 @@ gio->glfd = glfd; gio->offset = offset; gio->count = len; + gio->oldcb = oldcb; gio->fn = fn; gio->data = data; @@ -2716,7 +3517,24 @@ return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_discard_async, 3.5.0); +int +pub_glfs_discard_async35(struct glfs_fd *glfd, off_t offset, size_t len, + glfs_io_cbk34 fn, void *data) +{ + return glfs_discard_async_common(glfd, offset, len, _gf_true, (void *)fn, + data); +} + +GFAPI_SYMVER_PUBLIC(glfs_discard_async35, glfs_discard_async, 3.5.0); + +int +pub_glfs_discard_async(struct glfs_fd *glfd, off_t offset, size_t len, + glfs_io_cbk fn, void *data) +{ + return glfs_discard_async_common(glfd, offset, len, _gf_false, fn, data); +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_discard_async, 6.0); static int glfs_zerofill_async_cbk(call_frame_t *frame, void *cookie, xlator_t *this, @@ -2724,14 +3542,15 @@ struct iatt *preop_stbuf, struct iatt *postop_stbuf, dict_t *xdata) { - glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0); + glfs_io_async_cbk(op_ret, op_errno, frame, cookie, NULL, 0, preop_stbuf, + postop_stbuf); return 0; } -int -pub_glfs_zerofill_async(struct glfs_fd *glfd, off_t offset, off_t len, - glfs_io_cbk fn, void *data) +static int +glfs_zerofill_async_common(struct glfs_fd *glfd, off_t offset, off_t len, + gf_boolean_t oldcb, glfs_io_cbk fn, void *data) { struct glfs_io *gio = NULL; int ret = -1; @@ -2776,6 +3595,7 @@ gio->glfd = glfd; gio->offset = offset; gio->count = len; + gio->oldcb = oldcb; gio->fn = fn; gio->data = data; @@ -2808,7 +3628,24 @@ return ret; } -GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_zerofill_async, 3.5.0); +int +pub_glfs_zerofill_async35(struct glfs_fd *glfd, off_t offset, off_t len, + glfs_io_cbk34 fn, void *data) +{ + return glfs_zerofill_async_common(glfd, offset, len, _gf_true, (void *)fn, + data); +} + +GFAPI_SYMVER_PUBLIC(glfs_zerofill_async35, glfs_zerofill_async, 3.5.0); + +int +pub_glfs_zerofill_async(struct glfs_fd *glfd, off_t offset, off_t len, + glfs_io_cbk fn, void *data) +{ + return glfs_zerofill_async_common(glfd, offset, len, _gf_false, fn, data); +} + +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_zerofill_async, 6.0); void gf_dirent_to_dirent(gf_dirent_t *gf_dirent, struct dirent *dirent) @@ -2827,7 +3664,7 @@ dirent->d_namlen = strlen(gf_dirent->d_name); #endif - snprintf(dirent->d_name, NAME_MAX, "%s", gf_dirent->d_name); + snprintf(dirent->d_name, NAME_MAX + 1, "%s", gf_dirent->d_name); } int @@ -3106,10 +3943,11 @@ GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_statvfs, 3.4.0); int -glfs_setattr(struct glfs *fs, const char *path, struct iatt *iatt, int valid, - int follow) +pub_glfs_setattr(struct glfs *fs, const char *path, struct glfs_stat *stat, + int follow) { int ret = -1; + int glvalid; xlator_t *subvol = NULL; loc_t loc = { 0, @@ -3117,11 +3955,16 @@ struct iatt riatt = { 0, }; + struct iatt iatt = { + 0, + }; int reval = 0; DECLARE_OLD_THIS; __GLFS_ENTRY_VALIDATE_FS(fs, invalid_fs); + GF_VALIDATE_OR_GOTO("glfs_setattr", stat, out); + subvol = glfs_active_subvol(fs); if (!subvol) { ret = -1; @@ -3139,8 +3982,11 @@ if (ret) goto out; + glfs_iatt_from_statx(&iatt, stat); + glfsflags_from_gfapiflags(stat, &glvalid); + /* TODO : Add leaseid */ - ret = syncop_setattr(subvol, &loc, iatt, valid, 0, 0, NULL, NULL); + ret = syncop_setattr(subvol, &loc, &iatt, glvalid, 0, 0, NULL, NULL); DECODE_SYNCOP_ERR(ret); ESTALE_RETRY(ret, errno, reval, &loc, retry); @@ -3155,10 +4001,16 @@ return ret; } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_setattr, 6.0); + int -glfs_fsetattr(struct glfs_fd *glfd, struct iatt *iatt, int valid) +pub_glfs_fsetattr(struct glfs_fd *glfd, struct glfs_stat *stat) { int ret = -1; + int glvalid; + struct iatt iatt = { + 0, + }; xlator_t *subvol = NULL; fd_t *fd = NULL; @@ -3167,6 +4019,8 @@ GF_REF_GET(glfd); + GF_VALIDATE_OR_GOTO("glfs_fsetattr", stat, out); + subvol = glfs_active_subvol(glfd->fs); if (!subvol) { ret = -1; @@ -3181,8 +4035,11 @@ goto out; } + glfs_iatt_from_statx(&iatt, stat); + glfsflags_from_gfapiflags(stat, &glvalid); + /* TODO : Add leaseid */ - ret = syncop_fsetattr(subvol, fd, iatt, valid, 0, 0, NULL, NULL); + ret = syncop_fsetattr(subvol, fd, &iatt, glvalid, 0, 0, NULL, NULL); DECODE_SYNCOP_ERR(ret); out: if (fd) @@ -3198,19 +4055,20 @@ return ret; } +GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsetattr, 6.0); + int pub_glfs_chmod(struct glfs *fs, const char *path, mode_t mode) { int ret = -1; - struct iatt iatt = { + struct glfs_stat stat = { 0, }; - int valid = 0; - iatt.ia_prot = ia_prot_from_st_mode(mode); - valid = GF_SET_ATTR_MODE; + stat.glfs_st_mode = mode; + stat.glfs_st_mask = GLFS_STAT_MODE; - ret = glfs_setattr(fs, path, &iatt, valid, 1); + ret = glfs_setattr(fs, path, &stat, 1); return ret; } @@ -3221,15 +4079,14 @@ pub_glfs_fchmod(struct glfs_fd *glfd, mode_t mode) { int ret = -1; - struct iatt iatt = { + struct glfs_stat stat = { 0, }; - int valid = 0; - iatt.ia_prot = ia_prot_from_st_mode(mode); - valid = GF_SET_ATTR_MODE; + stat.glfs_st_mode = mode; + stat.glfs_st_mask = GLFS_STAT_MODE; - ret = glfs_fsetattr(glfd, &iatt, valid); + ret = glfs_fsetattr(glfd, &stat); return ret; } @@ -3240,23 +4097,22 @@ pub_glfs_chown(struct glfs *fs, const char *path, uid_t uid, gid_t gid) { int ret = 0; - int valid = 0; - struct iatt iatt = { + struct glfs_stat stat = { 0, }; if (uid != (uid_t)-1) { - iatt.ia_uid = uid; - valid = GF_SET_ATTR_UID; + stat.glfs_st_uid = uid; + stat.glfs_st_mask = GLFS_STAT_UID; } if (gid != (uid_t)-1) { - iatt.ia_gid = gid; - valid = valid | GF_SET_ATTR_GID; + stat.glfs_st_gid = gid; + stat.glfs_st_mask = stat.glfs_st_mask | GLFS_STAT_GID; } - if (valid) - ret = glfs_setattr(fs, path, &iatt, valid, 1); + if (stat.glfs_st_mask) + ret = glfs_setattr(fs, path, &stat, 1); return ret; } @@ -3267,23 +4123,22 @@ pub_glfs_lchown(struct glfs *fs, const char *path, uid_t uid, gid_t gid) { int ret = 0; - int valid = 0; - struct iatt iatt = { + struct glfs_stat stat = { 0, }; if (uid != (uid_t)-1) { - iatt.ia_uid = uid; - valid = GF_SET_ATTR_UID; + stat.glfs_st_uid = uid; + stat.glfs_st_mask = GLFS_STAT_UID; } if (gid != (uid_t)-1) { - iatt.ia_gid = gid; - valid = valid | GF_SET_ATTR_GID; + stat.glfs_st_gid = gid; + stat.glfs_st_mask = stat.glfs_st_mask | GLFS_STAT_GID; } - if (valid) - ret = glfs_setattr(fs, path, &iatt, valid, 0); + if (stat.glfs_st_mask) + ret = glfs_setattr(fs, path, &stat, 0); return ret; } @@ -3294,23 +4149,22 @@ pub_glfs_fchown(struct glfs_fd *glfd, uid_t uid, gid_t gid) { int ret = 0; - int valid = 0; - struct iatt iatt = { + struct glfs_stat stat = { 0, }; if (uid != (uid_t)-1) { - iatt.ia_uid = uid; - valid = GF_SET_ATTR_UID; + stat.glfs_st_uid = uid; + stat.glfs_st_mask = GLFS_STAT_UID; } if (gid != (uid_t)-1) { - iatt.ia_gid = gid; - valid = valid | GF_SET_ATTR_GID; + stat.glfs_st_gid = gid; + stat.glfs_st_mask = stat.glfs_st_mask | GLFS_STAT_GID; } - if (valid) - ret = glfs_fsetattr(glfd, &iatt, valid); + if (stat.glfs_st_mask) + ret = glfs_fsetattr(glfd, &stat); return ret; } @@ -3322,19 +4176,16 @@ const struct timespec times[2]) { int ret = -1; - int valid = 0; - struct iatt iatt = { + struct glfs_stat stat = { 0, }; - iatt.ia_atime = times[0].tv_sec; - iatt.ia_atime_nsec = times[0].tv_nsec; - iatt.ia_mtime = times[1].tv_sec; - iatt.ia_mtime_nsec = times[1].tv_nsec; + stat.glfs_st_atime = times[0]; + stat.glfs_st_mtime = times[1]; - valid = GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME; + stat.glfs_st_mask = GLFS_STAT_ATIME | GLFS_STAT_MTIME; - ret = glfs_setattr(fs, path, &iatt, valid, 1); + ret = glfs_setattr(fs, path, &stat, 1); return ret; } @@ -3346,19 +4197,16 @@ const struct timespec times[2]) { int ret = -1; - int valid = 0; - struct iatt iatt = { + struct glfs_stat stat = { 0, }; - iatt.ia_atime = times[0].tv_sec; - iatt.ia_atime_nsec = times[0].tv_nsec; - iatt.ia_mtime = times[1].tv_sec; - iatt.ia_mtime_nsec = times[1].tv_nsec; + stat.glfs_st_atime = times[0]; + stat.glfs_st_mtime = times[1]; - valid = GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME; + stat.glfs_st_mask = GLFS_STAT_ATIME | GLFS_STAT_MTIME; - ret = glfs_setattr(fs, path, &iatt, valid, 0); + ret = glfs_setattr(fs, path, &stat, 0); return ret; } @@ -3369,19 +4217,16 @@ pub_glfs_futimens(struct glfs_fd *glfd, const struct timespec times[2]) { int ret = -1; - int valid = 0; - struct iatt iatt = { + struct glfs_stat stat = { 0, }; - iatt.ia_atime = times[0].tv_sec; - iatt.ia_atime_nsec = times[0].tv_nsec; - iatt.ia_mtime = times[1].tv_sec; - iatt.ia_mtime_nsec = times[1].tv_nsec; + stat.glfs_st_atime = times[0]; + stat.glfs_st_mtime = times[1]; - valid = GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME; + stat.glfs_st_mask = GLFS_STAT_ATIME | GLFS_STAT_MTIME; - ret = glfs_fsetattr(glfd, &iatt, valid); + ret = glfs_fsetattr(glfd, &stat); return ret; } @@ -4318,7 +5163,7 @@ goto out; if (loc.path) { - snprintf(retpath, PATH_MAX, "%s", loc.path); + snprintf(retpath, PATH_MAX + 1, "%s", loc.path); } out: @@ -4728,9 +5573,7 @@ inode_t *inode = NULL; struct glfs_fd *glfd = NULL; struct glfs_fd *tmp = NULL; - struct list_head glfd_list = { - 0, - }; + struct list_head glfd_list; fd_t *fd = NULL; uint64_t value = 0; struct glfs_lease lease = { @@ -4769,7 +5612,7 @@ list_for_each_entry(fd, &inode->fd_list, inode_list) { ret = fd_ctx_get(fd, subvol, &value); - glfd = (struct glfs_fd *)value; + glfd = (struct glfs_fd *)(uintptr_t)value; if (glfd) { gf_msg_trace(THIS->name, 0, "glfd (%p) has held lease", glfd); GF_REF_GET(glfd); @@ -4779,22 +5622,24 @@ } UNLOCK(&inode->lock); - list_for_each_entry_safe(glfd, tmp, &glfd_list, list) - { - LOCK(&glfd->lock); + if (!list_empty(&glfd_list)) { + list_for_each_entry_safe(glfd, tmp, &glfd_list, list) { - if (glfd->state != GLFD_CLOSE) { - gf_msg_trace(THIS->name, 0, - "glfd (%p) has held lease, " - "calling recall cbk", - glfd); - glfd->cbk(lease, glfd->cookie); + LOCK(&glfd->lock); + { + if (glfd->state != GLFD_CLOSE) { + gf_msg_trace(THIS->name, 0, + "glfd (%p) has held lease, " + "calling recall cbk", + glfd); + glfd->cbk(lease, glfd->cookie); + } } - } - UNLOCK(&glfd->lock); + UNLOCK(&glfd->lock); - list_del_init(&glfd->list); - GF_REF_PUT(glfd); + list_del_init(&glfd->list); + GF_REF_PUT(glfd); + } } out: @@ -4869,6 +5714,16 @@ } static int +glfs_upcall_syncop_cbk(int ret, call_frame_t *frame, void *opaque) +{ + struct upcall_syncop_args *args = opaque; + + GF_FREE(args->upcall_data); + GF_FREE(args); + return 0; +} + +static int glfs_cbk_upcall_syncop(void *opaque) { struct upcall_syncop_args *args = opaque; @@ -4925,15 +5780,13 @@ GLFS_FREE(up_arg); } - return ret; + return 0; } static void glfs_cbk_upcall_data(struct glfs *fs, struct gf_upcall *upcall_data) { - struct upcall_syncop_args args = { - 0, - }; + struct upcall_syncop_args *args = NULL; int ret = -1; if (!fs || !upcall_data) @@ -4944,16 +5797,34 @@ goto out; } - args.fs = fs; - args.upcall_data = upcall_data; + args = GF_CALLOC(1, sizeof(struct upcall_syncop_args), + glfs_mt_upcall_entry_t); + if (!args) { + gf_msg(THIS->name, GF_LOG_ERROR, ENOMEM, API_MSG_ALLOC_FAILED, + "Upcall syncop args allocation failed."); + goto out; + } + + /* Note: we are not taking any ref on fs here. + * Ideally applications have to unregister for upcall events + * or stop polling for upcall events before performing + * glfs_fini. And as for outstanding synctasks created, we wait + * for all syncenv threads to finish tasks before cleaning up the + * fs->ctx. Hence it seems safe to process these callback + * notification without taking any lock/ref. + */ + args->fs = fs; + args->upcall_data = gf_memdup(upcall_data, sizeof(*upcall_data)); - ret = synctask_new(THIS->ctx->env, glfs_cbk_upcall_syncop, NULL, NULL, - &args); + ret = synctask_new(THIS->ctx->env, glfs_cbk_upcall_syncop, + glfs_upcall_syncop_cbk, NULL, args); /* should we retry incase of failure? */ if (ret) { gf_msg(THIS->name, GF_LOG_ERROR, errno, API_MSG_UPCALL_SYNCOP_FAILED, "Synctak for Upcall event_type(%d) and gfid(%s) failed", upcall_data->event_type, (char *)(upcall_data->gfid)); + GF_FREE(args->upcall_data); + GF_FREE(args); } out: @@ -5118,7 +5989,8 @@ iov.iov_len = size; /* TODO : set leaseid */ - ret = syncop_writev(subvol, fd, &iov, 1, offset, iobref, flags, NULL, NULL); + ret = syncop_writev(subvol, fd, &iov, 1, offset, iobref, flags, NULL, NULL, + NULL, NULL); DECODE_SYNCOP_ERR(ret); iobuf_unref(iobuf); @@ -5188,7 +6060,7 @@ /* TODO : set leaseid */ ret = syncop_readv(subvol, fd, size, offset, flags, &iov, &cnt, &iobref, - NULL, NULL); + NULL, NULL, NULL); DECODE_SYNCOP_ERR(ret); if (ret <= 0) goto out; @@ -5358,16 +6230,18 @@ void gf_lease_to_glfs_lease(struct gf_lease *gf_lease, struct glfs_lease *lease) { + u_int lease_type = gf_lease->lease_type; lease->cmd = gf_lease->cmd; - lease->lease_type = gf_lease->lease_type; + lease->lease_type = lease_type; memcpy(lease->lease_id, gf_lease->lease_id, LEASE_ID_SIZE); } void glfs_lease_to_gf_lease(struct glfs_lease *lease, struct gf_lease *gf_lease) { + u_int lease_type = lease->lease_type; gf_lease->cmd = lease->cmd; - gf_lease->lease_type = lease->lease_type; + gf_lease->lease_type = lease_type; memcpy(gf_lease->lease_id, lease->lease_id, LEASE_ID_SIZE); } diff -Nru glusterfs-5.5/api/src/glfs.h glusterfs-6.3/api/src/glfs.h --- glusterfs-5.5/api/src/glfs.h 2019-03-15 13:23:38.364461663 +0000 +++ glusterfs-6.3/api/src/glfs.h 2019-06-11 13:14:55.549110039 +0000 @@ -20,6 +20,17 @@ both the library and the application. */ +/* Values for valid flags to be used when using XXXsetattr, to set multiple + attribute values passed via the related stat structure. + */ + +#define GFAPI_SET_ATTR_MODE 0x1 +#define GFAPI_SET_ATTR_UID 0x2 +#define GFAPI_SET_ATTR_GID 0x4 +#define GFAPI_SET_ATTR_SIZE 0x8 +#define GFAPI_SET_ATTR_ATIME 0x10 +#define GFAPI_SET_ATTR_MTIME 0x20 + #ifndef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 #endif @@ -40,7 +51,40 @@ #include #include #include -#include +#include +#include + +/* + * For off64_t to be defined, we need both + * __USE_LARGEFILE64 to be true and __off64_t_defnined to be + * false. But, making __USE_LARGEFILE64 true causes other issues + * such as redinition of stat and fstat to stat64 and fstat64 + * respectively which again causes compilation issues. + * Without off64_t being defined, this will not compile as + * copy_file_range uses off64_t. Hence define it here. First + * check whether __off64_t_defined is true or not. + * sets that flag when it defines off64_t. If __off64_t_defined + * is false and __USE_FILE_OFFSET64 is true, then go on to define + * off64_t using __off64_t. + */ +#ifndef GF_BSD_HOST_OS +#if defined(__USE_FILE_OFFSET64) && !defined(__off64_t_defined) +typedef __off64_t off64_t; +#endif /* defined(__USE_FILE_OFFSET64) && !defined(__off64_t_defined) */ +#else +#include +#ifndef _OFF64_T_DECLARED +/* + * Including (done above) should actually define + * _OFF64_T_DECLARED with off64_t data type being available + * for consumption. But, off64_t data type is not recognizable + * for FreeBSD versions less than 11. Hence, int64_t is typedefed + * to off64_t. + */ +#define _OFF64_T_DECLARED +typedef int64_t off64_t; +#endif /* _OFF64_T_DECLARED */ +#endif /* GF_BSD_HOST_OS */ #if defined(HAVE_SYS_ACL_H) || (defined(USE_POSIX_ACLS) && USE_POSIX_ACLS) #include @@ -371,6 +415,116 @@ struct glfs_fd; typedef struct glfs_fd glfs_fd_t; +/* + * Mask for request/result items in the struct glfs_stat. + * + * Query request/result mask for glfs_stat() (family of functions) and + * struct glfs_stat::glfs_st_mask. + * + * These bits should be set in the mask argument of glfs_stat() (family of + * functions) to request particular items when calling glfs_stat(). + * + * NOTE: Lower order 32 bits are used to reflect statx(2) bits. For Gluster + * specific attrs/extensions, use higher order 32 bits. + * + */ +#define GLFS_STAT_TYPE 0x0000000000000001U /* Want/got stx_mode & S_IFMT */ +#define GLFS_STAT_MODE 0x0000000000000002U /* Want/got stx_mode & ~S_IFMT */ +#define GLFS_STAT_NLINK 0x0000000000000004U /* Want/got stx_nlink */ +#define GLFS_STAT_UID 0x0000000000000008U /* Want/got stx_uid */ +#define GLFS_STAT_GID 0x0000000000000010U /* Want/got stx_gid */ +#define GLFS_STAT_ATIME 0x0000000000000020U /* Want/got stx_atime */ +#define GLFS_STAT_MTIME 0x0000000000000040U /* Want/got stx_mtime */ +#define GLFS_STAT_CTIME 0x0000000000000080U /* Want/got stx_ctime */ +#define GLFS_STAT_INO 0x0000000000000100U /* Want/got stx_ino */ +#define GLFS_STAT_SIZE 0x0000000000000200U /* Want/got stx_size */ +#define GLFS_STAT_BLOCKS 0x0000000000000400U /* Want/got stx_blocks */ +#define GLFS_STAT_BASIC_STATS \ + 0x00000000000007ffU /* Items in the normal stat struct */ +#define GLFS_STAT_BTIME 0x0000000000000800U /* Want/got stx_btime */ +#define GLFS_STAT_ALL 0x0000000000000fffU /* All currently supported flags */ +#define GLFS_STAT_RESERVED \ + 0x8000000000000000U /* Reserved to denote future expansion */ + +/* Macros for checking validity of struct glfs_stat members.*/ +#define GLFS_STAT_TYPE_VALID(stmask) (stmask & GLFS_STAT_TYPE) +#define GLFS_STAT_MODE_VALID(stmask) (stmask & GLFS_STAT_MODE) +#define GLFS_STAT_NLINK_VALID(stmask) (stmask & GLFS_STAT_NLINK) +#define GLFS_STAT_UID_VALID(stmask) (stmask & GLFS_STAT_UID) +#define GLFS_STAT_GID_VALID(stmask) (stmask & GLFS_STAT_GID) +#define GLFS_STAT_ATIME_VALID(stmask) (stmask & GLFS_STAT_ATIME) +#define GLFS_STAT_MTIME_VALID(stmask) (stmask & GLFS_STAT_MTIME) +#define GLFS_STAT_CTIME_VALID(stmask) (stmask & GLFS_STAT_CTIME) +#define GLFS_STAT_INO_VALID(stmask) (stmask & GLFS_STAT_INO) +#define GLFS_STAT_SIZE_VALID(stmask) (stmask & GLFS_STAT_SIZE) +#define GLFS_STAT_BLOCKS_VALID(stmask) (stmask & GLFS_STAT_BLOCKS) +#define GLFS_STAT_BTIME_VALID(stmask) (stmask & GLFS_STAT_BTIME) +#define GLFS_STAT_GFID_VALID(stmask) (stmask & GLFS_STAT_GFID) + +/* + * Attributes to be found in glfs_st_attributes and masked in + * glfs_st_attributes_mask. + * + * These give information about the features or the state of a file that might + * be of use to programs. + * + * NOTE: Lower order 32 bits are used to reflect statx(2) attribute bits. For + * Gluster specific attrs, use higher order 32 bits. + * + * NOTE: We do not support any file attributes or state as yet! + */ +#define GLFS_STAT_ATTR_RESERVED \ + 0x8000000000000000U /* Reserved to denote future expansion */ + +/* Extended file attribute structure. + * + * The caller passes a mask of what they're specifically interested in as a + * parameter to glfs_stat(). What glfs_stat() actually got will be indicated + * in glfs_st_mask upon return. + * + * For each bit in the mask argument: + * + * - if the datum is not supported: + * + * - the bit will be cleared, and + * + * - the datum value is undefined + * + * - otherwise, if explicitly requested: + * + * - the field will be filled in and the bit will be set; + * + * - otherwise, if not requested, but available in, it will be filled in + * anyway, and the bit will be set upon return; + * + * - otherwise the field and the bit will be cleared before returning. + * + */ + +struct glfs_stat { + uint64_t glfs_st_mask; /* What results were written [uncond] */ + uint64_t glfs_st_attributes; /* Flags conveying information about the file + [uncond] */ + uint64_t glfs_st_attributes_mask; /* Mask to show what's supported in + st_attributes [ucond] */ + struct timespec glfs_st_atime; /* Last access time */ + struct timespec glfs_st_btime; /* File creation time */ + struct timespec glfs_st_ctime; /* Last attribute change time */ + struct timespec glfs_st_mtime; /* Last data modification time */ + ino_t glfs_st_ino; /* Inode number */ + off_t glfs_st_size; /* File size */ + blkcnt_t glfs_st_blocks; /* Number of 512-byte blocks allocated */ + uint32_t glfs_st_rdev_major; /* Device ID of special file [if bdev/cdev] */ + uint32_t glfs_st_rdev_minor; + uint32_t glfs_st_dev_major; /* ID of device containing file [uncond] */ + uint32_t glfs_st_dev_minor; + blksize_t glfs_st_blksize; /* Preferred general I/O size [uncond] */ + nlink_t glfs_st_nlink; /* Number of hard links */ + uid_t glfs_st_uid; /* User ID of owner */ + gid_t glfs_st_gid; /* Group ID of owner */ + mode_t glfs_st_mode; /* File mode */ +}; + #define GLFS_LEASE_ID_SIZE 16 /* 128bits */ typedef char glfs_leaseid_t[GLFS_LEASE_ID_SIZE]; @@ -504,9 +658,14 @@ time of issuing the async IO call. This can be used by the caller to differentiate different instances of the async requests in a common callback function. + + @prestat and @poststat are allocated on the stack, that are auto destroyed + post the callback function returns. */ -typedef void (*glfs_io_cbk)(glfs_fd_t *fd, ssize_t ret, void *data); +typedef void (*glfs_io_cbk)(glfs_fd_t *fd, ssize_t ret, + struct glfs_stat *prestat, + struct glfs_stat *poststat, void *data); // glfs_{read,write}[_async] @@ -521,12 +680,12 @@ int glfs_read_async(glfs_fd_t *fd, void *buf, size_t count, int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_read_async, 3.4.0); + GFAPI_PUBLIC(glfs_read_async, 6.0); int glfs_write_async(glfs_fd_t *fd, const void *buf, size_t count, int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_write_async, 3.4.0); + GFAPI_PUBLIC(glfs_write_async, 6.0); // glfs_{read,write}v[_async] @@ -541,32 +700,33 @@ int glfs_readv_async(glfs_fd_t *fd, const struct iovec *iov, int count, int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_readv_async, 3.4.0); + GFAPI_PUBLIC(glfs_readv_async, 6.0); int glfs_writev_async(glfs_fd_t *fd, const struct iovec *iov, int count, int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_writev_async, 3.4.0); + GFAPI_PUBLIC(glfs_writev_async, 6.0); // glfs_p{read,write}[_async] ssize_t -glfs_pread(glfs_fd_t *fd, void *buf, size_t count, off_t offset, - int flags) __THROW GFAPI_PUBLIC(glfs_pread, 3.4.0); +glfs_pread(glfs_fd_t *fd, void *buf, size_t count, off_t offset, int flags, + struct glfs_stat *poststat) __THROW GFAPI_PUBLIC(glfs_pread, 6.0); ssize_t glfs_pwrite(glfs_fd_t *fd, const void *buf, size_t count, off_t offset, - int flags) __THROW GFAPI_PUBLIC(glfs_pwrite, 3.4.0); + int flags, struct glfs_stat *prestat, + struct glfs_stat *poststat) __THROW GFAPI_PUBLIC(glfs_pwrite, 6.0); int glfs_pread_async(glfs_fd_t *fd, void *buf, size_t count, off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_pread_async, 3.4.0); + GFAPI_PUBLIC(glfs_pread_async, 6.0); int glfs_pwrite_async(glfs_fd_t *fd, const void *buf, int count, off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_pwrite_async, 3.4.0); + GFAPI_PUBLIC(glfs_pwrite_async, 6.0); // glfs_p{read,write}v[_async] @@ -581,29 +741,38 @@ int glfs_preadv_async(glfs_fd_t *fd, const struct iovec *iov, int count, off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_preadv_async, 3.4.0); + GFAPI_PUBLIC(glfs_preadv_async, 6.0); int glfs_pwritev_async(glfs_fd_t *fd, const struct iovec *iov, int count, off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_pwritev_async, 3.4.0); + GFAPI_PUBLIC(glfs_pwritev_async, 6.0); off_t glfs_lseek(glfs_fd_t *fd, off_t offset, int whence) __THROW GFAPI_PUBLIC(glfs_lseek, 3.4.0); +ssize_t +glfs_copy_file_range(struct glfs_fd *glfd_in, off64_t *off_in, + struct glfs_fd *glfd_out, off64_t *off_out, size_t len, + unsigned int flags, struct glfs_stat *statbuf, + struct glfs_stat *prestat, + struct glfs_stat *poststat) __THROW + GFAPI_PUBLIC(glfs_copy_file_range, 6.0); + int glfs_truncate(glfs_t *fs, const char *path, off_t length) __THROW GFAPI_PUBLIC(glfs_truncate, 3.7.15); int -glfs_ftruncate(glfs_fd_t *fd, off_t length) __THROW - GFAPI_PUBLIC(glfs_ftruncate, 3.4.0); +glfs_ftruncate(glfs_fd_t *fd, off_t length, struct glfs_stat *prestat, + struct glfs_stat *poststat) __THROW + GFAPI_PUBLIC(glfs_ftruncate, 6.0); int glfs_ftruncate_async(glfs_fd_t *fd, off_t length, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_ftruncate_async, 3.4.0); + GFAPI_PUBLIC(glfs_ftruncate_async, 6.0); int glfs_lstat(glfs_t *fs, const char *path, struct stat *buf) __THROW @@ -618,18 +787,21 @@ GFAPI_PUBLIC(glfs_fstat, 3.4.0); int -glfs_fsync(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_fsync, 3.4.0); +glfs_fsync(glfs_fd_t *fd, struct glfs_stat *prestat, + struct glfs_stat *poststat) __THROW GFAPI_PUBLIC(glfs_fsync, 6.0); int glfs_fsync_async(glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_fsync_async, 3.4.0); + GFAPI_PUBLIC(glfs_fsync_async, 6.0); int -glfs_fdatasync(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_fdatasync, 3.4.0); +glfs_fdatasync(glfs_fd_t *fd, struct glfs_stat *prestat, + struct glfs_stat *poststat) __THROW + GFAPI_PUBLIC(glfs_fdatasync, 6.0); int glfs_fdatasync_async(glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_fdatasync_async, 3.4.0); + GFAPI_PUBLIC(glfs_fdatasync_async, 6.0); int glfs_access(glfs_t *fs, const char *path, int mode) __THROW @@ -811,7 +983,7 @@ int glfs_discard_async(glfs_fd_t *fd, off_t length, size_t lent, glfs_io_cbk fn, - void *data) __THROW GFAPI_PUBLIC(glfs_discard_async, 3.5.0); + void *data) __THROW GFAPI_PUBLIC(glfs_discard_async, 6.0); int glfs_zerofill(glfs_fd_t *fd, off_t offset, off_t len) __THROW @@ -819,8 +991,7 @@ int glfs_zerofill_async(glfs_fd_t *fd, off_t length, off_t len, glfs_io_cbk fn, - void *data) __THROW - GFAPI_PUBLIC(glfs_zerofill_async, 3.5.0); + void *data) __THROW GFAPI_PUBLIC(glfs_zerofill_async, 6.0); char * glfs_getcwd(glfs_t *fs, char *buf, size_t size) __THROW @@ -1233,5 +1404,54 @@ glfs_lease(glfs_fd_t *glfd, glfs_lease_t *lease, glfs_recall_cbk fn, void *data) __THROW GFAPI_PUBLIC(glfs_lease, 4.0.0); +/* + SYNOPSIS + + glfs_fsetattr: Function to set attributes. + glfs_setattr: Function to set attributes + + DESCRIPTION + + The functions are used to set attributes on the file. + + PARAMETERS + + @glfs_fsetattr + + @glfd: The fd of the file for which the attributes are to be set, + this fd is returned by glfs_open/glfs_create. + + @glfs_setattr + + @fs: File object. + + @path: The path of the file that is being operated on. + + @follow: Flag used to resolve symlink. + + + @stat: Struct that has information about the file. + + @valid: This is the mask bit, that accepts GFAPI_SET_ATTR* masks. + Refer glfs.h to see the mask definitions. + + Both functions are similar in functionality, just that the + func setattr() uses file path whereas the func fsetattr() + uses the fd. + + RETURN VALUES + 0: Successful completion + <0: Failure. @errno will be set with the type of failure + + */ + +int +glfs_fsetattr(struct glfs_fd *glfd, struct glfs_stat *stat) __THROW + GFAPI_PUBLIC(glfs_fsetattr, 6.0); + +int +glfs_setattr(struct glfs *fs, const char *path, struct glfs_stat *stat, + int follow) __THROW GFAPI_PUBLIC(glfs_setattr, 6.0); + __END_DECLS #endif /* !_GLFS_H */ diff -Nru glusterfs-5.5/api/src/glfs-handleops.c glusterfs-6.3/api/src/glfs-handleops.c --- glusterfs-5.5/api/src/glfs-handleops.c 2019-03-15 13:23:38.362461659 +0000 +++ glusterfs-6.3/api/src/glfs-handleops.c 2019-06-11 13:14:55.546110030 +0000 @@ -10,7 +10,7 @@ #include "glfs-internal.h" #include "glfs-mem-types.h" -#include "syncop.h" +#include #include "glfs.h" #include "glfs-handles.h" #include "gfapi-messages.h" @@ -18,7 +18,7 @@ int glfs_listxattr_process(void *value, size_t size, dict_t *xattr); -static void +void glfs_iatt_from_stat(struct stat *stat, int valid, struct iatt *iatt, int *glvalid) { @@ -2267,7 +2267,7 @@ GFAPI_SYMVER_PUBLIC(glfs_h_poll_upcall370, glfs_h_poll_upcall, 3.7.0); #ifdef HAVE_ACL_LIBACL_H -#include "glusterfs-acl.h" +#include #include int diff -Nru glusterfs-5.5/api/src/glfs-handles.h glusterfs-6.3/api/src/glfs-handles.h --- glusterfs-5.5/api/src/glfs-handles.h 2019-03-15 13:23:38.363461661 +0000 +++ glusterfs-6.3/api/src/glfs-handles.h 2019-06-11 13:14:55.546110030 +0000 @@ -12,7 +12,6 @@ #define _GLFS_HANDLES_H #include "glfs.h" -#include /* GLFS OBJECT BASED OPERATIONS * @@ -47,16 +46,6 @@ * */ -/* Values for valid flags to be used when using XXXsetattr, to set multiple - attribute values passed via the related stat structure. - */ -#define GFAPI_SET_ATTR_MODE 0x1 -#define GFAPI_SET_ATTR_UID 0x2 -#define GFAPI_SET_ATTR_GID 0x4 -#define GFAPI_SET_ATTR_SIZE 0x8 -#define GFAPI_SET_ATTR_ATIME 0x10 -#define GFAPI_SET_ATTR_MTIME 0x20 - /* Handle length for object handles returned from glfs_h_extract_handle or * glfs_h_create_from_handle */ #define GFAPI_HANDLE_LENGTH 16 diff -Nru glusterfs-5.5/api/src/glfs-internal.h glusterfs-6.3/api/src/glfs-internal.h --- glusterfs-5.5/api/src/glfs-internal.h 2019-03-15 13:23:38.363461661 +0000 +++ glusterfs-6.3/api/src/glfs-internal.h 2019-06-11 13:14:55.546110030 +0000 @@ -11,11 +11,11 @@ #ifndef _GLFS_INTERNAL_H #define _GLFS_INTERNAL_H -#include "xlator.h" -#include "glusterfs.h" -#include "upcall-utils.h" +#include +#include +#include #include "glfs-handles.h" -#include "refcount.h" +#include #define GLFS_SYMLINK_MAX_FOLLOW 2048 @@ -522,6 +522,9 @@ glfs_loc_touchup(loc_t *loc) GFAPI_PRIVATE(glfs_loc_touchup, 3.4.0); void glfs_iatt_to_stat(struct glfs *fs, struct iatt *iatt, struct stat *stat); +void +glfs_iatt_from_stat(struct stat *stat, int valid, struct iatt *iatt, + int *gvalid); int glfs_loc_link(loc_t *loc, struct iatt *iatt); int @@ -667,4 +670,42 @@ void unset_fop_attr(dict_t **fop_attr); + +/* + SYNOPSIS + glfs_statx: Fetch extended file attributes for the given path. + + DESCRIPTION + This function fetches extended file attributes for the given path. + + PARAMETERS + @fs: The 'virtual mount' object referencing a volume, under which file exists. + @path: Path of the file within the virtual mount. + @mask: Requested extended file attributes mask, (See mask defines above) + + RETURN VALUES + -1 : Failure. @errno will be set with the type of failure. + 0 : Filled in statxbuf with appropriate masks for valid items in the + structure. + + ERRNO VALUES + EINVAL: fs is invalid + EINVAL: mask has unsupported bits set + Other errors as returned by stat(2) + */ + +int +glfs_statx(struct glfs *fs, const char *path, unsigned int mask, + struct glfs_stat *statxbuf) GFAPI_PRIVATE(glfs_statx, 6.0); + +void +glfs_iatt_from_statx(struct iatt *, const struct glfs_stat *) + GFAPI_PRIVATE(glfs_iatt_from_statx, 6.0); + +/* + * This API is a per thread setting, similar to glfs_setfs{u/g}id, because of + * the call to syncopctx_setfspid. + */ +int +glfs_setfspid(struct glfs *, pid_t) GFAPI_PRIVATE(glfs_setfspid, 6.1); #endif /* !_GLFS_INTERNAL_H */ diff -Nru glusterfs-5.5/api/src/glfs-master.c glusterfs-6.3/api/src/glfs-master.c --- glusterfs-5.5/api/src/glfs-master.c 2019-03-15 13:23:38.363461661 +0000 +++ glusterfs-6.3/api/src/glfs-master.c 2019-06-11 13:14:55.547110033 +0000 @@ -15,8 +15,8 @@ #include #include -#include "xlator.h" -#include "glusterfs.h" +#include +#include #include "glfs-internal.h" #include "glfs-mem-types.h" @@ -169,6 +169,21 @@ struct xlator_fops fops; -struct xlator_cbks cbks = {.forget = glfs_forget, - .release = glfs_release, - .releasedir = glfs_releasedir}; +struct xlator_cbks cbks = { + .forget = glfs_forget, + .release = glfs_release, + .releasedir = glfs_releasedir, +}; + +xlator_api_t xlator_api = { + .init = init, + .fini = fini, + .notify = notify, + .mem_acct_init = mem_acct_init, + .op_version = {1}, + .dumpops = &dumpops, + .fops = &fops, + .cbks = &cbks, + .identifier = "glfs-api", + .category = GF_MAINTAINED, +}; diff -Nru glusterfs-5.5/api/src/glfs-mem-types.h glusterfs-6.3/api/src/glfs-mem-types.h --- glusterfs-5.5/api/src/glfs-mem-types.h 2019-03-15 13:23:38.363461661 +0000 +++ glusterfs-6.3/api/src/glfs-mem-types.h 2019-06-11 13:14:55.547110033 +0000 @@ -11,7 +11,7 @@ #ifndef _GLFS_MEM_TYPES_H #define _GLFS_MEM_TYPES_H -#include "mem-types.h" +#include #define GF_MEM_TYPE_START (gf_common_mt_end + 1) diff -Nru glusterfs-5.5/api/src/glfs-mgmt.c glusterfs-6.3/api/src/glfs-mgmt.c --- glusterfs-5.5/api/src/glfs-mgmt.c 2019-03-15 13:23:38.363461661 +0000 +++ glusterfs-6.3/api/src/glfs-mgmt.c 2019-06-11 13:14:55.547110033 +0000 @@ -15,11 +15,11 @@ #include #include -#include "glusterfs.h" +#include #include "glfs.h" -#include "dict.h" -#include "gf-event.h" -#include "defaults.h" +#include +#include +#include #include "rpc-clnt.h" #include "protocol-common.h" @@ -29,13 +29,13 @@ #include "xdr-generic.h" #include "rpc-common-xdr.h" -#include "syncop.h" -#include "xlator.h" +#include +#include #include "glfs-internal.h" #include "glfs-mem-types.h" #include "gfapi-messages.h" -#include "syscall.h" +#include int glfs_volfile_fetch(struct glfs *fs); @@ -697,9 +697,9 @@ * volfile if topology hasn't changed. * glusterfs_volfile_reconfigure returns 3 possible return states * return 0 =======> reconfiguration of options has succeeded - * return 1 =======> the graph has to be reconstructed and all the - * xlators should be inited return -1(or -ve) =======> Some Internal Error - * occurred during the operation + * return 1 =======> the graph has to be reconstructed and all + * the xlators should be inited return -1(or -ve) =======> Some Internal + * Error occurred during the operation */ pthread_mutex_lock(&fs->mutex); @@ -1031,7 +1031,10 @@ !strcmp(cmd_args->volfile_server_transport, "unix")) { ret = rpc_transport_unix_options_build(&options, host, 0); } else { - ret = rpc_transport_inet_options_build(&options, host, port); + xlator_cmdline_option_t *opt = find_xlator_option_in_cmd_args_t( + "address-family", cmd_args); + ret = rpc_transport_inet_options_build(&options, host, port, + (opt ? opt->value : NULL)); } if (ret) diff -Nru glusterfs-5.5/api/src/glfs-resolve.c glusterfs-6.3/api/src/glfs-resolve.c --- glusterfs-5.5/api/src/glfs-resolve.c 2019-03-15 13:23:38.364461663 +0000 +++ glusterfs-6.3/api/src/glfs-resolve.c 2019-06-11 13:14:55.548110036 +0000 @@ -15,16 +15,16 @@ #include #include -#include "glusterfs.h" -#include "logging.h" -#include "stack.h" -#include "gf-event.h" +#include +#include +#include +#include #include "glfs-mem-types.h" -#include "common-utils.h" -#include "syncop.h" -#include "call-stub.h" +#include +#include +#include #include "gfapi-messages.h" -#include "inode.h" +#include #include "glfs-internal.h" #define graphid_str(subvol) \ @@ -349,7 +349,7 @@ } else if (__is_root_gfid(loc.inode->gfid)) { inode_unref(loc.parent); loc.parent = inode_ref(loc.inode); - loc.name = ""; + loc.name = "."; } else { inode_unref(loc.inode); loc.inode = NULL; @@ -730,7 +730,7 @@ return fd_ref(oldfd); if (!oldsubvol->switched) { - ret = syncop_fsync(oldsubvol, oldfd, 0, NULL, NULL); + ret = syncop_fsync(oldsubvol, oldfd, 0, NULL, NULL, NULL, NULL); DECODE_SYNCOP_ERR(ret); if (ret) { gf_msg(fs->volname, GF_LOG_WARNING, errno, API_MSG_FSYNC_FAILED, diff -Nru glusterfs-5.5/api/src/Makefile.am glusterfs-6.3/api/src/Makefile.am --- glusterfs-5.5/api/src/Makefile.am 2019-03-15 13:23:38.361461656 +0000 +++ glusterfs-6.3/api/src/Makefile.am 2019-06-11 13:14:55.543110021 +0000 @@ -19,7 +19,7 @@ -I$(top_srcdir)/rpc/xdr/src \ -I$(top_builddir)/rpc/xdr/src \ -DDATADIR=\"$(localstatedir)\" \ - -D__USE_FILE_OFFSET64 + -D__USE_FILE_OFFSET64 -D__USE_LARGEFILE64 AM_CFLAGS = -Wall $(GF_CFLAGS) diff -Nru glusterfs-5.5/api/src/Makefile.in glusterfs-6.3/api/src/Makefile.in --- glusterfs-5.5/api/src/Makefile.in 2019-03-15 13:23:46.169479181 +0000 +++ glusterfs-6.3/api/src/Makefile.in 2019-06-11 13:15:01.975129250 +0000 @@ -216,6 +216,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_GNFS = @BUILD_GNFS@ BUILD_PYTHON_SITE_PACKAGES = @BUILD_PYTHON_SITE_PACKAGES@ BUILD_PYTHON_SITE_PACKAGES_EXPANDED = @BUILD_PYTHON_SITE_PACKAGES_EXPANDED@ CC = @CC@ @@ -256,9 +257,6 @@ GF_NO_UNDEFINED = @GF_NO_UNDEFINED@ GF_XLATOR_DEFAULT_LDFLAGS = @GF_XLATOR_DEFAULT_LDFLAGS@ GF_XLATOR_LDFLAGS = @GF_XLATOR_LDFLAGS@ -GLUPY_SUBDIR = @GLUPY_SUBDIR@ -GLUPY_SUBDIR_MAKEFILE = @GLUPY_SUBDIR_MAKEFILE@ -GLUPY_SUBDIR_SRC_MAKEFILE = @GLUPY_SUBDIR_SRC_MAKEFILE@ GLUSTERD_VOLFILE = @GLUSTERD_VOLFILE@ GLUSTERD_WORKDIR = @GLUSTERD_WORKDIR@ GLUSTERFSD_MISCDIR = @GLUSTERFSD_MISCDIR@ @@ -285,7 +283,6 @@ LIBAIO = @LIBAIO@ LIBGFCHANGELOG_LT_VERSION = @LIBGFCHANGELOG_LT_VERSION@ LIBGFCHANGELOG_VERSION = @LIBGFCHANGELOG_VERSION@ -LIBGFDB_VERSION = @LIBGFDB_VERSION@ LIBGFRPC_LT_VERSION = @LIBGFRPC_LT_VERSION@ LIBGFXDR_LT_VERSION = @LIBGFXDR_LT_VERSION@ LIBGLUSTERFS_LT_VERSION = @LIBGLUSTERFS_LT_VERSION@ @@ -339,8 +336,6 @@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_LONG_LONG = @SIZEOF_LONG_LONG@ SIZEOF_SHORT = @SIZEOF_SHORT@ -SQLITE_CFLAGS = @SQLITE_CFLAGS@ -SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ SYNCDAEMON_COMPILE = @SYNCDAEMON_COMPILE@ SYNCDAEMON_SUBDIR = @SYNCDAEMON_SUBDIR@ @@ -452,7 +447,7 @@ -I$(top_srcdir)/rpc/xdr/src \ -I$(top_builddir)/rpc/xdr/src \ -DDATADIR=\"$(localstatedir)\" \ - -D__USE_FILE_OFFSET64 + -D__USE_FILE_OFFSET64 -D__USE_LARGEFILE64 AM_CFLAGS = -Wall $(GF_CFLAGS) xlator_LTLIBRARIES = api.la diff -Nru glusterfs-5.5/autogen.sh glusterfs-6.3/autogen.sh --- glusterfs-5.5/autogen.sh 2019-03-15 13:23:38.365461665 +0000 +++ glusterfs-6.3/autogen.sh 2019-06-11 13:14:55.549110039 +0000 @@ -85,7 +85,7 @@ echo Running ${AUTOCONF}... $AUTOCONF echo Running ${AUTOMAKE}... -$AUTOMAKE --add-missing --force-missing --copy --foreign +$AUTOMAKE --add-missing --force-missing --copy # Instruct user on next steps echo diff -Nru glusterfs-5.5/ChangeLog glusterfs-6.3/ChangeLog --- glusterfs-5.5/ChangeLog 2019-03-15 13:24:35.332589552 +0000 +++ glusterfs-6.3/ChangeLog 2019-06-11 13:15:47.345264894 +0000 @@ -1,1930 +1,10103 @@ ===== git log ==== -commit 0901b43f84f72803cc6125ce047077f2571e608d -Author: ShyamsundarR -Date: Fri Mar 15 08:55:30 2019 -0400 +commit 9acd89087baea32b06142d51568df78e0ce57d54 +Author: Hari Gowtham +Date: Sat Jun 8 20:28:10 2019 +0530 - doc: Added release notes for 5.5 + doc: Added release notes for 6.3 - Fixes: bz#1689214 - Change-Id: I57a1afa2649828d0399fab2bf163a05cf35358db - Signed-off-by: ShyamsundarR + Fixes: bz#1718555 + + Change-Id: Ibe540110156d70dc1bf308eccd08d49339f4ef7a + Signed-off-by: Hari Gowtham -commit c2a48920015f7b2d5516858d2ed4bb05e0e6f9d9 -Author: Aravinda VK -Date: Mon Mar 4 13:39:18 2019 +0530 +commit 7a387f97315f55e1c741d6ad749fb5621f067de0 +Author: Xavi Hernandez +Date: Thu May 9 11:07:18 2019 +0200 - eventsapi: Fix error while handling GlusterCmdException + cluster/ec: honor contention notifications for partially acquired locks - `GlusterCmdException` was wrongly accessed instead of accessing - `GlusterCmdException.message`. + EC was ignoring lock contention notifications received while a lock was + being acquired. When a lock is partially acquired (some bricks have + granted the lock but some others not yet) we can receive notifications + from acquired bricks, which should be honored, since we may not receive + more notifications after that. + + Since EC was ignoring them, once the lock was acquired, it was not + released until the eager-lock timeout, causing unnecessary delays on + other clients. + + This fix takes into consideration the notifications received before + having completed the full lock acquisition. After that, the lock will + be releaed as soon as possible. - Fixes: bz#1687249 - Change-Id: I35ec1b05726050bfd8761e05ad9b9e47917dc0c6 - Signed-off-by: Aravinda VK - (cherry picked from commit 27f6375df009c8c4798b72aeafce79456007d21f) + Backport of: + > BUG: bz#1708156 + > Change-Id: I2a306dbdb29fb557dcab7788a258bd75d826cc12 + > Signed-off-by: Xavi Hernandez + + Fixes: bz#1714172 + Change-Id: I2a306dbdb29fb557dcab7788a258bd75d826cc12 + Signed-off-by: Xavi Hernandez -commit a086c6473875ab94a4a08baf454eac567f575b06 -Author: karthik-us -Date: Thu Mar 7 22:26:49 2019 +0530 +commit 8c0bb45c9f002461d5c4a63e35ae215958405fb5 +Author: Amgad Saleh +Date: Thu May 23 20:27:03 2019 -0500 - cluster/afr: Send truncate on arbiter brick from SHD - - Problem: - In an arbiter volume configuration SHD will not send any writes onto the arbiter - brick even if there is data pending marker for the arbiter brick. If we have a - arbiter setup on the geo-rep master and there are data pending markers for the files - on arbiter brick, SHD will not mark any data changelog during healing. While syncing - the data from master to slave, if the arbiter-brick is considered as ACTIVE, then - there is a chance that slave will miss out some data. If the arbiter brick is being - newly added or replaced there is a chance of slave missing all the data during sync. + If bind-address is IPv6 return it successfully - Fix: - If there is data pending marker for the arbiter brick, send truncate on the arbiter - brick during heal, so that it will record truncate as the data transaction in changelog. + >Change-Id: Ibd37b6ea82b781a1a266b95f7596874134f30079 + >fixes: bz#1713730 + >Signed-off-by: Amgad Saleh - Change-Id: I3242ba6cea6da495c418ef860d9c3359c5459dec - fixes: bz#1687687 - Signed-off-by: karthik-us + fixes: bz#1715012 + Change-Id: I9a9877b6c32a1ccbd119301a4225808ddaa02de4 + Signed-off-by: Hari Gowtham -commit a00953ed212a7071b152c4afccd35b92fa5a682a -Author: Sanju Rakonde -Date: Mon Mar 4 16:53:01 2019 +0530 +commit 630b896166fe7d718958bcf57faad4985572ea05 +Author: Hari Gowtham +Date: Thu May 23 17:13:04 2019 +0530 - core: make compute_cksum function op_version compatible + doc: Added release notes for 6.2 - Problem: commit 5a152a changed the mechansim of computing the - checksum. In heterogeneous cluster, peers are running into - rejected state because we have different cksum computation - mechansims in upgraded and non-upgraded nodes. + Fixes: bz#1701203 - Solution: add a check for op-version so that all the nodes - in the cluster follow the same mechanism for computing the - cksum. + Change-Id: Id105192610726e370fa977df2c29723201b94695 + Signed-off-by: Hari Gowtham + +commit fa8c8a3fa8bc217bc869fb3db09cb49c6457e402 +Author: Kotresh HR +Date: Tue May 14 11:05:45 2019 +0530 + + geo-rep: Convert gfid conflict resolutiong logs into debug - fixes: bz#1684569 + The gfid conflict resolution code path is not supposed + to hit in generic code path. But few of the heavy rename + workload (BUG: 1694820) makes it a generic case. So + logging the entries to be fixed as INFO floods the log + in these particular workloads. Hence convert them to DEBUG. - > Change-Id: I1508f000e8c9895588b6011b8b6cc0eda7102193 - > BUG: bz#1685120 - > Signed-off-by: Sanju Rakonde + Backport of: + > Patch: https://review.gluster.org/22720 + > BUG: 1709653 + > Change-Id: I4d5e102b87be5fe5b54f78f329e588882d72b9d9 + > Signed-off-by: Kotresh HR - Change-Id: I1508f000e8c9895588b6011b8b6cc0eda7102193 - Signed-off-by: Sanju Rakonde + fixes: bz#1712223 + Change-Id: I4d5e102b87be5fe5b54f78f329e588882d72b9d9 + Signed-off-by: Kotresh HR -commit 8fb4631c65f28dd0a5e0304386efff3c807e64a4 -Author: Amar Tumballi -Date: Tue Mar 5 08:39:16 2019 +0530 +commit 60df33ab0b7d57e3945d70ed933a5091c4d0b86c +Author: Kotresh HR +Date: Wed May 8 11:26:06 2019 +0530 - dict: handle STR_OLD data type in xdr conversions + geo-rep: Fix sync hang with tarssh - Currently a dict conversion on wire for 3.x protocol happens using - `dict_unserialize()`, which sets the type of data as STR_OLD. But the - new protocol doesn't send it over the wire as its not considered as a - valid format in new processes. + Problem: + Geo-rep sync hangs when tarssh is used as sync + engine at heavy workload. - But considering we deal with old and new protocol when we do a rolling - upgrade, it will allow us to get all the information properly with new - protocol. + Analysis and Root cause: + It's found out that the tar process was hung. + When debugged further, it's found out that stderr + buffer of tar process on master was full i.e., 64k. + When the buffer was copied to a file from /proc/pid/fd/2, + the hang is resolved. + + This can happen when files picked by tar process + to sync doesn't exist on master anymore. If this count + increases around 1k, the stderr buffer is filled up. - Credits: Krutika Dhananjay + Fix: + The tar process is executed using Popen with stderr as PIPE. + The final execution is something like below. - Fixes: bz#1684385 - Change-Id: I165c0021fb195b399790b9cf14a7416ae75ec84f - Signed-off-by: Amar Tumballi - -commit c691b4a373506dd2e197d2803c67e9c55bddff2e -Author: ShyamsundarR -Date: Tue Feb 26 09:20:56 2019 -0500 - - doc: Added release notes for release 5.4 + tar | ssh root@slave tar --overwrite -xf - -C - Change-Id: I6aaa93edc4ae7d018c83c5d23d536075c013d0b5 - fixes: bz#1667103 - Signed-off-by: ShyamsundarR + It was waiting on ssh process first using communicate() and then tar. + Note that communicate() reads stdout and stderr. So when stderr of tar + process is filled up, there is no one to read until untar via ssh is + completed. This can't happen and leads to deadlock. + Hence we should be waiting on both process parallely, so that stderr is + read on both processes. + + Backport of: + > Patch: https://review.gluster.org/22684/ + > Change-Id: I609c7cc5c07e210c504771115b4d551a2e891adf + > BUG: 1707728 + > Signed-off-by: Kotresh HR + + Change-Id: I609c7cc5c07e210c504771115b4d551a2e891adf + fixes: bz#1709738 + Signed-off-by: Kotresh HR -commit e54a8ee281010106e46f67f80494da8cf80908e5 -Author: Aravinda VK -Date: Thu Feb 21 11:25:55 2019 +0530 +commit d6f523927bdd5d8914650aae7bd6e6f69e91b49f +Author: Kotresh HR +Date: Wed May 8 14:10:05 2019 +0530 - eventsapi: Fix Python3 compatibility issues + tests/geo-rep: Fix arequal checksum comparison - - Fixed Relative import and non-package import related issues. - - socketserver import issues fix - - Renamed installed directory name to `gfevents` from `events`(To - avoid any issues with other global libs) + The arequal checkusm comparison was always returning + as successful, eventhough, if it was not. Fixed the same. - Fixes: bz#1649054 - Change-Id: I3dc38bc92b23387a6dfbcc0ab8283178235bf756 - Signed-off-by: Aravinda VK - (cherry picked from commit cd68f7b88b9a2c9a4e4ff9fca61517384e54130a) + Backport of: + > Patch: https://review.gluster.org/22682 + > Change-Id: I5083da25c0954126e452d06311d2d376f8540555 + > BUG: 1707742 + > Signed-off-by: Kotresh HR + (cherry picked from commit 288cffd1ab7180cccfcdea36d0c469b9fa52108f) + + Change-Id: I5083da25c0954126e452d06311d2d376f8540555 + fixes: bz#1712220 + Signed-off-by: Kotresh HR -commit 15403f96941caab4a4aa96630e47a9e831d32302 -Author: Kaleb S. KEITHLEY -Date: Fri Feb 22 09:59:59 2019 -0500 +commit 072a21576a65b5b0b2597115280972376f076a91 +Author: Kotresh HR +Date: Wed May 8 10:56:31 2019 +0530 - packaging: Obsoleting glusterfs-gnfs for upgrade + geo-rep: Fix sync-method config - Master refs - > https://review.gluster.org/#/c/glusterfs/+/22253/ - > fixes: bz#1672711 - > Change-Id: Iad7194e788a8eeecd617614e9f8a1fe3264a384d - > Signed-off-by: Sahina Bose - > Signed-off-by: Jiffin Tony Thottan + Problem: + When 'use_tarssh' is set to true, it exits with successful + message but the default 'rsync' was used as sync-engine. + The new config 'sync-method' is not allowed to set from cli. + + Analysis and Fix: + The 'use_tarssh' config is deprecated with new + config framework and 'sync-method' is the new + config to choose sync-method i.e. tarssh or rsync. + This patch fixes the 'sync-method' config. The allowed + values are tarssh and rsync. - Fixes: bz#1679968 - Change-Id: Ib66d15953abb2645238f01c8ee9df54d2b35736a - Signed-off-by: Kaleb S. KEITHLEY - Signed-off-by: Jiffin Tony Thottan + Backport of: + > Patch: https://review.gluster.org/22683 + > Change-Id: I0edb0319cad0455b29e49f2f08a64ce324735e84 + > BUG: 1707686 + > Signed-off-by: Kotresh HR + + Change-Id: I0edb0319cad0455b29e49f2f08a64ce324735e84 + fixes: bz#1709737 + Signed-off-by: Kotresh HR -commit 155ebe4b5719f40b3feaf9fd8ff892cc10ad0e78 -Author: Milind Changire -Date: Sat Feb 23 18:58:48 2019 +0530 +commit 219c9bc92c721d49de78fd5a4d98aca7d3c66ad4 +Author: Sunny Kumar +Date: Tue Apr 2 12:38:09 2019 +0530 - socket: socket event handlers now return void + geo-rep: Fix rename with existing destination with same gfid Problem: - Returning any value from socket event handlers to the event sub-system - doesn't make sense since event sub-system cannot handle socket - sub-system errors. + Geo-rep fails to sync the rename properly if destination exists. + It results in source to be remained on slave causing more number of + files on slave. Also heavy rename workload like logrotate caused + lot of ESTALE errors + + Cause: + Geo-rep fails to sync rename if destination exists if creation + of source file also falls into single batch of changelogs being + processed. This is because, after fixing problematic gfids verifying + from master, while re-processing original entries, CREATE also was + re-processed causing more files on slave and rename to be failed. Solution: - Change return type of all socket event handlers to 'void' + Entries need to be removed from retrial list after fixing + problematic gfids on slave so that it's not re-created again on slave. + Also treat ESTALE as EEXIST so that the error is properly handled + verifying the op on master volume. - mainline: - > Reviewed-on: https://review.gluster.org/c/glusterfs/+/22221 + Backport of: + > Patch: https://review.gluster.org/22519/ + > Change-Id: I50cf289e06b997adddff0552bf2466d9201dd1f9 + > BUG: 1694820 + > Signed-off-by: Kotresh HR + > Signed-off-by: Sunny Kumar - Change-Id: I70dc2c57f12b7ea2fae41120f71aa0d7fe0b2b6f - Fixes: bz#1651246 - Signed-off-by: Milind Changire - (cherry picked from commit 776ba851c6ee6c265253d44cf1d6e4e3d4a21772) + Change-Id: I50cf289e06b997adddff0552bf2466d9201dd1f9 + fixes: bz#1709734 + Signed-off-by: Kotresh HR -commit 2620dbccccb63fba66384b17b47ddd8e784e8390 -Author: Amar Tumballi -Date: Tue Feb 12 14:41:49 2019 +0530 +commit 4a4710b81000e330fc655d95f068ea1112f1f4fb +Author: Kotresh HR +Date: Tue Apr 23 10:45:25 2019 +0530 - fuse: reflect the actual default for lru-limit option + geo-rep: Fix entries and metadata counters in geo-rep status - in both `--help` text and man page + Entries counter was incremented twice and decremented only + once. And entries count was being used in place of metadata + entries. This patch fixes both of them. - updates: bz#1667103 - Change-Id: I9aa9367c6863ac8e2403255280697c9e6be26cf0 - Signed-off-by: Amar Tumballi + Backport of: + > Patch: https://review.gluster.org/22603 + > BUG: 1512093 + > Change-Id: I5601a5fe8d25c9d65b72eb529171e7117ebbb67f + > Signed-off-by: Kotresh HR + (cherry picked from commit e0a6941af6ed352911698012ada895d1296b549e) + + fixes: bz#1709685 + Change-Id: I5601a5fe8d25c9d65b72eb529171e7117ebbb67f + Signed-off-by: Kotresh HR -commit 3c1368fda17b71a95edf1f4fe102e15f64820e3e -Author: Raghavendra Gowdappa -Date: Wed Feb 13 17:08:14 2019 +0530 +commit 84b2d080812247acf204468e8b25b09e65b464aa +Author: Pranith Kumar K +Date: Sun May 5 21:17:24 2019 +0530 - performance/write-behind: fix use-after-free in readdirp + cluster/ec: Reopen shouldn't happen with O_TRUNC - Two issues were found: - 1. in wb_readdirp_cbk, inode should unrefed after wb_inode is - unlocked. Otherwise, inode and hence the context wb_inode can be freed - by the type we try to unlock wb_inode - 2. wb_readdirp_mark_end iterates over a list of wb_inodes of children - of a directory. But inodes could've been freed and hence the list - might be corrupted. To fix take a reference on inode before adding it - to invalidate_list of parent. + Problem: + Doing re-open with O_TRUNC will truncate the fragment even when it is not + needed needing extra heals - Change-Id: I911b0e0b2060f7f41ded0b05db11af6f9b7c09c5 - Signed-off-by: Raghavendra Gowdappa - Updates: bz#1671556 - -commit ceee95dbc3c80d52134ceaee22e17c9f1c861300 -Author: Raghavendra Gowdappa -Date: Tue Feb 19 08:04:52 2019 +0530 - - performance/write-behind: handle call-stub leaks + Fix: + At the time of re-open don't use O_TRUNC. - Change-Id: I7be9a5f48dcad1b136c479c58b1dca1e0488166d - Signed-off-by: Raghavendra Gowdappa - Fixes: bz#1671556 - (cherry picked from commit 6175cb10cd5f59f3c7ae4100bc78f359b68ca3e9) + fixes bz#1709660 + Change-Id: Idc6408968efaad897b95a5a52481c66e843d3fb8 + Signed-off-by: Pranith Kumar K -commit f6c8b1771f71bec287437dbec2e3b2e4f5692ef6 -Author: David Spisla -Date: Tue Feb 19 14:56:11 2019 +0100 +commit 9f225fa2c419b3ecd17ac49bef6d727e1fc55fde +Author: Ravishankar N +Date: Tue Apr 9 09:44:33 2019 +0530 - md-cache: Adapt integer data types to avoid integer overflow + afr: thin-arbiter lock release fixes - The "struct iatt" in iatt.h is using int64_t types for storing - the atime, mtime and ctime. Therefore the struct 'struct md_cache' in - md-cache.c should also use this types to avoid an integer overflow. + - pass fop state instead of afr local to + afr_ta_dom_lock_check_and_release() - This can happen e.g. if someone uses a very high default-retention-period - in the WORM-Xlator. + - avoid afr_lock_release_synctask() being called simultaneosuly from + notify code path and transaction (post-op) code path due to races. - Change-Id: I605268d300ab622b9c8ab30e459dc00d9340aad1 - fixes: bz#1678726 - Signed-off-by: David Spisla - (cherry picked from commit 15423e14f16dd1a15ee5e5cbbdbdd370e57ed59f) + - Check if the post-op on TA is valid based on event_gen checks. + + - Invalidate in-memory information when we get TA child down. + + Note: Thi patch addresses some pending review comments of commit + 053b1309dc8fbc05fcde5223e734da9f694cf5cc + (https://review.gluster.org/#/c/glusterfs/+/20095/) + + fixes: bz#1709130 + Change-Id: I2ccd7e1b53362f9f3fed8680aecb23b5011eb18c + Signed-off-by: Ravishankar N + (cherry picked from commit 9ab2747da78061882f6734df4b265bce11adaef1) -commit b2f561c069d38f5075907b9f5a255f585a602c79 +commit a1fa0379b7ae059a9fbce737cd477407ab082c05 Author: Ashish Pandey -Date: Fri Dec 21 14:31:15 2018 +0530 +Date: Fri Mar 8 10:42:12 2019 +0530 - cluster/thin-arbiter: Consider thin-arbiter before marking new entry changelog + cluster/afr : TA: Return actual error code in case of failure - If a fop to create an entry fails on one of the data brick, - we mark the pending changelog on the entry on brick for which - it was successful. This is done as part of post op phase to - make sure that entry gets healed even if it gets renamed to - some other path where its parent was not marked as bad. + In afr_ta_post_op_do, we were sending EIO for every failure. + However, the original error code should be sent. - As it happens as part of post op, we should consider thin-arbiter - to check if the brick, which was successful, is the good brick or not. - This will avoide split brain and other issues. + Change-Id: I9fdc15dac00d758baf8e6f14db244f526481a63a + updates: bz#1709143 + Signed-off-by: Ashish Pandey + (cherry picked from commit 63159cdb5374f458d7d2bffec24d4720ffc96d6c) + +commit ab296b5be79ac2859072fd89cda32715f2ac57a5 +Author: N Balachandran +Date: Wed Apr 10 14:28:55 2019 +0530 + + cluster/dht: Refactor dht lookup functions - >Change-Id: I12686675be98f02f70a5186b3ed748c541514d53 - >Signed-off-by: Ashish Pandey + Part 2: Modify dht_revalidate_cbk to call + dht_selfheal_directory instead of separate calls + to heal attrs and xattrs. - Change-Id: I12686675be98f02f70a5186b3ed748c541514d53 - updates: bz#1672314 - Signed-off-by: Ashish Pandey + Change-Id: Id41ac6c4220c2c35484812bbfc6157fc3c86b142 + fixes: bz#1707393 + Signed-off-by: N Balachandran -commit 183cac3a642ae4a1b750bc11673045fc0ff66a6d -Author: Nigel Babu -Date: Mon Jan 21 12:17:04 2019 +0530 +commit 7f780f30e5b1c54702a2bf4f5624bac7b8912eee +Author: N Balachandran +Date: Mon Mar 25 15:56:56 2019 +0530 - Bump up timeout for tests on AWS + cluster/dht: refactor dht lookup functions - Fixes: bz#1673268 - Change-Id: I2b9be45f199f6436b858536c6f49be85902217f0 - Signed-off-by: Nigel Babu + Part 1: refactor the dht_lookup_dir_cbk + and dht_selfheal_directory functions. + Added a simple dht selfheal directory test + + Change-Id: I1410c26359e3c14b396adbe751937a52bd2fcff9 + updates: bz#1707393 + Signed-off-by: N Balachandran -commit c8357d7ea049516b8e45d3d364246730f39363a0 -Author: Varsha Rao -Date: Mon Feb 4 16:57:30 2019 +0530 +commit 3fc7d08c1d5dd9ac9079ee60ea734342eafb42d0 +Author: Sanju Rakonde +Date: Fri Apr 26 22:28:53 2019 +0530 - libglusterfs/common-utils.c: Fix buffer size for checksum computation + glusterd: define dumpops in the xlator_api of glusterd - Problem: When quorum count option is updated, the change is not reflected in - the nfs-server.vol file. This is because in get_checksum_for_file(), when the - last part of the file read has size less than buffer size, the read buffer - stores old data value along with correct data value. + Problem: statedump is not capturing information related to glusterd - Solution: Pass the bytes read instead of fixed buffer size, for calculating - checksum. + Solution: statdump is not capturing glusterd info because + trav->dumpops is null in gf_proc_dump_single_xlator_info () + where trav is glusterd xlator object. trav->dumpops is null + because we missed to define dumpops in xlator_api of glusterd. + defining dumpops in xlator_api of glusterd fixes the issue. - Change-Id: I4b641607c8a262961b3f3da0028a54e08c3f8589 - fixes: bz#1672248 - Signed-off-by: Varsha Rao + fixes: bz#1703759 + Change-Id: If85429ecb1ef580aced8d5b88d09fc15258bfc4c + Signed-off-by: Sanju Rakonde + (cherry picked from commit 5d866c13efdcdeddf184f012aa88a652e90ff22e) -commit 525abba58fb31df9e2d515b1ecf84f1345c78c25 -Author: Krutika Dhananjay -Date: Thu Jan 24 14:14:39 2019 +0530 +commit b2c6983d0c9eb980024743d8f9825bb4dcd44b6a +Author: Kotresh HR +Date: Fri Apr 19 11:34:37 2019 +0530 - features/shard: Ref shard inode while adding to fsync list + ctime: Fix log repeated logging during open - PROBLEM: + The log "posix set mdata failed, No ctime" logged repeatedly + after the fix [1]. Those could be internal fops. This patch + fixes the same. - Lot of the earlier changes in the management of shards in lru, fsync - lists assumed that if a given shard exists in fsync list, it must be - part of lru list as well. This was found to be not true. + [1] https://review.gluster.org/22540 - Consider this - a file is FALLOCATE'd to a size which would make the - number of participant shards to be greater than the lru list size. - In this case, some of the resolved shards that are to participate in - this fop will be evicted from lru list to give way to the rest of the - shards. And once FALLOCATE completes, these shards are added to fsync - list but without a ref. After the fop completes, these shard inodes - are unref'd and destroyed while their inode ctxs are still part of - fsync list. Now when an FSYNC is called on the base file and the - fsync-list traversed, the client crashes due to illegal memory access. + Backport of: + > Patch: https://review.gluster.org/#/c/glusterfs/+/22591/ + > BUG:1701457 + > Change-Id: I42799a90b976982cedb0ca11fa224d555eb05650 + > Signed-off-by: Kotresh HR + (cherry picked from commit 2d39572821306496c96797f4d122f8200aae4585) - FIX: + fixes: bz#1702734 + Change-Id: I42799a90b976982cedb0ca11fa224d555eb05650 + Signed-off-by: Kotresh HR + +commit 2aa9898720e3be2a203bec960103afc2558ddff6 +Author: Milan Zink +Date: Mon Feb 5 15:04:37 2018 +0100 + + extras/hooks: syntactical errors in SELinux hooks, scipt logic improved + + Fixes: bz#1701818 + Change-Id: Ia5fa1df81bbaec3a84653d136a331c76b457f42c + Signed-off-by: Milan Zink + (cherry picked from commit 1ad201a9fd6748d7ef49fb073fcfe8c6858d557d) + +commit bf69fa4727f2b4432d7d54312bc0177cbcf44936 +Author: Pranith Kumar K +Date: Tue Apr 16 14:19:47 2019 +0530 + + cluster/ec: fix fd reopen - Hold a ref on the shard inode when adding to fsync list as well. - And unref under following conditions: - 1. when the shard is evicted from lru list - 2. when the base file is fsync'd - 3. when the shards are deleted. + Currently EC tries to reopen fd's that have been opened while a brick + was down. This is done as part of regular write operations, just after + having acquired the locks, and it's sent as a sub-fop of the main write + fop. + + There were two problems: + + 1. The reopen was attempted on all UP bricks, even if a previous lock + didn't succeed. This is incorrect because most probably the open will + fail. + + 2. If reopen is sent and fails, the error is propagated to the main + operation, causing it to fail when it shouldn't. + + To fix this, we only attempt reopens on bricks where the current fop + owns a lock, and we prevent any error to be propagated to the main + fop. + + To implement this behaviour an argument used to indicate the minimum + number of required answers has overloaded to also include some flags. To + make the change consistent, it has been necessary to rename the + argument, which means that a lot of files have been changed. However + there are no functional changes. + + This change has also uncovered a problem in discard code, which didn't + correctely process requests of small sizes because no real discard fop + was being processed, only a write of 0's on some region. In this case + some fields of the fop remained uninitialized or with incorrect values. + To fix this, a new function has been created to simulate success on a + fop and it's used in the discard case. + + Thanks to Pranith for providing a test script that has also detected an + issue in this patch. This patch includes a small modification of this + script to force data to be written into bricks before stopping them. - Change-Id: Iab460667d091b8388322f59b6cb27ce69299b1b2 - fixes: bz#1669382 - Signed-off-by: Krutika Dhananjay - (cherry picked from commit 72922c1fd69191b220f79905a23395c3a87f86ce) + Backport of: + > Change-Id: If272343873369186c2fb8f43c1d9c52c3ea304ec + > BUG: bz#1699866 + > Signed-off-by: Xavi Hernandez + + Change-Id: If272343873369186c2fb8f43c1d9c52c3ea304ec + Fixes: bz#1699917 + Signed-off-by: Xavi Hernandez -commit 3f05fb00a090686bbdb0b467cec1f3647903b851 -Author: Ravishankar N -Date: Tue Jan 29 11:51:16 2019 +0530 +commit ab6c9ff91a56e38ca80b0ff855f3aeafefd99fbb +Author: Xavi Hernandez +Date: Fri Apr 12 13:40:59 2019 +0200 - readdir-ahead: do not zero-out iatt in fop cbk + core: handle memory accounting correctly - ...when ctime is zero. ia_type and ia_gfid always need to be non-zero - for things to work correctly. + When a translator stops, memory accounting for that translator is not + destroyed (because there could remain memory allocated that references + it), but mutexes that coordinate updates of memory accounting were + destroyed. This caused incorrect memory accounting and even crashes in + debug mode. + + This patch also fixes some other things: + + * Reduce the number of atomic operations needed to manage memory + accounting. + * Correctly account memory when realloc() is used. + * Merge two critical sections into one. + * Cleaned the code a bit. - Problem: - Commit c9bde3021202f1d5c5a2d19ac05a510fc1f788ac zeroed out the iatt - buffer in the cbks of modification fops before unwinding if the ctime in - the buffer was zero. This was causing the fops to fail: noticeable when - AFR's 'consistent-metadata' option was enabled. (AFR zeros out the ctime - when the option is set. See commit - 4c4624c9bad2edf27128cb122c64f15d7d63bbc8). + Backport of: + > Change-Id: Id5eaee7338729b9bc52c931815ca3ff1e5a7dcc8 + > BUG: bz#1659334 + > Signed-off-by: Xavi Hernandez - Fixes: - -Do not zero out the ia_type and ia_gfid of the iatt buff under any - circumstance. - -Also, fixed _rda_inode_ctx_update_iatts() to always update these values from - the incoming buf when ctime is zero. Otherwise we end up with zero - ia_type and ia_gfid the first time the function is called *and* the - incoming buf has ctime set to zero. + Change-Id: Id5eaee7338729b9bc52c931815ca3ff1e5a7dcc8 + Fixes: bz#1702271 + Signed-off-by: Xavi Hernandez + +commit 5c521d403fbee36df5d44e39090b0030ca57c98b +Author: ShyamsundarR +Date: Wed Apr 17 11:34:31 2019 -0400 + + doc: Added release notes for 6.1 - fixes: bz#1665145 - Reported-By:Michael Hanselmann - Change-Id: Ib72228892d42c3513c19fc6dfb543f2aa3489eca - Signed-off-by: Ravishankar N - (cherry picked from commit 09db11b0c020bc79d493c6d7e7ea4f3beb000c68) + Fixes: bz#1692394 + Change-Id: I44a28ec98932d54851dbf997988e1f8fd9877f0a + Signed-off-by: ShyamsundarR -commit 05ba01297657deef881aa9cd2770bbe760abf090 -Author: N Balachandran -Date: Mon Jan 21 15:15:51 2019 +0530 +commit 1bbf2f771322ae1fd5181360ce36fed30b6ff2ab +Author: Atin Mukherjee +Date: Tue Apr 16 17:20:34 2019 +0530 - cluster/dht: Delete invalid linkto files in rmdir + glusterd: fix loading ctime in client graph logic - rm -rf fails on dirs which contain linkto files - that point to themselves because dht incorrectly thought - that they were cached files after looking them up. - The fix now treats them as invalid linkto files - and deletes them. + Commit efbf8ab wasn't handling all the scenarios of toggling ctime + option correctly and more over a ! had completely tossed up the logic. - Change-Id: I376c72a5309714ee339c74485e02cfb4e29be643 - fixes: bz#1671611 - Signed-off-by: N Balachandran + Fixes: bz#1698471 + Change-Id: If12e2f69045e59878992ee2cd0518cc0eabcce0d + Signed-off-by: Atin Mukherjee -commit f2d366835652b2911c96155f7c429ddf485c1a89 -Author: Zhang Huan -Date: Sat Dec 29 15:51:13 2018 +0800 +commit ec95f02b1ebe000e3bb6c7cc9c69a2ed172f50cc +Author: Aravinda VK +Date: Tue Mar 26 13:20:13 2019 +0530 - socket: fix issue when socket write return with EAGAIN + geo-rep: fix integer config validation - In the case socket write return with EAGAIN, the remaining vector count - is return all way back to event handler, making followup pollin event to - skip handling and dispatch loop complains about failure. Even thought - temporary write failure is not an error. + ssh-port validation is mentioned as `validation=int` in template + `gsyncd.conf`, but not handled this during geo-rep config set. - [2018-12-29 07:31:41.772310] E [MSGID: 101191] [event-epoll.c:674:event_dispatch_epoll_worker] 0-epoll: Failed to dispatch handler + Backport of https://review.gluster.org/22418 - Change-Id: Idf03d120b5f7619eda19720a583cbcc3e7da2504 - updates: bz#1651246 - Signed-off-by: Zhang Huan - (cherry picked from commit 0301a66bda44582e3a48519f2a5d365b0c38090d) + Fixes: bz#1695445 + Change-Id: I3f19d9b471b0a3327e4d094dfbefcc58ed2c34f6 + Signed-off-by: Aravinda VK + (cherry picked from commit c574984e19d59e351372eacce0ce11fb36e96dd4) -commit cb7946c47f8c6dc1311d5d8f99d228ef7ce0160d -Author: Zhang Huan -Date: Thu Jan 3 17:57:38 2019 +0800 +commit cbb52082da9d968908dc2f62b59328e948ced271 +Author: Aravinda VK +Date: Thu Mar 14 20:06:54 2019 +0530 - socket: don't pass return value from protocol handler to event handler + geo-rep: IPv6 support - Event handler handles socket level error only, while protocol handler - handles in protocol level error. If protocol handler decides to - disconnect on error in any case, it should call disconnect instead of - return an error back to event handler. + `address_family=inet6` needs to be added while mounting master and + slave volumes in gverify script. - Change-Id: I9375be98cc52cb969085333f3c7229a91207d1bd - updates: bz#1651246 - Signed-off-by: Zhang Huan - (cherry picked from commit cd5714554627fe90ee2c77685cb410a8fb25eceb) - -commit 0210aa3e2b405c16dda2b7d5be96f2cb79af08e8 -Author: Milind Changire -Date: Thu Jan 31 11:30:27 2019 +0530 - - core: move "dict is NULL" logs to DEBUG log level + New option introduced to gluster cli(`--inet6`) which will be used + internally by geo-rep while calling `gluster volume info + --remote-host=`. - Too many logs get printed if dict_ref() and dict_unref() are passed NULL - pointer. + Backport of https://review.gluster.org/22363 - fixes: bz#1671217 - Change-Id: I18afd849d64318f68baa7b549ee310dac0e1e786 - Signed-off-by: Milind Changire + Fixes: bz#1695436 + Change-Id: I1e0d42cae07158df043e64a2f991882d8c897837 + Signed-off-by: Aravinda VK + (cherry picked from commit 240e1d6821fbb779c3dd73f6f0225d755a5b7cc6) -commit 5564d831bbf0e9ba276422fb3a3cef2bd4ac242f -Author: Kaleb S. KEITHLEY -Date: Tue Jan 29 03:32:04 2019 -0500 +commit f39fc92d6521a5b87a635dd35989c0af90e7b789 +Author: Kinglong Mee +Date: Mon Mar 18 20:47:54 2019 +0800 - api: bad GFAPI_4.1.6 block + cluster-syncop: avoid duplicate unlock of inodelk/entrylk - missing global: line, tabs not spaces + When using ec, there are many messages at brick log as, - Change-Id: Icdbc23b4e4cd608da1d764e81757201c4b1269a6 - fixes: bz#1670307 - Signed-off-by: Kaleb S. KEITHLEY - -commit dc8583529731636d80fe7285c3cc6444d6aac67e -Author: ShyamsundarR -Date: Wed Jan 16 15:27:03 2019 -0500 - - doc: Release notes for 5.3 + [inodelk.c:514:__inode_unlock_lock] 0-test-locks: Matching lock not found for unlock 0-9223372036854775807, lo=68e040a84b7f0000 on 0x7f208c006f78 + [MSGID: 115053] [server-rpc-fops_v2.c:280:server4_inodelk_cbk] 0-test-server: 2557439: INODELK (df4e41be-723f-4289-b7af-b4272b3e880c), client: CTX_ID:67d4a7f3-605a-4965-89a5-31309d62d1fa-GRAPH_ID:0-PID:1659-HOST:openfs-node2-PC_NAME:test-client-1-RECON_NO:-28, error-xlator: test-locks [Invalid argument] - Fixes: bz#1659085 - Change-Id: I5195e4eca6518e3122ea188e2f4891f5e68ca01a - Signed-off-by: ShyamsundarR + > Change-Id: Ib164d29ebb071f620a4ca9679c4345ef7c88512a + > Signed-off-by: Kinglong Mee + (cherry-pick of https://review.gluster.org/#/c/glusterfs/+/22377/) + + Change-Id: I6e0eaba6aca6cd99ba2a5ae2e580167d54d8ea26 + Updates: bz#1690950 + Signed-off-by: Kinglong Mee -commit 561624aad540c4a7df49ab62bd8a9a75810d76b2 -Author: Amar Tumballi -Date: Fri Jan 11 15:00:27 2019 +0530 +commit b1186532c7fd093232617979aa8f3e932a645278 +Author: Raghavendra G +Date: Fri Mar 22 10:40:45 2019 +0530 + + transport/socket: log shutdown msg occasionally + + Change-Id: If3fc0884e7e2f45de2d278b98693b7a473220a5e + Signed-off-by: Raghavendra G + Fixes: bz#1679904 + (cherry picked from commit ec1b84300fe267dd12c1e42e7e91905db935f1e2) - fuse: add --lru-limit option - - The inode LRU mechanism is moot in fuse xlator (ie. there is no - limit for the LRU list), as fuse inodes are referenced from - kernel context, and thus they can only be dropped on request of - the kernel. This might results in a high number of passive - inodes which are useless for the glusterfs client, causing a - significant memory overhead. +commit 7ec3a8527f2fb341fc1f6e54ded36b157e4904fe +Author: Pranith Kumar K +Date: Thu Apr 4 15:31:56 2019 +0530 + + cluster/afr: Remove local from owners_list on failure of lock-acquisition - This change tries to remedy this by extending the LRU semantics - and allowing to set a finite limit on the fuse inode LRU. + When eager-lock lock acquisition fails because of say network failures, the + local is not being removed from owners_list, this leads to accumulation of + waiting frames and the application will hang because the waiting frames are + under the assumption that another transaction is in the process of acquiring + lock because owner-list is not empty. Handled this case as well in this patch. + Added asserts to make it easier to find these problems in future. - A brief history of problem: + fixes bz#1699731 + Change-Id: I3101393265e9827755725b1f2d94a93d8709e923 + Signed-off-by: Pranith Kumar K + +commit d2de3f66393d4f737e21eedab4200563a60f8bcc +Author: Mohit Agrawal +Date: Mon Apr 15 10:34:34 2019 +0530 + + core: Log level changes do not effect on running client process + + Problem: commit c34e4161f3cb6539ec83a9020f3d27eb4759a975 set log-level + per xlator during reconfigure only for a brick process not for + the client process. + + Solution: 1) Change per xlator log-level only if brick_mux is enabled.To make sure + about brick multiplex introudce a flag brick_mux at ctx->cmd_args. + + Note: There are two other changes done with this patch + 1) Ignore client-log-level option to attach a brick with + already running brick if brick_mux is enabled + 2) Add a log to print pid of the running process to make easier + debugging + + > Change-Id: I39e85de778e150d0685cd9a79425ce8b4783f9c9 + > Signed-off-by: Mohit Agrawal + > Fixes: bz#1696046 + > (Cherry picked from commit 798aadbe51a9a02dd98a0f861cc239ecf7c8ed57) + > (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/22495/) + + Change-Id: If91682830f894ab8f6857f19dcb1797fc15ca64c + Fixes: bz#1699715 + Signed-off-by: Mohit Agrawal + +commit 80d2dae631369d2e4b5e5f4aa0a102b541c22ad5 +Author: Kotresh HR +Date: Tue Apr 9 18:23:05 2019 +0530 + + posix/ctime: Fix stat(time attributes) inconsistency during readdirp - When gluster's inode table was designed, fuse didn't have any - 'invalidate' method, which means, userspace application could - never ask kernel to send a 'forget()' fop, instead had to wait - for kernel to send it based on kernel's parameters. Inode table - remembers the number of times kernel has cached the inode based - on the 'nlookup' parameter. And 'nlookup' field is not used by - no other entry points (like server-protocol, gfapi etc). + Problem: + Creation of tar file on gluster volume throws warning + 'file changed as we read it' - Hence the inode_table of fuse module always has to have lru-limit - as '0', which means no limit. GlusterFS always had to keep all - inodes in memory as kernel would have had a reference to it. - Again, the reason for this is, kernel's glusterfs inode reference - was pointer of 'inode_t' structure in glusterfs. As it is a - pointer, we could never free it (to prevent segfault, or memory - corruption). + Cause: + During readdirp, for few of the files whose inode is not + present, time attributes were served from backend. This caused + the ctime of few files to be different between before readdir + and after readdir by tar. Solution: + If ctime feature is enabled and inode is not present, don't + serve the time attributes from backend file, serve it from xattr. - In the inode table, handle the prune case of inodes with 'nlookup' - differently, and call a 'invalidator' method, which in this case is - fuse_invalidate(), and it sends the request to kernel for getting - the forget request. - - When the kernel sends the forget, it means, it has dropped all - the reference to the inode, and it will send the forget with the - 'nlookup' parameter too. We just need to make sure to reduce the - 'nlookup' value we have when we get forget. That automatically - cause the relevant prune to happen. + Backport of: + > Patch: https://review.gluster.org/22540 + > BUG: 1698078 + > Change-Id: I427ef865f97399475faf5aa6ca495f7e317603ae + > Signed-off-by: Kotresh HR + (cherry picked from commit c56f102da21c5b69e656a055aaf736281596284d) - Credits: Csaba Henk, Xavier Hernandez, Raghavendra Gowdappa, Nithya B + fixes: bz#1699703 + Change-Id: I427ef865f97399475faf5aa6ca495f7e317603ae + Signed-off-by: Kotresh HR + +commit 5f51159463f892bd118123bf2870b5a0be1c14ea +Author: Kinglong Mee +Date: Fri Apr 12 11:35:55 2019 +0800 + + ec: fix truncate lock to cover the write in tuncate clean - fixes: bz#1623107 - Change-Id: Ifee0737b23b12b1426c224ec5b8f591f487d83a2 - Signed-off-by: Amar Tumballi + ec_truncate_clean does writing under the lock granted for truncate, + but the lock is calculated by ec_adjust_offset_up, so that, + the write in ec_truncate_clean is out of lock. + + Updates: bz#1699499 + Change-Id: Idbe1fd48d26afe49c36b77db9f12e0907f5a4134 + Signed-off-by: Kinglong Mee + (cherry picked from commit 0e1223491e964096384edfae5032ed0d50d028ad) + +commit 88ecd64604ce01c5bc2c2ca88e33b8dcf57d5ee8 +Author: Mohit Agrawal +Date: Thu Apr 11 20:38:53 2019 +0530 + + core: Brick is not able to detach successfully in brick_mux environment + + Problem: In brick_mux environment, while volumes are stopped in a + loop bricks are not detached successfully. Brick's are not + detached because xprtrefcnt has not become 0 for detached brick. + At the time of initiating brick detach process server_notify + saves xprtrefcnt on detach brick and once counter has become + 0 then server_rpc_notify spawn a server_graph_janitor_threads + for cleanup brick resources.xprtrefcnt has not become 0 because + socket framework is not working due to assigning 0 as a fd for socket. + In commit dc25d2c1eeace91669052e3cecc083896e7329b2 + there was a change in changelog fini to close htime_fd if htime_fd is not + negative, by default htime_fd is 0 so it close 0 also. + + Solution: Initialize htime_fd to -1 after just allocate changelog_priv + by GF_CALLOC + + > Fixes: bz#1699025 + > Change-Id: I5f7ca62a0eb1c0510c3e9b880d6ab8af8d736a25 + > Signed-off-by: Mohit Agrawal + > (cherry picked from commit b777d83001d8006420b6c7d2d88fe68950aa7e00) + + Change-Id: I7a2b6fc2d36405d51990376333e093661be48475 + Fixes: bz#1699714 + Signed-off-by: Mohit Agrawal + +commit 08278e88235c5de923c918612ee868657e97533a +Author: Mohit Agrawal +Date: Fri Apr 5 09:17:02 2019 +0530 + + build: glusterfs build is failing on RHEL-6 + + Problem: glusterfs build is throwing error undefined + reference to `dlclose' on RHEL 6 + + Solution: Add LIB_DL link in Makefile.am to resolve the same + + > Fixes: bz#1696512 + > Change-Id: I58019ca9e29d569d8e6df282b8ab178ad540843b + > Signed-off-by: Mohit Agrawal + > (cherry picked from commit 064aad721c249d63fb89686b32e5d15de50e2f8c) + + Change-Id: I4f68553b501c283e2066ddc64e204db40552ee73 + Fixes: bz#1699713 + Signed-off-by: Mohit Agrawal -commit 11186f4e0b1d5952318060d6e8d3610d4d94add8 -Author: Krutika Dhananjay -Date: Fri Dec 28 18:53:15 2018 +0530 +commit 6bd52e5108e73a1f1ac186d432f94a287d435475 +Author: karthik-us +Date: Mon Mar 18 11:57:28 2019 +0530 - features/shard: Fix launch of multiple synctasks for background deletion + cluster/afr: Thin-arbiter SHD fixes - PROBLEM: + This patch address post-merge review comments for commit + 5784a00f997212d34bd52b2303e20c097240d91c - When multiple sharded files are deleted in quick succession, multiple - issues were observed: - 1. misleading logs corresponding to a sharded file where while one log - message said the shards corresponding to the file were deleted - successfully, this was followed by multiple logs suggesting the very - same operation failed. This was because of multiple synctasks - attempting to clean up shards of the same file and only one of them - succeeding (the one that gets ENTRYLK successfully), and the rest of - them logging failure. + Change-Id: I7ed954664a2ae8e1091d23ee3ceb9c66e83bfeac + fixes: bz#1699319 + Signed-off-by: karthik-us + +commit fbba6e397f5ce473eddca710d593a6c2b62906d5 +Author: Pranith Kumar K +Date: Thu Mar 28 17:55:54 2019 +0530 + + protocol/client: Do not fallback to anon-fd if fd is not open - 2. multiple synctasks to do background deletion would be launched, one - for each deleted file but all of them could readdir entries from - .remove_me at the same time could potentially contend for ENTRYLK on - .shard for each of the entry names. This is undesirable and wasteful. + If an open comes on a file when a brick is down and after the brick comes up, + a fop comes on the fd, client xlator would still wind the fop on anon-fd + leading to wrong behavior of the fops in some cases. - FIX: - Background deletion will now follow a state machine. In the event that - there are multiple attempts to launch synctask for background deletion, - one for each file deleted, only the first task is launched. And if while - this task is doing the cleanup, more attempts are made to delete other - files, the state of the synctask is adjusted so that it restarts the - crawl even after reaching end-of-directory to pick up any files it may - have missed in the previous iteration. + Example: + If lk fop is issued on the fd just after the brick is up in the scenario above, + lk fop will be sent on anon-fd instead of failing it on that client xlator. + This lock will never be freed upon close of the fd as flush on anon-fd is + invalid and is not wound below server xlator. - This patch also fixes uninitialized lk-owner during syncop_entrylk() - which was leading to multiple background deletion synctasks entering - the critical section at the same time and leading to illegal memory access - of base inode in the second syntcask after it was destroyed post shard deletion - by the first synctask. + As a fix, failing the fop unless the fd has FALLBACK_TO_ANON_FD flag. - Change-Id: Ib33773d27fb4be463c7a8a5a6a4b63689705324e - updates: bz#1665803 - Signed-off-by: Krutika Dhananjay - (cherry picked from commit c0c2022e7d7097e96270a74f37813eda0c4e6339) + Change-Id: I77692d056660b2858e323bdabdfe0a381807cccc + fixes bz#1699198 + Signed-off-by: Pranith Kumar K + (cherry picked from commit 92ae26ae8039847e38c738ef98835a14be9d4296) -commit 4bbb0ecfac59f2ae8816640c516bb20b0b06aa44 -Author: Krutika Dhananjay -Date: Fri Dec 28 07:27:11 2018 +0530 +commit 74db82dd5d5cd47c59afb99b44a8b3d698c64167 +Author: Ravishankar N +Date: Thu Mar 7 17:02:36 2019 +0530 - features/shard: Assign fop id during background deletion to prevent excessive logging - - ... of the kind - - "[2018-12-26 05:22:44.195019] E [MSGID: 133010] - [shard.c:2253:shard_common_lookup_shards_cbk] 0-volume1-shard: Lookup - on shard 785 failed. Base file gfid = cd938e64-bf06-476f-a5d4-d580a0d37416 - [No such file or directory]" + afr: thin-arbiter read txn fixes - shard_common_lookup_shards_cbk() has a specific check to ignore ENOENT error without - logging them during specific fops. But because background deletion is done in a new - frame (with local->fop being GF_FOP_NULL), the ENOENT check is skipped and the - absence of shards gets logged everytime. + - Fixes afr_ta_read_txn() to handle inode refresh failures. + code-path. + - Fixes a double free issue of dict. - To fix this, local->fop is initialized to GF_FOP_UNLINK during background deletion. + Note: This patch address post-merge review comments for commit + 69532c141be160b3fea03c1579ae4ac13018dcdf - Change-Id: I0ca8d3b3bfbcd354b4a555eee520eb0479bcda35 - updates: bz#1665803 - Signed-off-by: Krutika Dhananjay - (cherry picked from commit aa28fe32364e39981981d18c784e7f396d56153f) + fixes: bz#1693992 + Change-Id: Id5299b45b68569d47df6b73755918237a1592cb4 + Signed-off-by: Ravishankar N + (cherry picked from commit 500bd0014128e6727e83b6cb77e8ac94304b8f4a) -commit 0962e24c3d66c173155d80783eb5d1cc4ae3c99e -Author: Soumya Koduri -Date: Tue Dec 25 13:29:15 2018 -0500 +commit f792fd01aab1e50b4f662305e9c417064bd37c30 +Author: Ashish Pandey +Date: Wed Nov 28 11:22:52 2018 +0530 - leases: Reset lease_ctx->timer post deletion + cluster/ec: Don't enqueue an entry if it is already healing - To avoid use_after_free, reset lease_ctx->timer back to NULL - after the structure has been freed. + Problem: + 1 - heal-wait-qlength is by default 128. If shd is disabled + and we need to heal files, client side heal is needed. + If we access these files that will trigger the heal. + However, it has been observed that a file will be enqueued + multiple times in the heal wait queue, which in turn causes + queue to be filled and prevent other files to be enqueued. + + 2 - While a file is going through healing and a write fop from + mount comes on that file, it sends write on all the bricks including + healing one. At the end it updates version and size on all the + bricks. However, it does not unset dirty flag on all the bricks, + even if this write fop was successful on all the bricks. + After healing completion this dirty flag remain set and never + gets cleaned up if SHD is disabled. - Change-Id: Icd213ec809b8af934afdb519c335a4680a1d6cdc - updates: bz#1651323 - Signed-off-by: Soumya Koduri - (cherry picked from commit a9b0003c717087ff168bc143c70559162e53e0d5) + Solution: + 1 - If an entry is already in queue or going through heal process, + don't enqueue next client side request to heal the same file. + + 2 - Unset dirty on all the bricks at the end if fop has succeeded on + all the bricks even if some of the bricks are going through heal. + + Change-Id: Ia61ffe230c6502ce6cb934425d55e2f40dd1a727 + updates: bz#1693223 + Signed-off-by: Ashish Pandey + (cherry picked from commit 313dcefe7a62bd16cd794040df068f9bec9c6927) -commit 0ec7da927915512c62c99b418a297c6132234c8b -Author: N Balachandran -Date: Wed Dec 26 11:40:26 2018 +0530 +commit aca7ec21ed1823440abe8409f7f9c4a8864cf8fa +Author: Atin Mukherjee +Date: Tue Apr 9 14:58:29 2019 +0530 + + glusterd: load ctime in the client graph only if it's not turned off + + Considering ctime is a client side feature, we can't blindly load ctime + xlator into the client graph if it's explicitly turned off, that'd + result into backward compatibility issue where an old client can't mount + a volume configured on a server which is having ctime feature. + + Fixes: bz#1698471 + Change-Id: I6ae7b96d056073aa6746de9a449cf319786d45cc + Signed-off-by: Atin Mukherjee + (cherry picked from commit efbf8abcc3bc729a90d4a7b57dc515f1df8a5863) + +commit c2723c57d2cb85da5c14a900e049f4ce9469444d +Author: Atin Mukherjee +Date: Tue Apr 2 10:45:15 2019 +0530 + + logging: Fix GF_LOG_OCCASSIONALLY API + + GF_LOG_OCCASSIONALLY doesn't log on the first instance rather at every + 42nd iterations which isn't effective as in some cases we might not have + the code flow hitting the same log for as many as 42 times and we'd end + up suppressing the log. + + Updates: bz#1679904 + Change-Id: Iee293281d25a652b64df111d59b13de4efce06fa + Signed-off-by: Atin Mukherjee + (cherry picked from commit d0d3e10d44366c68fc153e48b229e72a4aa26e61) + +commit 55c5e2ecc77bd13dfa66139a1c320e73f703775b +Author: Atin Mukherjee +Date: Mon Mar 18 16:08:04 2019 +0530 + + glusterd: fix txn-id mem leak + + This commit ensures the following: + 1. Don't send commit op request to the remote nodes when gluster v + status all is executed as for the status all transaction the local + commit gets the name of the volumes and remote commit ops are + technically a no-op. So no need for additional rpc requests. + 2. In op state machine flow, if the transaction is in staged state and + op_info.skip_locking is true, then no need to set the txn id in the + priv->glusterd_txn_opinfo dictionary which never gets freed. + + Fixes: bz#1694610 + Change-Id: Ib6a9300ea29633f501abac2ba53fb72ff648c822 + Signed-off-by: Atin Mukherjee + (cherry picked from commit 34e010d64905b7387de57840d3fb16a326853c9b) - core: Fixed typos in nl-cache and logging-guidelines.md +commit 5946db166a428d37f5bbbb3df802a1e53cab5029 +Author: Ravishankar N +Date: Fri Mar 15 19:31:03 2019 +0530 + + afr: add client-pid to all gf_event() calls - Replaced "recieve" with "receive". + client-pid for glustershd is GF_CLIENT_PID_SELF_HEALD + client-pid for glfsheal is GF_CLIENT_PID_GLFS_HEALD - Change-Id: I58a3d3d4a0093df4743de9fae4d8ff152d4b216c - fixes: bz#1662200 - Signed-off-by: N Balachandran - (cherry picked from commit a11c5c66321dd8411373a68cc163c981c7d083df) + updates: bz#1693155 + Change-Id: Ib3a863af160ff48c822a5e6b0c27c575c9887470 + Signed-off-by: Ravishankar N + (cherry picked from commit 8016d51a3bbd410b0b927ed66be50a09574b7982) -commit e1257564b85901a31a05afa0316ebc0c52d00cff -Author: Soumya Koduri -Date: Tue Dec 18 22:07:55 2018 +0530 +commit 27a96f1f344d16de8085ace40c2be99c3cd83139 +Author: Kaleb S. KEITHLEY +Date: Thu Mar 28 09:36:33 2019 -0400 - gfapi: Access fs->oldvolfile under mutex lock + rpclib: slow floating point math and libm - In some cases (for eg., when there are multiple - RPC_CLNT_CONNECT notifications), multiple threads may fetch - volfile and try to update it in 'fs' object simultaneously. - Hence protect those variables' access under fs->mutex lock. + In release-6 rpc/rpc-lib (libgfrpc) added the function + get_rightmost_set_bit() which calls log2(3), a call that takes + a floating point parameter and returns a floating point. - This is backport of below two mainline patches - - - https://review.gluster.org/#/c/glusterfs/+/21882/ - - https://review.gluster.org/#/c/glusterfs/+/21927/ + It's used thusly: + right_most_unset_bit = get_rightmost_set_bit(...); - Change-Id: Idaee9548560db32d83f4c04ebb1f375fee7864a9 - fixes: bz#1663131 - Signed-off-by: Soumya Koduri - (cherry picked from commit 8fe3c6107a2b431d7cc0b8cfaeeb7941cf9590f9) + (So is it really the right-most unset bit, or the right-most set bit?) + + It's unclear to me whether this is in the data path or not. If it is, + it's rather scary to think about integer-to-float and float-to-integer + conversions and slow calls to libm functions in the data path. + + gcc and clang have __builtin_ctz() which returns the same result as + get_rightmost_set_bit(), and does it substantially faster. Approx + 20M iterations of get_rightmost_set_bit() took ~33sec of wall clock + time on my devel machine, while 20M iterations of __builtin_ctz() + took < 9sec; get_rightmost_set_bit() is 3x slower than __builtin_ctz(). + + And as a side benefit, we can again eliminate the need to link libgfrpc + with libm. + + Change-Id: If9e7e80874577c52223f8125b385fc930de20699 + fixes: bz#1692957 + Signed-off-by: Kaleb S. KEITHLEY -commit cee5f93ac00f628539f0367bc4958d59b98af011 -Author: Soumya Koduri -Date: Wed Nov 28 14:14:00 2018 +0530 +commit c5bc21ebbc10248848b372db34a33a0fcb9ae2ae +Author: Ashish Pandey +Date: Mon Mar 18 12:54:54 2019 +0530 - io-cache: xdata needs to be passed for readv operations + cluster/ec: Fix handling of heal info cases without locks - io-cache xlator has been skipping xdata references when the - date needs to be read into page cache. This patch fixes the same. + When we use heal info command, it takes lot of time as in + some cases it takes lock on entries to find out if the + entry actually needs heal or not. + + There are some cases where we can avoid these locks and + can conclude if the entry needs heal or not. + + 1 - We do a lookup (without lock) on an entry, which we found in + .glusterfs/indices/xattrop, and find that lock count is + zero. Now if the file contains dirty bit set on all or any + brick, we can say that this entry needs heal. + + 2 - If the lock count is one and dirty is greater than 1, + then it also means that some fop had left the dirty bit set + which made the dirty count of current fop (which has taken lock) + more than one. At this point also we can definitely say that + this entry needs heal. + + This patch is modifying code to take into consideration above two + points. + It is also changing code to not to call ec_heal_inspect if ec_heal_do + was called from client side heal. Client side heal triggeres heal + only when it is sure that it requires heal. - Note: similar changes may be needed for other fops as well - which are handled by io-cache. + [We have changed the code to not to call heal for lookup] - Change-Id: I28d73d4ba471d13eb55d0fd0b5197d222df77a2a - updates: bz#1651323 - Signed-off-by: Soumya Koduri - (cherry picked from commit b3d88a0904131f6851f4185e43f815ecc3353ab5) + updates bz#1697764 + Change-Id: I7f09f0ecd12f65a353297aefd57026fd2bebdf9c + Signed-off-by: Ashish Pandey + (cherry picked from commit da47caf2405c08c9abafc4a55525a8b2c2dd5bb8) -commit 12aa9058df9bae0e0409f8554f70498caa59aa46 +commit 381e7603d9e8ff807e691b1d9272f050f341d2c6 Author: Kotresh HR -Date: Sat Nov 17 13:14:24 2018 +0530 +Date: Thu Mar 28 07:17:16 2019 -0400 - geo-rep: Fix syncing of files with non-ascii filenames + geo-rep: Fix syncing multiple rename of symlink Problem: - Creation of files/directories with non-ascii names fails - to sync to the slave. It crashes with below traceback on - slave. - ... - File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/repce.py", line 118, in worker + Geo-rep fails to sync rename of symlink if it's + renamed multiple times if creation and rename + happened successively + + Worker crash at slave: + Traceback (most recent call last): + File "/usr/libexec/glusterfs/python/syncdaemon/repce.py", in worker res = getattr(self.obj, rmeth)(*in_data[2:]) - File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/resource.py", line 709, in entry_ops + File "/usr/libexec/glusterfs/python/syncdaemon/resource.py", in entry_ops [ESTALE, EINVAL, EBUSY]) - File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/syncdutils.py", line 546, in errno_wrap + File "/usr/libexec/glusterfs/python/syncdaemon/syncdutils.py", in errno_wrap return call(*arg) - File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/libcxattr.py", line 83, in lsetxattr + File "/usr/libexec/glusterfs/python/syncdaemon/libcxattr.py", in lsetxattr cls.raise_oserr() - File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/libcxattr.py", line 38, in raise_oserr + File "/usr/libexec/glusterfs/python/syncdaemon/libcxattr.py", in raise_oserr raise OSError(errn, os.strerror(errn)) - OSError: [Errno 12] Cannot allocate memory + OSError: [Errno 12] Cannot allocate memory - Cause: - The length calculation arguments passed to blob creation was done before encoding. Hence - was failing in gfid-access layer. + Geo-rep Behaviour: + 1. SYMLINK doesn't record target path in changelog. + So while syncing SYMLINK, readlink is done on + master to get target path. + + 2. Geo-rep will create destination if source is not + present while syncing RENAME. Hence while syncing + RENAME of SYMLINK, target path is collected from + destination. - Fix: - It appears that the calculating lenght properly fixes this issue. But it will cause - issues in other places in 'python2' and not in 'python3'. So encoding and decoding - each required string to make geo-rep compatible with both 'python2' and 'python3' - is a nightmare and is not fool proof. Hence kept 'python2' code as is with out - encode/decode and applied encode/decode only to 'python3' + Cause: + If symlink is created and renamed multiple times, creation of + symlink is ignored, as it's no longer present on master at + that path. While symlink is renamed multiple times at master, + when syncing first RENAME of SYMLINK, both source and destination + is not present, hence target path is not known. In this case, + while creating destination directly at slave, regular file + attributes were encoded into blob instead of symlink, + causing failure in gfid-access translator while decoding + blob. - Added non-ascii filename tests to regression + Solution: + While syncing of RENAME of SYMLINK, when target is not known + and when src and destination is not present on the master, + don't create destination. Ignore the rename. It's ok to ignore. + If it's unliked, it's fine. If it's renamed to something else, + it will be synced then. Backport of: - > Patch: https://review.gluster.org/21668 - > BUG: 1650893 - > Change-Id: I35cfaf848e07b1a0b5cb93c01b98b472f08271a6 - > Signed-off-by: Kotresh HR + > Change-Id: Ibdfa495513b7c05b5370ab0b89c69a6802338d87 + > BUG: bz#1693648 + > Signed-off-by: Kotresh HR + (cherry picked from commit 877af725b3e35b548d6d7aeec5adb21721d8bf8b) - fixes: bz#1648642 - Change-Id: I35cfaf848e07b1a0b5cb93c01b98b472f08271a6 + Change-Id: Ibdfa495513b7c05b5370ab0b89c69a6802338d87 + fixes: bz#1694002 Signed-off-by: Kotresh HR + (cherry picked from commit 877af725b3e35b548d6d7aeec5adb21721d8bf8b) -commit e2f1bd54bd675e126e195d81a67b1d4331b77551 -Author: N Balachandran -Date: Fri Nov 9 17:06:22 2018 +0530 +commit 491ff40a7a9ffb186ab1c7772eb8d4e75ad2c2b0 +Author: Soumya Koduri +Date: Thu Mar 28 14:59:00 2019 +0530 - cluster/dht: sync brick root perms on add brick + gfapi: Unblock epoll thread for upcall processing - If a single brick is added to the volume and the - newly added brick is the first to respond to a - dht_revalidate call, its stbuf will not be merged - into local->stbuf as the brick does not yet have - a layout. The is_permission_different check therefore - fails to detect that an attr heal is required as it - only considers the stbuf values from existing bricks. - To fix this, merge all stbuf values into local->stbuf - and use local->prebuf to store the correct directory - attributes. + With commit#ad35193,we have made changes to offload + processing upcall notifications to synctask so as not + to block epoll threads. However seems like the issue wasnt + fully addressed. + + In "glfs_cbk_upcall_data" -> "synctask_new1" after creating synctask + if there is no callback defined, the thread waits on synctask_join + till the syncfn is finished. So that way even with those changes, + epoll threads are blocked till the upcalls are processed. + + Hence the right fix now is to define a callback function for that + synctask "glfs_cbk_upcall_syncop" so as to unblock epoll/notify threads + completely and the upcall processing can happen in parallel by synctask + threads. - Change-Id: Ic9e8b04a1ab9ed1248b6b056e3450bbafe32e1bc - fixes: bz#1660736 - Signed-off-by: N Balachandran + Change-Id: I4d8645e3588fab2c3ca534e0112773aaab68a5dd + fixes: bz#1694561 + Signed-off-by: Soumya Koduri + (cherry picked from commit 4a03a71c6171f6e8382664d9d29857d06ef37741) -commit 0beca839679d437d49c7481cb7370e1350f16ba9 -Author: N Balachandran -Date: Fri Dec 14 16:42:26 2018 +0530 +commit dbfff66092178b03667b45cff9f97635129ab8be +Author: Poornima G +Date: Sun Mar 24 09:40:50 2019 +0530 - performance/rda: Fixed dict_t memory leak + client-rpc: Fix the payload being sent on the wire - Removed all references to dict_t xdata_from_req which is - allocated but not used anywhere. It is also not cleaned up - and hence causes a memory leak. + The fops allocate 3 kind of payload(buffer) in the client xlator: + - fop payload, this is the buffer allocated by the write and put fop + - rsphdr paylod, this is the buffer required by the reply cbk of + some fops like lookup, readdir. + - rsp_paylod, this is the buffer required by the reply cbk of fops like + readv etc. - fixes: bz#1659676 + Currently, in the lookup and readdir fop the rsphdr is sent as payload, + hence the allocated rsphdr buffer is also sent on the wire, increasing + the bandwidth consumption on the wire. - Change-Id: I2edb857696191e872ad12a12efc36999626bacc7 - Signed-off-by: N Balachandran + With this patch, the issue is fixed. + + Fixes: bz#1692101 + Change-Id: Ie8158921f4db319e60ad5f52d851fa5c9d4a269b + Signed-off-by: Poornima G -commit 16fb69c519b3d61bf57065587439b4260b40291a -Author: Sunny Kumar -Date: Wed Oct 17 15:40:04 2018 +0530 +commit 4e7afab231e22fc740e2d8a39fd7eaefd1fa9f2f +Author: Ravishankar N +Date: Thu Mar 14 18:41:11 2019 +0530 - shard: prevent segfault in shard_unlink_block_inode() + gfapi: add function to set client-pid - gluster-blockd sometimes segfaults with the following backtrace: + This api offers the ability to set the pid of a client to a particular + value, identical to how gluster fuse clients provide the --client-pid + option. This is an internal API to be used by gluster processes only. See + https://lists.gluster.org/pipermail/gluster-devel/2019-March/055925.html + for more details. Currently glfsheal is the only proposed consumer. + + updates: bz#1693155 + Change-Id: I0620be2127d79d69cdd57cffb29bba44e6e5da1f + Signed-off-by: Ravishankar N + (cherry picked from commit 08d502c3b05c6f7831bb4cc764bd458b405a99b1) + +commit cba59f6cb7fe4e2b9e6b7e7f35c9d659b5fa5450 +Author: Yaniv Kaul +Date: Wed Mar 20 13:05:44 2019 +0200 + + server.c: fix Coverity CID 1399758 - Core was generated by `/usr/sbin/gluster-blockd --glfs-lru-count 5 --log-level INFO'. - Program terminated with signal 11, Segmentation fault. - #0 0x00007fbb9cd639b9 in shard_unlink_block_inode (local=local@entry=0x7fbb80000a78, shard_block_num=) at shard.c:2929 - 2929 base_ictx->fsync_count--; - (gdb) bt - #0 0x00007fbb9cd639b9 in shard_unlink_block_inode (local=local@entry=0x7fbb80000a78, shard_block_num=) at shard.c:2929 - #1 0x00007fbb9cd64311 in shard_unlink_shards_do_cbk (frame=frame@entry=0x7fbb9010a768, cookie=, this=, op_ret=, op_errno=, preparent=preparent@entry=0x7fbb7470dcf8, - postparent=postparent@entry=0x7fbb7470dd90, xdata=xdata@entry=0x0) at shard.c:2987 + 1399758 Dereference before null check - A fix for this has already been provided through a Converity report. + It was introduced @ commit 67f48bfcc16a38052e6c9ae7c25e69b03b8ae008 - Backport of: + updates: bz#1691187 + > updates: bz#789278 + > Signed-off-by: Yaniv Kaul - > Change-Id: Ic5d302a5e32d375acf8adc412763ab94e6dabc3d - > Signed-off-by: Sunny Kumar - > (cherry picked from commit 145e180517054626d07892219fdee689b703c218) + > Change-Id: I1424b008b240691fe2a8924e31c708d0fb4f362d + > (cherry picked from commit 8aff9cc5c6277ef7dacfb89f1392b7c2eda9b825) - Change-Id: I699a039e9c5115eb3376190dd8014427d12a293b - Updates: bz#1659563 - Signed-off-by: Niels de Vos + Change-Id: Ie2160fb9ae9cdeacf845e849da7f6001b3b6b10b -commit 32f55a2708903145a51de5705ca8e60ff6dd6f9e -Author: Krutika Dhananjay -Date: Wed Dec 19 17:57:58 2018 +0530 +commit 3fadf5cc41d5ea3195d2228d23e890f27fc22f87 +Author: ShyamsundarR +Date: Tue Mar 19 10:17:17 2019 -0400 - tests: Fix zero-flag.t script + doc: Final version of release-6 release notes - The default value of shard-block-size was changed from 4MB - to 64MB sometime back. The script "fallocate"s a 6MB file - and expects it to have 1 shard under .shard. This worked when - the shard-block-size was 4MB. With the default value now at 64MB, - file "file1" won't have any shards under .shard and the stat on the - 1st shard's path fails with ENOENT. - - Changed the script to explicitly set shard-block-size to 4MB. + Fixes: bz#1672818 + Change-Id: I6a98985a7f25bc2b85af5bd85f4be3ffac7d619d + Signed-off-by: ShyamsundarR + +commit 7e90a3b592018f4e0d270d7102cf83aa3eb242d2 +Author: Kotresh HR +Date: Tue Mar 19 12:45:36 2019 +0530 + + release-notes/6.0: Add ctime feature changes in release notes - Change-Id: I7f1785922287d16d74c95fa57cbbe12e6e66e4f7 - fixes: bz#1660932 - Signed-off-by: Krutika Dhananjay - (cherry picked from commit e69fc87593334b24432978dbf592fa73fe5fc38b) + Change-Id: I3a305b9eb292a450c83de5628ceeadcb0a44afc7 + updates: bz#1672818 + Signed-off-by: Kotresh HR + Signed-off-by: ShyamsundarR -commit ae7f60235a1a6f9577e0ba2ab1cb425adb9810d0 -Author: ShyamsundarR -Date: Wed Dec 12 21:15:09 2018 -0500 +commit 1398fa80455b3b825807ec508c45033ccfffdf7a +Author: Amar Tumballi +Date: Mon Mar 18 15:57:03 2019 +0530 - doc: release notes for release 5.2 + release-notes: add status of gd2 and a highlights section - Fixes: bz#1649895 - Change-Id: Ic8f59df9d99efafd56c930e30040f046654a1f9e + Change-Id: Idd4fd07b3fcdd7810c242eff0dcca9072048a43e + fixes: bz#1672818 + Signed-off-by: Amar Tumballi Signed-off-by: ShyamsundarR -commit d7a4d256bd86aadcd60668ee37079514dfcf41f3 -Author: Ravishankar N -Date: Sun Sep 23 16:59:58 2018 +0530 +commit c7a582818db71d50548a2cfce72ce9402ef5599a +Author: Mohit Agrawal +Date: Tue Mar 12 13:27:34 2019 +0530 - afr: thin-arbiter 2 domain locking and in-memory state + glusterfsd: Brick is getting crash at the time of startup - 2 domain locking + xattrop for write-txn failures: - -------------------------------------------------- - - A post-op wound on TA takes AFR_TA_DOM_NOTIFY range lock and - AFR_TA_DOM_MODIFY full lock, does xattrop on TA and releases - AFR_TA_DOM_MODIFY lock and stores in-memory which brick is bad. + Problem: Brick is getting crash because graph was not activated + at the time of accessing server_conf - - All further write txn failures are handled based on this in-memory - value without querying the TA. + Solution: To avoid the crash check ctx->active before processing + a request - - When shd heals the files, it does so by requesting full lock on - AFR_TA_DOM_NOTIFY domain. Client uses this as a cue (via upcall), - releases AFR_TA_DOM_NOTIFY range lock and invalidates its in-memory - notion of which brick is bad. The next write txn failure is wound on TA - to again update the in-memory state. + > Change-Id: Ib112e0eace19189e45f430abdac5511c026bed47 + > fixes: bz#1687705 + >(cherry picked from commit 67f48bfcc16a38052e6c9ae7c25e69b03b8ae008) + > (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/22339/) - - Any incomplete write txns before the AFR_TA_DOM_NOTIFY upcall release - request is got is completed before the lock is released. + Change-Id: I1367c564f04edbad145575b811c67522cc318851 + fixes: bz#1688218 + Signed-off-by: Mohit Agrawal + +commit 3bcf210a5a9b922ea78b31ef0de8eaf97ff4dcb4 +Author: Ashish Pandey +Date: Wed Jan 30 14:24:14 2019 +0530 + + rpm: add thin-arbiter package - - Any write txns got after the release request are maintained in a ta_waitq. + Discussion on thin arbiter volume - + https://github.com/gluster/glusterfs/issues/352#issuecomment-350981148 - - After the release is complete, the ta_waitq elements are spliced to a - separate queue which is then processed one by one. + Main idea of having this rpm package is to deploy thin-arbiter + without glusterd and other commands on a node, and all we need + on that tie-breaker node is to run a single glusterfs command. + Also note that, no other glusterfs installation needs + thin-arbiter.so. - - For fops that come in parallel when the in-memory bad brick is still - unknown, only one is wound to TA on wire. The other ones are maintained - in a ta_onwireq which is then processed after we get the response from - TA. + Make sure RPM contains sample vol file, which can work by default, + and a script to configure that volfile, along with translator image. - Change-Id: I32c7b61a61776663601ab0040e2f0767eca1fd64 - updates: bz#1648205 - Signed-off-by: Ravishankar N + Change-Id: Ibace758373d8a991b6a19b2ecc60c93b2f8fc489 + updates: bz#1672818 + Signed-off-by: Amar Tumballi Signed-off-by: Ashish Pandey + (cherry picked from commit ca9bef7f1538beb570fcb190ff94f86f0b8ba38a) -commit cc0da4931533d21dbc3b9478984e24a7056dc835 -Author: Raghavendra Bhat -Date: Thu Nov 29 12:04:45 2018 -0500 +commit bda2feeaf2917996c59c0c2188bfa1a17d91895f +Author: Anoop C S +Date: Fri Feb 22 10:24:44 2019 +0530 - features/bitrot: compare the signature with proper length - - * The scrubber was comparing the checksum of the file that it - calculated (by reading the file) with the on disk signature - (stored via xattr) wrongly. It was using strlen to calculate - the signature, while the actual length of the signature is - given by the brick. Just use the actual length that the brick - provides instead of trying to calculate the signature length via - strlen API. + doc: Update release notes for Samba integration - * In posix, gfid2path was using the same string that contains the - list of all the xattrs of file to save the value of the gfid2path - xattr as well. This causes confusion when gfid2path xattr is queried - by scrubber for getting the actual path of a corrupted file. Use - separate string to fetch the value of the xattr instead of the string - that contains the list of xattrs. + Change-Id: I2a246111522bd3cb0c9b228ed3387e72b0ac20a4 + updates: bz#1672818 + Signed-off-by: Anoop C S + +commit 05fce4e66881f778d69240e93eeb2e2912455666 +Author: Aravinda VK +Date: Mon Mar 4 13:39:18 2019 +0530 + + eventsapi: Fix error while handling GlusterCmdException - Backport of: - > Patch: https://review.gluster.org/21752/ - > BUG: 1654805 - > Change-Id: I2d664ab524d2b312233476cb35863dde3122e9a9 - (cherry picked from commit f77fb6d568616592ab25501c402c140d15235ca9) + `GlusterCmdException` was wrongly accessed instead of accessing + `GlusterCmdException.message`. - Change-Id: I2d664ab524d2b312233476cb35863dde3122e9a9 - fixes: bz#1654370 - Signed-off-by: Raghavendra Bhat + Fixes: bz#1687248 + Change-Id: I35ec1b05726050bfd8761e05ad9b9e47917dc0c6 + Signed-off-by: Aravinda VK + (cherry picked from commit 27f6375df009c8c4798b72aeafce79456007d21f) -commit fbdaffdb6d90409124507b3d9b15fc5d6b3ed8e6 -Author: Ravishankar N -Date: Fri Sep 28 17:00:00 2018 +0530 +commit 36c75523c1f0545f32db4b807623a8f94df98ca7 +Author: Mohit Agrawal +Date: Fri Mar 1 13:41:24 2019 +0530 + + glusterfsd: Multiple shd processes are spawned on brick_mux environment + + Problem: Multiple shd processes are spawned while starting volumes + in the loop on brick_mux environment.glusterd spawn a process + based on a pidfile and shd daemon is taking some time to + update pid in pidfile due to that glusterd is not able to + get shd pid + + Solution: Commit cd249f4cb783f8d79e79468c455732669e835a4f changed + the code to update pidfile in parent for any gluster daemon + after getting the status of forking child in parent.To resolve + the same correct the condition update pidfile in parent only + for glusterd and for rest of the daemon pidfile is updated in + child + + > Change-Id: Ifd14797fa949562594a285ec82d58384ad717e81 + > fixes: bz#1684404 + > (Cherry pick from commit 66986594a9023c49e61b32769b7e6b260b600626) + > (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/22290/) + + Change-Id: I9a68064d2da1acd0ec54b4071a9995ece0c3320c + fixes: bz#1683880 + Signed-off-by: Mohit Agrawal - afr: assign gfid during name heal when no 'source' is present. +commit 9b58cfc83c26aa09eb1de8187cc65ed0c3390e97 +Author: karthik-us +Date: Thu Mar 7 22:26:49 2019 +0530 + + cluster/afr: Send truncate on arbiter brick from SHD Problem: - If parent dir is in split-brain or has dirty xattrs set, and the file - has gfid missing on one of the bricks, then name heal won't assign the - gfid. + In an arbiter volume configuration SHD will not send any writes onto the arbiter + brick even if there is data pending marker for the arbiter brick. If we have a + arbiter setup on the geo-rep master and there are data pending markers for the files + on arbiter brick, SHD will not mark any data changelog during healing. While syncing + the data from master to slave, if the arbiter-brick is considered as ACTIVE, then + there is a chance that slave will miss out some data. If the arbiter brick is being + newly added or replaced there is a chance of slave missing all the data during sync. Fix: - Use the brick we select the gfid from as the 'source'. - - Note: Problem was found while trying to debug a split-brain issue on - Cynthia Zhou's setup. + If there is data pending marker for the arbiter brick, send truncate on the arbiter + brick during heal, so that it will record truncate as the data transaction in changelog. - fixes: bz#1655545 - Change-Id: Id088d4f0fb017aa35122de426654194e581ed742 - Reported-by: Cynthia Zhou - Signed-off-by: Ravishankar N - (cherry picked from commit 4d58730c0cd6ab5db39aec8a15276f7bd3371b04) + Change-Id: I3242ba6cea6da495c418ef860d9c3359c5459dec + fixes: bz#1687672 + Signed-off-by: karthik-us -commit 2438964129d37a6ec62006916ff4e454f6b034b9 -Author: Soumya Koduri -Date: Wed Nov 28 12:45:41 2018 +0530 +commit 0d0b54a9de6ed7e13495d1bbbfcf43d7ac13adc2 +Author: Mohit Agrawal +Date: Tue Mar 5 13:39:46 2019 +0530 - leases: Do not conflict with internal fops + glusterd: glusterd memory leak while running "gluster v profile" in a loop - Internal fops (with frame->root->pid < 0) are used to heal - or move data and maintains data integrity. That is they do not - modify client data which holds the lease. Hence no need to recall - Lease for such fops. + Problem: glusterd has memory leak while running "gluster v profile" + in a loop - Note: Like for locks, we would need rebalance and self-heal - daemon process to heal lease state as well. + Solution: Resolve leak code path to avoid leak - Change-Id: I8988693fef8d00e17c19dcc842e2238f9eb5ab48 - updates: bz#1651323 - Signed-off-by: Soumya Koduri - (cherry picked from commit 080aa5b9e9d998552e23f7c33aed3afb0ca93c34) + > Change-Id: Id608703ff6d0ad34ed8f921a5d25544e24cfadcd + > fixes: bz#1685414 + > (Cherry pick from commit 9374484917466dff4688d96ff7faa0de1c804a6c) + > (Reviewed on link https://review.gluster.org/#/c/glusterfs/+/22301/) + + Change-Id: I1ca118265f97b188f94b3d5cff649ec36cb18ca0 + fixes: bz#1685771 + Signed-off-by: Mohit Agrawal -commit b75d7a540509a4fd9ead6fb74e525a8ba31dfc7c -Author: Kotresh HR -Date: Mon Nov 5 11:46:41 2018 +0530 +commit 47ed784e3759df8b237436a86f0d27acbe5efa81 +Author: Kaleb S. KEITHLEY +Date: Fri Mar 8 10:17:14 2019 -0500 - geo-rep: Fix traceback with symlink metadata sync + packaging: rdma on s390x, unnecessary ldconfig scriptlets - While syncing metadata, 'os.chmod', 'os.chown', - 'os.utime' should be used without de-reference. - But python supports only 'os.chown' without - de-reference. That's mostly because Linux - doesn't support 'chmod' on symlink file itself - but it does support 'chown'. + s390x has rdma since around fedora27, and in RHEL7 since July 2016. + see https://src.fedoraproject.org/rpms/glusterfs/pull-request/5 - So while syncing metadata ops, if it's symlink - we should only sync 'chown' and not do 'chmod' - and 'utime'. It will lead to tracebacks with - errors like EROFS, EPERM, ACCESS, ENOENT. - All the three errors (EPERM, ACCESS, ENOENT) - were handled except EROFS. But the way it was - handled was not fool proof. The operation is - tried and failure was handled based on the errors. - All the errors with symlink file for 'chown', - 'utime' had to be passed to safe errors list of - 'errno_wrap'. This patch handles it better by - avoiding 'chmod' and 'utime' if it's symlink - file. - Backport of : - < Patch: https://review.gluster.org/21546/ - > BUG: bz#1646104 - > Change-Id: Ic354206455cdc7ab2a87d741d81f4efe1f19d77d - > Signed-off-by: Kotresh HR - (cherry picked from commit 3c6cf9a4a1b46cab2dc53c1ee0afca0fe993102e) + Reported-By: Igor Gnatenko + Reported-By: Dan Horák + master branch Change-Ids: + > Change-Id: Idad29425495f9c69bfd84b53b009a607abb418f0 + > Change-Id: I914f36290e96a387cdd64ee633e75c2940ec1e56 - fixes: bz#1654115 - Change-Id: Ic354206455cdc7ab2a87d741d81f4efe1f19d77d - Signed-off-by: Kotresh HR + Change-Id: I7747700e982b365533ebd031164708b9ad97f18a + fixes: bz#1686875 + Signed-off-by: Kaleb S. KEITHLEY -commit b710f812101233c0b25edcb0f59d197bcd9d0026 -Author: Soumya Koduri -Date: Sun Nov 18 23:38:08 2018 +0530 +commit 7964a320f380fa23727795ad6456ef0020fab35c +Author: Sanju Rakonde +Date: Mon Mar 4 16:53:01 2019 +0530 - gfapi: Offload callback notifications to synctask + core: make compute_cksum function op_version compatible - Upcall notifications are received from server via epoll - and same thread is used to forward these notifications - to the application. This may lead to deadlock and hang - in the following scenario. + Problem: commit 5a152a changed the mechansim of computing the + checksum. In heterogeneous cluster, peers are running into + rejected state because we have different cksum computation + mechansims in upgraded and non-upgraded nodes. - Consider if as part of handling these callbacks, - application has to do some operations which involve - sending I/Os to gfapi stack which inturn have to wait for - epoll threads to receive repsonse. Thus this may lead to - deadlock if all the epoll threads are waiting to complete - these callback notifications. + Solution: add a check for op-version so that all the nodes + in the cluster follow the same mechanism for computing the + cksum. - To address it, instead of using epoll thread itself, - make use of synctask to send those notificaitons to the - application. + fixes: bz#1684029 - Change-Id: If614e0d09246e4279b9d1f40d883a32a39c8fd90 - updates: bz#1651323 - Signed-off-by: Soumya Koduri - (cherry picked from commit ad35193718a99494ab1b852ca4cbdf054f73de88) + > Change-Id: I1508f000e8c9895588b6011b8b6cc0eda7102193 + > BUG: bz#1685120 + > Signed-off-by: Sanju Rakonde + > (cherry picked from commit 073444b693b7a91c42963512e0fdafb57ad46670) + + Change-Id: I1508f000e8c9895588b6011b8b6cc0eda7102193 -commit f17188e4aa5e02d266cf147cf418e6cc27f5db21 -Author: Soumya Koduri -Date: Mon Oct 29 14:41:26 2018 +0530 +commit 9c441360acc7288b75ba948726d2b7bc2e3d561c +Author: Amar Tumballi +Date: Tue Mar 5 08:39:16 2019 +0530 - lease: Treat unlk request as noop if lease not found + dict: handle STR_OLD data type in xdr conversions - When the glusterfs server recalls the lease, it expects - client to flush data and unlock the lease. If not it sets - a timer (starting from the time it sends RECALL request) and post - timeout, it revokes it. + Currently a dict conversion on wire for 3.x protocol happens using + `dict_unserialize()`, which sets the type of data as STR_OLD. But the + new protocol doesn't send it over the wire as its not considered as a + valid format in new processes. - Here we could have a race where in client did send UNLK - lease request but because of network delay it may have reached - after server revokes it. To handle such situations, treat - such requests as noop and return sucesss. + But considering we deal with old and new protocol when we do a rolling + upgrade, it will allow us to get all the information properly with new + protocol. - Change-Id: I166402d10273f4f115ff04030ecbc14676a01663 - updates: bz#1651323 - Signed-off-by: Soumya Koduri - (cherry picked from commit c2e758b54d8a3f778e3e63db0000bb8b63de9b25) + Credits: Krutika Dhananjay + + Fixes: bz#1686364 + Change-Id: I165c0021fb195b399790b9cf14a7416ae75ec84f + Signed-off-by: Amar Tumballi -commit 426e128b98f84d185a7d53ec36b9ad12a7facc40 -Author: Kotresh HR -Date: Tue Nov 20 12:36:55 2018 +0530 +commit ae24a2c3903b402e701eca03c5b0de3f4382cb5c +Author: Raghavendra Gowdappa +Date: Thu Mar 7 16:35:33 2019 +0530 - geo-rep: Fix permissions with non-root setup + performance/readdir-ahead: fix deadlock - Problem: - In non-root fail-over/fail-back(FO/FB), when slave is - promoted as master, the session goes to 'Faulty' + This deadlock happens while processing dentry corresponding to current + directory (.) in rda_fill_readdirp. In this case following order is + followed: - Cause: - The command 'gluster-mountbroker ' - is run as a pre-requisite on slave in non-root setup. + LOCK(directory_fd_ctx->lock); + rda_inode_ctx_get_iatt -> LOCK(directory_inode->lock); + + However, in rda_mark_inode_dirty following lock order is followed: + LOCK(directory_inode->lock); + LOCK(directory_fd_ctx->lock); + + these two codepaths when executed concurrently resulted in a deadlock. + + Current patch fixes this by removing locking directory inode and + fd-ctx in rda_fill_readdirp. This is fine as directory inode's stat + won't change due to writes to files within directory. + + Change-Id: Ic93a67a0dac8229bb0d79582e526a512e6f2569c + Signed-off-by: Raghavendra Gowdappa + Fixes: bz#1686399 + +commit 8444c1ea54936732764c12aee075af8b6d952975 +Author: Susant Palai +Date: Wed Feb 20 15:52:55 2019 +0530 + + io-threads: Prioritize fops with NO_ROOT_SQUASH pid + + There was 30% regression observed in mkdir path with commit + b139bc58eb504adf5ef81658896c9283ae21f390. On analysis it is found + that io-threads xlator deprioritzes fops with all -ve pid. + + Some context in to the no-root-squash pid requirement: + DHT xlator does some of the internal fops with root privileges. This is + needed so that operations like layout healing should not be abandoned + because a non root user is operating. If root-squash option is enabled + the layout set operation looses its root privilege as server xlator + converts the uid and pid to random numbers. Hence, the above mentioned + commit converted pid to GF_CLIENT_PID_NO_ROOT_SQUASH to continue fops + as root. + + Combining the above I am proposing not to deprioritize fops with + no-root-squash pid. + + > Change-Id: I54d056c01b25729304a77f9242fbaff39c5672ba + > fixes: bz#1676430 + > Signed-off-by: Susant Palai + (cherry picked from commit f5c3b1727f55ffaa3dcdb3c3a09b968ebb45dbb2) + + Change-Id: I54d056c01b25729304a77f9242fbaff39c5672ba + fixes: bz#1676429 + Signed-off-by: Susant Palai + +commit ea78c029a769e09fe2c9408f8b29b55f47141606 +Author: hujianfei +Date: Fri Feb 15 04:07:46 2019 -0500 + + glusterfsd: Do not process PROFILE_NFS_INFO if graph is not ready + + Otherwise, gnfs will crash in following situation. + Also see commit 2f9e555f. + + Reproducible Steps: + 1. kill gnfs process + 2. service glusterd restart;gluster volume profile [vol] info nfs + + dump trace info: + /lib64/libglusterfs.so.0(_gf_msg_backtrace_nomem+0xc2)[0x7fcf5cb6a872] + /lib64/libglusterfs.so.0(gf_print_trace+0x324)[0x7fcf5cb743a4] + /lib64/libc.so.6(+0x35670)[0x7fcf5b1d5670] + /usr/sbin/glusterfs(glusterfs_handle_nfs_profile+0x114)[0x7fcf5d066474] + /lib64/libglusterfs.so.0(synctask_wrap+0x12)[0x7fcf5cba1502] + /lib64/libc.so.6(+0x47110)[0x7fcf5b1e7110] + + Fixes: bz#1684777 + + Change-Id: Id68edb3e4646c39544e0b4c90b5e0a9083b37b0d + Signed-off-by: hujianfei + (cherry picked from commit 09394856e1197db4933e7e814589a3340eb739cd) + +commit 06a65016f17452130d826baea5b3879122dc950e +Author: Kaleb S. KEITHLEY +Date: Fri Feb 22 09:25:26 2019 -0500 + + glusterfind: revert shebangs to #!/usr/bin/python3 + + Using #!/usr/bin/env python is illegal in Fedora and RHEL packaging. + (Debian and SUSE packaging will complain about it too but don't + enforce it like Fedora packaging does. Yet.) + + We went through a giant exercise fixing these once already. + + The python needs to be python2/python3 clean. There is a build + scriptlet that converts the shebangs back to /usr/bin/python on rhel7. + + Change-Id: If208a2557f7e5d727cda98c27905e249cf485d5b + fixes: bz#1683716 + Signed-off-by: Kaleb S. KEITHLEY + +commit 4cb1d6d94ac85c5e79171f8989b545ca098b61d9 +Author: Milind Changire +Date: Fri Feb 15 14:20:07 2019 +0530 + + socket: socket event handlers now return void + + Problem: + Returning any value from socket event handlers to the event sub-system + doesn't make sense since event sub-system cannot handle socket + sub-system errors. + + Solution: + Change return type of all socket event handlers to 'void' + + mainline: + > Change-Id: I70dc2c57f12b7ea2fae41120f71aa0d7fe0b2b6f + > Fixes: bz#1651246 + > Signed-off-by: Milind Changire + > Reviewed-on: https://review.gluster.org/c/glusterfs/+/22221 + + Change-Id: I70dc2c57f12b7ea2fae41120f71aa0d7fe0b2b6f + Fixes: bz#1683900 + Signed-off-by: Milind Changire + (cherry picked from commit 776ba851c6ee6c265253d44cf1d6e4e3d4a21772) + +commit cd6795c5e8ebdf23c6fd350d8df49e5b22b09056 +Author: Arjun Sharma +Date: Thu Feb 21 18:09:50 2019 +0530 + + Updating the glfs_setattr and glfs_fsetattr public APIs to use glfs_stat + + Change-Id: I0e86c8222c88b4c71087ec287ba81f8353d70822 + updates: #389 + Signed-off-by: Arjun + +commit 73b8d6c8d1da7481f3d31698d07ed2e0658a153f +Author: Sanju Rakonde +Date: Tue Feb 26 21:48:21 2019 +0530 + + glusterd: remove experimental xlator options from glusterd-volume-set.c + + experimental xlators have been removed from the codebase. But we + missed to remove the options related to experimental xlators from + the codebase. This patch removes those options. + + fixes: bz#1683506 + Change-Id: I3fa7e14c6cd8ebde5cebc8d2b0cb2409bf37c1ae + Signed-off-by: Sanju Rakonde + (cherry picked from commit 5cddd4d758014fe116d9c130632eada2ecded88c) + +commit 77f327862a60d602fe5d9847331e018de65f30a7 +Author: Aravinda VK +Date: Thu Feb 21 11:25:55 2019 +0530 + + eventsapi: Fix Python3 compatibility issues + + - Fixed Relative import and non-package import related issues. + - socketserver import issues fix + - Renamed installed directory name to `gfevents` from `events`(To + avoid any issues with other global libs) + + Fixes: bz#1683008 + Change-Id: I3dc38bc92b23387a6dfbcc0ab8283178235bf756 + Signed-off-by: Aravinda VK + (cherry picked from commit cd68f7b88b9a2c9a4e4ff9fca61517384e54130a) + +commit 3d7cd3d0f56f31dc8d87e9403f2c734c14de63f9 +Author: Niels de Vos +Date: Mon Feb 25 12:32:21 2019 +0100 + + build: do not install service related files when building --without-server + + It seems that glusterfs-6 disables building the server (./configure + --without-server) on el6 and hence the installed but unpackaged files + should not get installed in the first place. + + Backport of commit 30f358bb6b69b8c31da550608a4996a84e8b420b: + > Change-Id: I7bea08202dd59ac309de8bc861da920ed3600bc6 + > Fixes: bz#1680587 + > Signed-off-by: Niels de Vos + + Change-Id: I7bea08202dd59ac309de8bc861da920ed3600bc6 + Fixes: bz#1680586 + Signed-off-by: Niels de Vos + +commit 0419d9ab932a2f4f9e734a92df8912be0b51f046 +Author: Amar Tumballi +Date: Tue Feb 12 14:41:49 2019 +0530 + + fuse: reflect the actual default for lru-limit option + + in both `--help` text and man page + + updates: bz#1679998 + Change-Id: I9aa9367c6863ac8e2403255280697c9e6be26cf0 + Signed-off-by: Amar Tumballi + +commit c360210685b2ebb152b45f24257cc19a12884cac +Author: David Spisla +Date: Tue Feb 19 14:56:11 2019 +0100 + + md-cache: Adapt integer data types to avoid integer overflow + + The "struct iatt" in iatt.h is using int64_t types for storing + the atime, mtime and ctime. Therefore the struct 'struct md_cache' in + md-cache.c should also use this types to avoid an integer overflow. + + This can happen e.g. if someone uses a very high default-retention-period + in the WORM-Xlator. + + Change-Id: I605268d300ab622b9c8ab30e459dc00d9340aad1 + fixes: bz#1680020 + Signed-off-by: David Spisla + (cherry picked from commit 15423e14f16dd1a15ee5e5cbbdbdd370e57ed59f) + +commit fce763a6fcd9331356e7d32c1aa8daf9e991aa56 +Author: Niels de Vos +Date: Fri Feb 22 15:17:48 2019 +0100 + + build: include gluster/__init__.* files for python packaging + + The gluster/__init__.py file was originaly part of the glupy + installation. This file is required to have the python-gluster package + function correctly, it is expected to provide the 'gluster' namespace + for other python packages (like from the libgfapi-python project). + + Because glupy does not exist anymore, this file is now added to in a new + extras/python directory. + + Backport of commit b235a56394c09bb1d7308a620053dbe098d15967: + > Change-Id: I14fe959778ee3344d7d54ba342c7928a4d8080a2 + > Fixes: c3fcff9ccbfcec1be242fd5cf210c9995586b078 + > Fixes: 8293d21280fd6ddfc9bb54068cf87794fc6be207 + > Updates: bz#1642810 + > Signed-off-by: Niels de Vos + + Change-Id: I04e1e0dc4022b53c02053d5452f305b78e56c389 + Updates: bz#1680585 + Signed-off-by: Niels de Vos + +commit 5801a0e30e317bb752a121187332ba9f307cbb62 +Author: Sahina Bose +Date: Mon Feb 11 11:07:49 2019 +0530 + + packaging: Obsoleting glusterfs-gnfs for upgrade + + Master branch reference + >link : https://review.gluster.org/#/c/glusterfs/+/22190/ + >fixes: bz#1672711 + >Change-Id: Iad7194e788a8eeecd617614e9f8a1fe3264a384d + >Signed-off-by: Sahina Bose + >Signed-off-by: Jiffin Tony Thottan + >(cherry picked from commit d3608bd26cbc3e47fc0e60e85bd9f66515e050b1) + + fixes: bz#1679965 + Change-Id: Iad7194e788a8eeecd617614e9f8a1fe3264a384d + Signed-off-by: Jiffin Tony Thottan + +commit e6fabf8c330ec4ce540bf8a4daebd39320c407d9 +Author: ShyamsundarR +Date: Mon Feb 18 15:02:10 2019 -0500 + + doc: Added initial release notes for release-6 + + Change-Id: I31fff344045344c501536b207c864e90ed34bf20 + updates: bz#1672818 + Signed-off-by: ShyamsundarR + +commit 951abf5c53d4658b86b00ffb1147989c07527c3f +Author: N Balachandran +Date: Wed Feb 6 09:58:55 2019 +0530 + + cluster/dht: Request linkto xattrs in dht_rmdir opendir + + If parallel-readdir is enabled, the rda xlator is loaded + below dht in the graph and proactively lists and caches + entries when an opendir is performed. dht_rmdir checks if + the directory being deleted contains stale linkto files by + performing a readdirp on its child subvols. However, as + the entries are actually read in during the opendir operation + which does not request the linkto xattr,no linkto xattrs are + present for the entries causing dht to incorrectly identify + them as data files and fail the rmdir operation with ENOTEMPTY. + DHT now always adds the linkto xattr in the list of xattrs + requested in the opendir. + + Change-Id: I0711198e66c59146282eb8b88084170bedfb4018 + fixes: bz#1679004 + Signed-off-by: N Balachandran + +commit 5c9b2dfb4d251cc0201759c495bbd4d1ad5e3c87 +Author: Kinglong Mee +Date: Tue Jan 8 16:38:45 2019 +0800 + + dht: fix double extra unref of inode at heal path + + The loc_wipe is done in the _out_ section, inode_unref(loc.parent) here + casues a double extra unref of loc.parent. + + > Change-Id: I2dc809328d3d34bf7b02c7df9a4f97788af511e6 + > Signed-off-by: Kinglong Mee + (cherry-pick of https://review.gluster.org/#/c/glusterfs/+/21998/) + + Change-Id: I2dc809328d3d34bf7b02c7df9a4f97788af511e6 + updates: bz#1679275 + Signed-off-by: Susant Palai + +commit bff265f8bc12eb43e82732b6ae81abf18a4b7a97 +Author: Raghavendra Gowdappa +Date: Wed Feb 13 17:08:14 2019 +0530 + + performance/write-behind: fix use-after-free in readdirp + + Two issues were found: + 1. in wb_readdirp_cbk, inode should unrefed after wb_inode is + unlocked. Otherwise, inode and hence the context wb_inode can be freed + by the type we try to unlock wb_inode + 2. wb_readdirp_mark_end iterates over a list of wb_inodes of children + of a directory. But inodes could've been freed and hence the list + might be corrupted. To fix take a reference on inode before adding it + to invalidate_list of parent. + + Change-Id: I911b0e0b2060f7f41ded0b05db11af6f9b7c09c5 + Signed-off-by: Raghavendra Gowdappa + Updates: bz#1678570 + (cherry picked from commit 64cc4458918e8c8bfdeb114da0a6501b2b98491a) + +commit 1f8b2912c83d1e5ce95f9d73fcf7397c3435ba67 +Author: Raghavendra Gowdappa +Date: Tue Feb 19 08:04:52 2019 +0530 + + performance/write-behind: handle call-stub leaks + + Change-Id: I7be9a5f48dcad1b136c479c58b1dca1e0488166d + Signed-off-by: Raghavendra Gowdappa + Fixes: bz#1678570 + (cherry picked from commit 6175cb10cd5f59f3c7ae4100bc78f359b68ca3e9) + +commit 8d4b8e2644917ed25a9d9bef37803c4a2f7da84f +Author: N Balachandran +Date: Tue Feb 12 13:58:54 2019 +0530 + + cluster/dht: Fix lookup selfheal and rmdir race + + A race between the lookup selfheal and rmdir can cause + directories to be healed only on non-hashed subvols. + This can prevent the directory from being listed from + the mount point and in turn causes rm -rf to fail with + ENOTEMPTY. + Fix: Update the layout information correctly and reduce + the call count only after processing the response. + + Change-Id: I812779aaf3d7bcf24aab1cb158cb6ed50d212451 + fixes: bz#1677260 + Signed-off-by: N Balachandran + +commit 2026d246676679fba0970b1be9ae181afdcfbee6 +Author: Raghavendra Gowdappa +Date: Fri Feb 8 09:51:17 2019 +0530 + + performance/md-cache: introduce an option to control invalidation of inodes + + Explicit invalidation by calling inode_invalidate is necessary when + same (meta)data is shared/access across multiple mounts. Without an + explicit inode_invalidate call, caches in the mount which didn't + witness writes wouldn't be aware of changes as writes wouldn't have + passed through them. However, if (meta)data is not shared, all + relevant I/O goes through the cache of single mount and hence is + coherent with (meta)data on bricks always. So, explicit inode + invalidation can be disabled for this case which gives a huge + performance boost for workloads that write data and then immediately + read the data they just wrote. Note that otherwise, local writes + (which pass through the cache) will change ctime and cause unnecessary + invalidations. + + The name of the option that controls this behavior is + "performance.global-cache-invalidation". This option is global and it + purges caches both in glusterfs and kernel stack for native FUSE + mounts. For non-native FUSE mounts, it purges cache only from + glusterfs stack. This option is effective only when + performance.stat-prefetch is on. + + Note that there is a similar option "performance.cache-invalidation", + but the scope of that option is limited to quick-read and md-cache. + + Change-Id: I462bb4b65ff9aae1f6ba76f50b1f2f94fb10323b + Signed-off-by: Raghavendra Gowdappa + updates: bz#1674364 + (cherry picked from commit 2b5aa4489de2017a03bcb6ec8986286f0c76a670) + +commit beca73e04dfd92964db26aa46c10d704e47717d4 +Author: Raghavendra Gowdappa +Date: Fri Feb 8 17:39:49 2019 +0530 + + mount/fuse: fix bug related to --auto-invalidation in mount script + + When "auto-invalidation" option was not specified for mount script, + glusterfs cmdline ended with "--auto-invalidation=" option. This patch + fixes that bug in mount script. + + Thanks to Amar for reporting it. + + Change-Id: Ie5cd4c6ffb3ac644d9d2b032035f914a935d05a8 + Signed-off-by: Raghavendra Gowdappa + updates: bz#1674364 + +commit e571233df3ea247eaf2ae5e06c331060dc75f9d3 +Author: Atin Mukherjee +Date: Thu Feb 7 14:45:39 2019 +0530 + + glusterd: improve logging + + glusterd_resolve_all_bricks failure log should highlight the brick + identifier. + + Change-Id: I035b4650ef6a14bb1e1221d3bad1c40f9d43dbdd + fixes: bz#1673972 + Signed-off-by: Atin Mukherjee + (cherry picked from commit 12af2067a82e37079e76723d3e25ba1c72ca078a) + +commit 352e203266e9ae845aeea139fba670e702c634ed +Author: ShyamsundarR +Date: Tue Feb 5 20:44:28 2019 -0500 + + api: Update all future API versions to rel-6 + + As release 6 is branched, all future APIs now become 6.0 + + This change implements the same. + + Change-Id: I6db368b4dc8585278ec11d4a411adcd04635de53 + Updates: bz#1672818 + Signed-off-by: ShyamsundarR + (cherry picked from commit ddcb3c7438472072daa6fbe3f3b87067b6d7bc54) + +commit 8f6973e326543f66e06b5307d209e592cefab846 +Author: Nigel Babu +Date: Mon Jan 21 12:17:04 2019 +0530 + + Bump up timeout for tests on AWS + + Fixes: bz#1673267 + Change-Id: I2b9be45f199f6436b858536c6f49be85902217f0 + Signed-off-by: Nigel Babu + +commit c396ba182639a429df5b27ecf4984164126934ff +Author: ShyamsundarR +Date: Tue Feb 5 19:59:13 2019 -0500 + + Update rfc.sh for release-6 + + Signed-off-by: ShyamsundarR + +commit 90922d20f55e26b23bfab0fbc4e179e305c38037 +Author: Sanju Rakonde +Date: Mon Feb 4 15:07:14 2019 +0530 + + glusterd: get-state command should not fail if any brick is gone bad + + Problem: get-state command will error out, if any of the underlying + brick(s) of volume(s) in the cluster go bad. + + It is expected that get-state command should not error out, but + should generate an output successfully. + + Solution: In glusterd_get_state(), a statfs call is made on the + brick path for every bricks of the volumes to calculate the total + and free memory available. If any of statfs call fails on any + brick, we should not error out and should report total memory and free + memory of that brick as 0. + + This patch also handles a statfs failure scenario in + glusterd_store_retrieve_bricks(). + + fixes: bz#1672205 + + Change-Id: Ia9e8a1d8843b65949d72fd6809bd21d39b31ad83 + Signed-off-by: Sanju Rakonde + +commit a9b51f2d1fd3a8be6496b62b989b6838b542936b +Author: Kotresh HR +Date: Fri Feb 1 12:24:14 2019 +0530 + + geo-rep: Fix configparser import issue + + 'configparser' is backported to python2 and can + be installed using pip (pip install configparser). + So trying to import 'configparser' first and later + 'ConfigParser' can cause issues w.r.t unicode strings. + + Always try importing 'ConfigParser' first and then + 'configparser'. This solves python2/python3 compat + issues. + + Change-Id: I2a87c3fc46476296b8cb547338f35723518751cc + fixes: bz#1671637 + Signed-off-by: Kotresh HR + +commit f87a3e840306052a120529ea5a190240179078c1 +Author: Rinku Kothiya +Date: Mon Jan 21 11:16:09 2019 +0000 + + cli: Added the group option for volume set + + gluster volume set group is used for setting multiple + pre-defined volume options, but this was undocumented. This patch doc- + ments this feature. + + fixes: bz#1243991 + + Change-Id: Id346cf2537f85179caff32479f09555ce2e72e76 + Signed-off-by: Rinku Kothiya + +commit ec05f3a21f44e1fd5e089b7a0fffd5265b67cdfc +Author: Amar Tumballi +Date: Mon Dec 17 14:16:21 2018 +0530 + + glusterd: manage upgrade to current master + + Scenarios tested: + + * Upgrade the node when there are stripe / tiering and regular + type of volumes are present. + - All volumes are started fine (as the change was not on brick volfile) + - For tier, the functionality may not even work, as changetimerecorder + is not present. + - 'gluster volume info' properly shows as 'NOT SUPPORTED' for stripe and + tier type of volume. + + * Upgrade in a rolling upgrade scenario, where an old version is + able to connect to higher master. + - on a normal volume, if the volfile-server was new, the newer client + volfiles needed to have utime xlator conditionally. + - with this one change, all other changes seem to work fine. + + Change-Id: Ib2d3b69dafa02b2c695a735b13c1aa70aba07cb8 + updates: bz#1635688 + Signed-off-by: Amar Tumballi + +commit da5ae3afcd1b16bb0f2f9bffc1878b17b75429ed +Author: N Balachandran +Date: Tue Jan 29 09:47:32 2019 +0530 + + cluster/dht: Do not use gfid-req in fresh lookup + + Fuse sets a random gfid-req value for a fresh lookup. Posix + lookup will set this gfid on entries with missing gfids causing + a GFID mismatch for directories. + DHT will now ignore the Fuse provided gfid-req and use the GFID + returned from other subvols to heal the missing gfid. + + Change-Id: I5f541978808f246ba4542564251e341ec490db14 + fixes: bz#1670259 + Signed-off-by: N Balachandran + +commit 23e530a135fc419fba401448290f8b1809e23f53 +Author: Shwetha K Acharya +Date: Mon Dec 10 13:45:34 2018 +0530 + + glusterfind: python2 to python3 compat + + Made necessary modifications to ensure python3 compatibilty. + + fixes: bz#1658116 + Change-Id: I5cf1d0447eaf3c44eb444245d1f67aadd60705c3 + Signed-off-by: Shwetha K Acharya + +commit a229ee1c8cdf8e0ac1abaeb60cabe6ab08f60546 +Author: Raghavendra Gowdappa +Date: Tue Jan 29 08:05:07 2019 +0530 + + mount/fuse: expose auto-invalidation as a mount option + + Auto invalidation is necessary when same (meta)data is shared/access + across multiple mounts. However, if (meta)data is not shared, all + relevant I/O goes through the cache of single mount and hence is + coherent with (meta)data on bricks always. So, fuse-auto-invalidation + can be disabled for this case which gives a huge performance boost for + workloads that write data and then immediately read the data they just + wrote. + + From glusterfs --help, + + + --auto-invalidation[=BOOL] controls whether fuse-kernel can + auto-invalidate attribute, dentry and page-cache. + Disable this only if same files/directories are + not accessed across two different mounts + concurrently [default: "on"] + + + Details on how disabling auto-invalidation helped to reduce pgbench + init times can be found at [1]. Time taken for pgbench init of scale + 8000 was 8340s. That will be an improvement of 86% (59280s vs 8340s) + with auto-invalidations turned off along with other + optimizations. Just disabling auto-invalidation contributed 56% + improvement by reducing the total time taken by 33260s. + + [1] https://www.spinics.net/lists/gluster-devel/msg25907.html + + Change-Id: I0ed730dba9064bd9c576ad1800170a21e100e1ce + Signed-off-by: Raghavendra Gowdappa + updates: bz#1664934 + +commit 4674678951a1315975d66016fb55c49100b7819f +Author: Xavi Hernandez +Date: Thu Jan 24 18:31:10 2019 +0100 + + core: make gf_thread_create() easier to use + + This patch creates a specific function to set the thread name using a + string format and a variable argument list, like printf(). + + This function is used to set the thread name from gf_thread_create(), + which now accepts a variable argument list to create the full name. It's + not necessary anymore to use a local array to build the name of the + thread. This is done automatically. + + Change-Id: Idd8d01fd462c227359b96e98699f8c6d962dc17c + Updates: bz#1193929 + Signed-off-by: Xavi Hernandez + +commit 6b98735956c599ea621fa560b201fb7de6c36cac +Author: Ashish Pandey +Date: Fri Dec 21 14:31:15 2018 +0530 + + cluster/thin-arbiter: Consider thin-arbiter before marking new entry changelog + + If a fop to create an entry fails on one of the data brick, + we mark the pending changelog on the entry on brick for which + it was successful. This is done as part of post op phase to + make sure that entry gets healed even if it gets renamed to + some other path where its parent was not marked as bad. + + As it happens as part of post op, we should consider thin-arbiter + to check if the brick, which was successful, is the good brick or not. + This will avoide split brain and other issues. + + Change-Id: I12686675be98f02f70a5186b3ed748c541514d53 + updates: bz#1662264 + Signed-off-by: Ashish Pandey + +commit 7eda6fe62d4e47937afc2ba71b4fd858399bca05 +Author: N Balachandran +Date: Mon Jan 28 11:55:17 2019 +0530 + + cluster/dht: Remove internal permission bits + + Rebalance sets the sgid and t bits on a file + that is being migrated. These permissions are + not removed in dht_readdirp_cbk when listing files + causing them to show up on the mountpoint. + We now remove these permissions if a non-linkto + file has the linkto xattr set. + + Change-Id: I5c69b2ecfe2df804fe50faea903b242d01729596 + fixes: bz#1669937 + Signed-off-by: N Balachandran + +commit 62a61c548d85d8c894907d7c43ef66c009a4757d +Author: Milind Changire +Date: Thu Jan 31 11:30:27 2019 +0530 + + core: move "dict is NULL" logs to DEBUG log level + + Too many logs get printed if dict_ref() and dict_unref() are passed NULL + pointer. + + fixes: bz#1671213 + Change-Id: I18afd849d64318f68baa7b549ee310dac0e1e786 + Signed-off-by: Milind Changire + +commit 2fb445babdd621b71676e40804fe98e95fc9084d +Author: Xavi Hernandez +Date: Thu Jan 31 08:13:58 2019 +0100 + + syncop: remove unnecessary call to gf_backtrace_save() + + A call to gf_backtrace_save() was done on each context switch of a + synctask. The backtrace is generated writing to the filesystem, so it + can have an important impact on latency. + + The generated backtrace was not used anywhere, so it's been removed. + + Change-Id: I399a93b932c5b6e981c696c72c3e1ef44710ba52 + Updates: bz#1193929 + Signed-off-by: Xavi Hernandez + +commit 8bc33a2d90df6439e7636aadbefdd9041f9698c3 +Author: Mohit Agrawal +Date: Sat Sep 29 13:15:35 2018 +0530 + + feature/bitrot: Avoid thread creation if xlator is not enabled + + Problem: Avoid thread creation for bitrot-stub + for a volume if feature is not enabled + + Solution: Before thread creation check the flag if feature + is enabled + + Updates: #475 + Change-Id: I2c6cc35bba142d4b418cc986ada588e558512c8e + Signed-off-by: Mohit Agrawal + Signed-off-by: Kotresh HR + +commit b41cdeb638f9f9ec2fef13ec95c216faf52a9df9 +Author: Mohit Agrawal +Date: Mon Jan 28 21:28:45 2019 +0530 + + core: heketi-cli is throwing error "target is busy" + + Problem: When rpc-transport-disconnect happens, server_connection_cleanup_flush_cbk() + is supposed to call rpc_transport_unref() after open-files on + that transport are flushed per transport.But open-fd-count is + maintained in bound_xl->fd_count, which can be incremented/decremented + cumulatively in server_connection_cleanup() by all transport + disconnect paths. So instead of rpc_transport_unref() happening + per transport, it ends up doing it only once after all the files + on all the transports for the brick are flushed leading to + rpc-leaks. + + Solution: To avoid races maintain fd_cnt at client instead of maintaining + on brick + + Credits: Pranith Kumar Karampuri + Change-Id: I6e8ea37a61f82d9aefb227c5b3ab57a7a36850e6 + fixes: bz#1668190 + Signed-off-by: Mohit Agrawal + +commit 09db11b0c020bc79d493c6d7e7ea4f3beb000c68 +Author: Ravishankar N +Date: Tue Jan 29 11:51:16 2019 +0530 + + readdir-ahead: do not zero-out iatt in fop cbk + + ...when ctime is zero. ia_type and ia_gfid always need to be non-zero + for things to work correctly. + + Problem: + Commit c9bde3021202f1d5c5a2d19ac05a510fc1f788ac zeroed out the iatt + buffer in the cbks of modification fops before unwinding if the ctime in + the buffer was zero. This was causing the fops to fail: noticeable when + AFR's 'consistent-metadata' option was enabled. (AFR zeros out the ctime + when the option is set. See commit + 4c4624c9bad2edf27128cb122c64f15d7d63bbc8). + + Fixes: + -Do not zero out the ia_type and ia_gfid of the iatt buff under any + circumstance. + -Also, fixed _rda_inode_ctx_update_iatts() to always update these values from + the incoming buf when ctime is zero. Otherwise we end up with zero + ia_type and ia_gfid the first time the function is called *and* the + incoming buf has ctime set to zero. + + fixes: bz#1670253 + Reported-By:Michael Hanselmann + Change-Id: Ib72228892d42c3513c19fc6dfb543f2aa3489eca + Signed-off-by: Ravishankar N + +commit 4aee035cd2a32750326b83b5fe08af7c8abab284 +Author: Kaleb S. KEITHLEY +Date: Tue Jan 29 03:16:16 2019 -0500 + + api: bad GFAPI_4.1.6 block + + missing global: line, tabs not spaces + + Change-Id: Icdbc23b4e4cd608da1d764e81757201c4b1269a6 + updates: bz#1193929 + Signed-off-by: Kaleb S. KEITHLEY + +commit 829337ed3971a53086f1562d826e79d4f3e3ed39 +Author: Amar Tumballi +Date: Mon Jan 28 18:30:24 2019 +0530 + + features/sdfs: disable by default + + With the feature enabled, some of the performance testing results, + specially those which create millions of small files, got approximately + 4x regression compared to version before enabling this. + + On master without this patch: 765 creates/sec + On master with this patch : 3380 creates/sec + + Also there seems to be regression caused by this in 'ls -l' workload. + + On master without this patch: 3030 files/sec + On master with this patch : 16610 files/sec + + This is a feature added to handle multiple clients parallely operating + (specially those which race for file creates with same name) on a single + namespace/directory. Considering that is < 3% of Gluster's usecase right + now, it makes sense to disable the feature by default, so we don't + penalize the default users who doesn't bother about this usecase. + Also note that the client side translators, specially, distribute, + replicate and disperse already handle the issue upto 99.5% of the cases + without SDFS, so it makes sense to keep the feature disabled by default. + + Credits: Shyamsunder for running the tests and + getting the numbers. + + Change-Id: Iec49ce1d82e621e9db25eb633fcb1d932e74f4fc + Updates: bz#1670031 + Signed-off-by: Amar Tumballi + +commit c7d1aee76d5713d1f337ab1c831c0ed74e4676e1 +Author: Yaniv Kaul +Date: Thu Dec 27 18:56:16 2018 +0200 + + Multiple files: reduce work while under lock. + + Mostly, unlock before logging. + In some cases, moved different code that was not needed + to be under lock (for example, taking time, or malloc'ing) + to be executed before taking the lock. + + Note: logging might be slightly less accurate in order, since it may + not be done now under the lock, so order of logs is racy. I think + it's a reasonable compromise. + + Compile-tested only! + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: I2438710016afc9f4f62a176ef1a0d3ed793b4f89 + +commit f747d55a7fd364e2b9a74fe40360ab3cb7b11537 +Author: Zhang Huan +Date: Tue Jan 8 16:17:06 2019 +0800 + + socket: fix issue on concurrent handle of a socket + + Found an issue on concurrent invoke of event handler to the same socket + fd, causing memory corruption. This issue arises after applying commit + "socket: Remove redundant in_lock in incoming message handling" that + removes priv->in_lock to serialize socket read. + + The following call sequence describes how concurrent socket event handle + happens. + thread 1 thread 2 thread 3 + epoll_wait() return + (slot->in_handler is 0) call select_on_epoll() + and epoll_ctl() on fd + epoll_wait() return + slot->in_handler++ + (slot->in_handler is 1) + slot->in_handler++ + (slot->in_handler is 2) + call handler() call handler() + + Fix this issue by skip invoke of handler if there is already a handler + inprogress. + + Change-Id: I437126ac772debcadb00993a948919c931cd607b + updates: bz#1467614 + Signed-off-by: Zhang Huan + +commit 72922c1fd69191b220f79905a23395c3a87f86ce +Author: Krutika Dhananjay +Date: Thu Jan 24 14:14:39 2019 +0530 + + features/shard: Ref shard inode while adding to fsync list + + PROBLEM: + + Lot of the earlier changes in the management of shards in lru, fsync + lists assumed that if a given shard exists in fsync list, it must be + part of lru list as well. This was found to be not true. + + Consider this - a file is FALLOCATE'd to a size which would make the + number of participant shards to be greater than the lru list size. + In this case, some of the resolved shards that are to participate in + this fop will be evicted from lru list to give way to the rest of the + shards. And once FALLOCATE completes, these shards are added to fsync + list but without a ref. After the fop completes, these shard inodes + are unref'd and destroyed while their inode ctxs are still part of + fsync list. Now when an FSYNC is called on the base file and the + fsync-list traversed, the client crashes due to illegal memory access. + + FIX: + + Hold a ref on the shard inode when adding to fsync list as well. + And unref under following conditions: + 1. when the shard is evicted from lru list + 2. when the base file is fsync'd + 3. when the shards are deleted. + + Change-Id: Iab460667d091b8388322f59b6cb27ce69299b1b2 + fixes: bz#1669077 + Signed-off-by: Krutika Dhananjay + +commit 99b3ab0cf3d3389a2ff89c29cfff906cd36693a3 +Author: Amar Tumballi +Date: Fri Jan 11 11:57:07 2019 +0530 + + tests: run nfs tests only if --enable-gnfs is provided + + Fixes: bz#1665358 + Change-Id: Idbf88ec3ac683733b32c313377eeb72f2819bf0d + Signed-off-by: Amar Tumballi + +commit 06061aaa447f03e2522483d02525619ebc9854db +Author: Ravishankar N +Date: Thu Jan 24 12:14:11 2019 +0530 + + afr/self-heal:Fix wrong type checking + + gf_dirent struct has d_type variable which should check + with DT_DIR istead of IA_IFDIR or IA_IFDIR has to compare + with entry->d_stat.ia_type + + Change-Id: Idf1059ce2a590734bc5b6adaad73604d9a708804 + updates: bz#1653359 + Signed-off-by: Mohammed Rafi KC + +commit 04f84756e1baa5eff4560339700f82970eaa5d80 +Author: Mohit Agrawal +Date: Tue Jan 22 12:57:50 2019 +0530 + + core: heketi-cli is throwing error "target is busy" + + Problem: At the time of deleting block hosting volume + through heketi-cli , it is throwing an error "target is busy". + cli is throwing an error because brick is not detached successfully + and brick is not detached due to race condition to cleanp xprt + associated with detached brick + + Solution: To avoid xprt specifc race condition introduce an atomic flag + on rpc_transport + + Change-Id: Id4ff1fe8375a63be71fb3343f455190a1b8bb6d4 + fixes: bz#1668190 + Signed-off-by: Mohit Agrawal + +commit 9de432847cd699457623de84f76f7598aecd61e3 +Author: Amar Tumballi +Date: Tue Jan 22 13:30:34 2019 +0530 + + tests/bug-brick-mux-restart: add extra information + + so that we can understand more about process memory and thread consumptions + With this, we will also be able to understand more about the process details + with brick-mux. + + updates: bz#1193929 + Change-Id: I147a3e3814fc37dfb635217d0a0f0184fae0994f + Signed-off-by: Amar Tumballi + +commit 990d6a99d41111ea18481db55566a96c2fc4dad4 +Author: Amar Tumballi +Date: Wed Jan 16 20:24:06 2019 +0530 + + core: move logs which are only developer relevant to DEBUG level + + We had only changed the log level to DEBUG in release branch earlier. + But considering 90%+ of our deployments happen in same env, we can look + at these specific logs on need basis. With this change, the master + branch will be easier to debug with lesser logs. + + Change-Id: I4157a7ec7d5ec9c2948b2bbc1e4cb8317f28d6b8 + Updates: bz#1666833 + Signed-off-by: Amar Tumballi + +commit cf12a446f86169d0954e68dad36a7763cb178a0e +Author: Mohammed Rafi KC +Date: Mon Jan 21 17:01:33 2019 +0530 + + performance/readdir-ahead: Fix deadlock in readdir ahead. + + This patch fixes a lock contention in reaadir-ahead xlator. + + There are two issues, one is the processing of "." ".." + entry while holding an fd_ctx lock. The other one is destroying + the stack inside a fd_ctx lock. + + Change-Id: Id0bf83a3d9fea6b40015b8d167525c59c6cfa25e + updates: bz#1659708 + Signed-off-by: Mohammed Rafi KC + +commit d193ed84ae2886d89b899e02e9642e61bdab462a +Author: Shwetha K Acharya +Date: Mon Dec 31 10:55:21 2018 +0530 + + tools/glusterfind: option to display only files/directories + + Updated full find to filter for files and directories. + --full --type f lists only the files, + --full --type d lists only the directories, + --full (by default) lists both files and directories. + + fixes: #579 + Change-Id: If2c91a21a131667d5de34635c1846013e8fa20b7 + Signed-off-by: Shwetha K Acharya + +commit 86d4eac6c6f2d774a579ef134f6526f75504c46e +Author: Mohit Agrawal +Date: Tue Jan 22 18:01:40 2019 +0530 + + posix: Change data type to dump nr_files to statedump + + Problem: In commit 2261e444a47ffffb5d64305efceee1d5a734cd75 + wrong data type of nr_files was changed to dump + nr_files to statedump so build is failing on 32bit + environment + + Solution: Change data type to avoid errors + + Change-Id: Ifb4b19feda6e0e56d110b23351e7a0efd5bfa29b + fixes: bz#1657607 + Signed-off-by: Mohit Agrawal + +commit 832f60d41d9a392e77e5b81e7a44a97003b7541f +Author: Poornima G +Date: Tue Jan 22 16:07:52 2019 +0530 + + rpc: Fix double free + + The value rsp.xdata.xdata_val was being freed twice. It was assigned + to dict->extra_stdfree, dict_destroy would free it and also there was + an explicit free. Getting rid of explicit free in this patch. + + Change-Id: Ia9c73454bec3970b33f154fa754398bf3b045645 + fixes: bz#1668268 + Signed-off-by: Poornima G + +commit b6c417785e54620331ae35d6971fe8bef98b4619 +Author: Milind Changire +Date: Tue Jan 22 12:10:59 2019 +0530 + + rpc: use address-family option from vol file + + This patch helps enable IPv6 connections in the cluster. + The default address-family is IPv4 without using this option explicitly. + + When address-family is set to "inet6" in the /etc/glusterfs/glusterd.vol + file, the mount command-line also needs to have + -o xlator-option="transport.address-family=inet6" added to it. + + This option also gets added to the brick command-line. + Snapshot and gfapi use-cases should also use this option to pass in the + inet6 address-family. + + Change-Id: I97db91021af27bacb6d7578e33ea4817f66d7270 + fixes: bz#1635863 + Signed-off-by: Milind Changire + +commit 67bc3775685198b9ab10c1f2a0d957b157bb4acd +Author: Iraj Jamali +Date: Fri Nov 30 17:23:57 2018 +0530 + + afr: not resolve splitbrains when copies are of same size + + Automatic Splitbrain with size as policy must + not resolve splitbrains when the copies are of same size. + Determining if the sizes of copies are same and + returning -1 in that case. + + updates: bz#1655052 + + Change-Id: I3d8e8b4d7962b070ed16c3ee02a1e5a926fd5eab + Signed-off-by: Iraj Jamali + +commit cd5714554627fe90ee2c77685cb410a8fb25eceb +Author: Zhang Huan +Date: Thu Jan 3 17:57:38 2019 +0800 + + socket: don't pass return value from protocol handler to event handler + + Event handler handles socket level error only, while protocol handler + handles in protocol level error. If protocol handler decides to + disconnect on error in any case, it should call disconnect instead of + return an error back to event handler. + + Change-Id: I9375be98cc52cb969085333f3c7229a91207d1bd + updates: bz#1666143 + Signed-off-by: Zhang Huan + +commit 4d9935a4db67be0237db5fc6a2b51086635571f6 +Author: Zhang Huan +Date: Sat Dec 29 16:26:58 2018 +0800 + + socket: fix issue when socket read return with EAGAIN + + In the case socket read returns EAGAIN, positive value about remaining + vector to send is returned. This return value will be passed all the way + back to event handler, making it complains. + + [2018-12-29 08:02:25.603199] T [socket.c:1640:__socket_read_simple_payload] 0-test-client-0-extra.0: partial read on non-blocking socket. + [2018-12-29 08:02:25.603201] T [rpc-clnt.c:654:rpc_clnt_reply_init] 0-test-client-2-extra.1: received rpc message (RPC XID: 0xfa6 Program: GlusterFS 4.x v1, ProgVers: 400, Proc: 12) from rpc-transport (test-client-2-extra.1) + [2018-12-29 08:02:25.603207] T [socket.c:3129:socket_event_handler] 0-test-client-0-extra.0: (sock:32) socket_event_poll_in returned 1 + + Formerly, in socket_proto_state_machine, return value of socket_readv is + used to check if message is all read-in. In this commit, it is checked + whether size of bytes indicated in header are all read in. In this way, + only 0 and -1 will be returned from socket_proto_state_machine(), + indicating whether there is error in the underlying socket. + + Change-Id: I8be0d178b049f0720d738a03aec41c4b375d2972 + updates: bz#1666143 + Signed-off-by: Zhang Huan + +commit 3c556353cd1dde0593096c9e9e11b877403971f0 +Author: Susant Palai +Date: Fri Jan 18 17:26:36 2019 +0530 + + locks/fencing: Add a security knob for fencing + + There is a low level security issue with fencing since one client + can preempt another client's lock. + + This patch does not completely eliminate the issue of a client + misbehaving, but certainly it adds a security layer for default use cases + that does not need fencing. + + Change-Id: I55cd15f2ed1ae0f2556e3d27a2ef4bc10fdada1c + updates: #466 + Signed-off-by: Susant Palai + +commit 4f58d35f064e5fba3a02b7be8b2525ebe2114254 +Author: N Balachandran +Date: Mon Jan 21 15:15:51 2019 +0530 + + cluster/dht: Delete invalid linkto files in rmdir + + rm -rf fails on dirs which contain linkto files + that point to themselves because dht incorrectly thought + that they were cached files after looking them up. + The fix now treats them as invalid linkto files + and deletes them. + + Change-Id: I376c72a5309714ee339c74485e02cfb4e29be643 + fixes: bz#1667804 + Signed-off-by: N Balachandran + +commit 4deeab02e3d15bd266f24d0f7b28f0e5401fa950 +Author: Mohit Agrawal +Date: Mon Jan 21 17:53:12 2019 +0530 + + glusterd: Avoid dict_leak in __glusterd_handle_cli_uuid_get function + + Change-Id: Iefe08b136044495f6fa2b092c9e8c833efee1400 + fixes: bz#1667905 + Signed-off-by: Mohit Agrawal + +commit 2a8a66d58ad7ad28d32de42bd3423d7aa3917e3b +Author: Xiubo Li +Date: Sun Jan 13 17:30:11 2019 +0800 + + common-utils: make vector a const parameter + + To avoid the warning and preparing for adding writesame support. + + Updates: #617 + Change-Id: I0710b1e4c240368a9bf52968bddc6e250ae2028d + Signed-off-by: Xiubo Li + +commit 5903111ad21cb937258c0fda24ea7dec466347b4 +Author: Mohit Agrawal +Date: Mon Jan 21 09:12:30 2019 +0530 + + glusterd: Resolve memory leak in get-state command + + In gluster get-state volumeoptions command there was some amount of leak + observed. This fix resolves the identified leaks. + + Change-Id: Ibde5743d1136fa72c531d48bb1b0b5da0c0b82a1 + fixes: bz#1667779 + Signed-off-by: Mohit Agrawal + +commit 11aaecccad03d5803dc7be63c3e36af75da8126d +Author: Iraj Jamali +Date: Mon Jan 7 15:19:18 2019 +0530 + + posix: fix coverity issue + + Logically dead code + + CID: 1398468 + Updates: bz#789278 + + Change-Id: I8713a0c51777eb64e617d00ab72fd1db4994b6ab + Signed-off-by: Iraj Jamali + +commit cd16967a77d04a8d0c5d5c3ab5346ccdd1df89cb +Author: Sheetal Pamecha +Date: Fri Nov 30 19:49:59 2018 +0530 + + afr: Splitbrain with size as policy must not resolve for directory + + In automatic Splitbrain resolution when favorite child policy + is set as size, split brain resolution must not work for + directories. + + Currently, if a directory is in split brain with both copies + having same size, the source is selected arbitrarily + and healed. + + fixes: bz#1655050 + Change-Id: I5739498639c17c89874cc577362e543adab55f5d + Signed-off-by: Sheetal Pamecha + +commit 55b40dfbb2551b1507d532a03bdf199acb37bf6a +Author: Rinku Kothiya +Date: Mon Jan 14 13:24:20 2019 +0000 + + cli: Added a welcome and help message + + When gluster command is fired without any arguments it just shows the + prompt, so added a welcome message and info to get help. + + fixes: bz#1535528 + + Change-Id: I627b66b67443716e9270025c1e47b98b6facba13 + Signed-off-by: Rinku Kothiya + +commit c5bb929b367121f2610f74630882254da7fd882a +Author: Kinglong Mee +Date: Fri Jan 18 10:38:14 2019 +0800 + + quotad: fix wrong memory free + + 1. cli_req.dict.dict_val, + It must be freed no metter operation error or success. + Fix it as lookup "alloca" memory before decode. + + 2. args.xdata.xdata_val, + It is allocated by "alloca", free is unneeded. + + 3. qd_nameless_lookup, + It olny needs gfid, a gfs3_lookup_req argument is unneeded. + + Change-Id: I746dddf7f3d1465b1885af2644afe0bcf0a5665b + fixes: bz#1656682 + Signed-off-by: Kinglong Mee + +commit 0687b0beb5cc58d5aac9e203f0feebcd7e9eea03 +Author: Rinku Kothiya +Date: Tue Jan 1 21:06:05 2019 +0530 + + core: Feature added to accept CidrIp in auth.allow + + Added functionality to gluster volume set auth.allow command to + accept CIDR IP addresses. Modified few functions to isolate cidr + feature so that it prevents other gluster commands such as peer + probe to use cidr format ip. The functions are modified in such + a way that they have an option to enable accepting of cidr + format for other gluster commands if required in furture. + + updates: bz#1138841 + + Change-Id: Ie6734002a7078f1820e5df42d404411cce945e8b + Credits: Mohit Agrawal + Signed-off-by: Rinku Kothiya + +commit ebaf09a2a329517936232510e117debc3795e80b +Author: Susant Palai +Date: Fri Nov 30 15:04:17 2018 +0530 + + lock: Add fencing support + + design reference: https://review.gluster.org/#/c/glusterfs-specs/+/21925/ + + This patch adds the lock preempt support. + + Note: The current model stores lock enforcement information as separate + xattr on disk. There is another effort going in parallel to store this + in stat(x) of the file. This patch is self sufficient to add fencing + support. Based on the availability of the stat(x) support either I will + rebase this patch or we can modify the necessary bits post merging this + patch. + + Change-Id: If4a42f3e0afaee1f66cdb0360ad4e0c005b5b017 + updates: #466 + Signed-off-by: Susant Palai + +commit 11cf73bc4173c13a9de54ea8d816eb72d8b01f48 +Author: Sunny Kumar +Date: Mon Jan 14 11:48:55 2019 +0530 + + geo-rep : fix rename sync on hybrid crawl + + Problem: When geo-rep is configured as hybrid crawl + directory renames are not synced to the slave. + + Solution: Rename sync of directory was failing due to incorrect + destination path calculation. + During check for existence on slave we miscalculated + realpath. . + + Change-Id: I23f1ea60e86a917598fe869d5d24f8da654d8a0a + fixes: bz#1665826 + Signed-off-by: Sunny Kumar + +commit 0301a66bda44582e3a48519f2a5d365b0c38090d +Author: Zhang Huan +Date: Sat Dec 29 15:51:13 2018 +0800 + + socket: fix issue when socket write return with EAGAIN + + In the case socket write return with EAGAIN, the remaining vector count + is return all way back to event handler, making followup pollin event to + skip handling and dispatch loop complains about failure. Even thought + temporary write failure is not an error. + + [2018-12-29 07:31:41.772310] E [MSGID: 101191] [event-epoll.c:674:event_dispatch_epoll_worker] 0-epoll: Failed to dispatch handler + + Change-Id: Idf03d120b5f7619eda19720a583cbcc3e7da2504 + updates: bz#1666143 + Signed-off-by: Zhang Huan + +commit 22778ca88977fa061c468ca257aec74d4e7d09f4 +Author: Zhang Huan +Date: Thu Dec 27 14:13:48 2018 +0800 + + socket: fix counting of socket total_bytes_read and total_bytes_write + + Change-Id: If35d0dbae963facf00ab6bcf07c6e4d1706ed982 + updates: bz#1666143 + Signed-off-by: Zhang Huan + +commit 98550952bef0d84677706e75ff53a41dc8c90dec +Author: Mohit Agrawal +Date: Fri Dec 7 14:36:45 2018 +0530 + + core: Resolve memory leak for brick + + Problem: Some functions are not freeing memory allocated by + xdr_to_genric so it has become leak + + Solution: Call free to avoid leak + + Change-Id: I3524fe2831d1511d378a032f21467edae3850314 + fixes: bz#1656682 + Signed-off-by: Mohit Agrawal + +commit 213f31bf9e72eee57a6579b66e259af8e59e9c67 +Author: Arjun +Date: Tue Dec 4 11:02:37 2018 +0530 + + gfapi : making glfs_setattr/glfs_fsetattr as public + + Initially glfs_fsetattr and glfs_setattr, both functions accepted iatt as arguements + but now they accept stat and later in the function the stat is being converted to iatt + so that it can be passed to syncop_fsetattr/syncop_setattr. + + Change-Id: I41a9e0124785a32ca19ef4d492c5ed5002e66ede + updates: #389 + Signed-off-by: Arjun Sharma + +commit 2261e444a47ffffb5d64305efceee1d5a734cd75 +Author: Mohit Agrawal +Date: Mon Dec 10 11:14:04 2018 +0530 + + posix: Convert several posix_private members to gf_atomic + + Change-Id: I629698d8ddf6f15428880bdc1501d36bc37b8ebb + fixes: bz#1657607 + Signed-off-by: Mohit Agrawal + +commit f578cdad23d8a8428a7012f777f4987507f19ea4 +Author: Mohit Agrawal +Date: Sat Jan 12 11:17:23 2019 +0530 + + core: glusterd/add-brick-and-validate-replicated-volume-options.t is crash + + Problem: Sometime brick is getting crash at the time of handling + pmap signin request + + Solution: glusterfs_mgmt_pamp_signin is using same frame to send + pmap signin request so to avoid crash send signin request + on separate frame + + Change-Id: I443f854171ec4372e8d5f84bdc576c468e92c493 + fixes: bz#1665656 + Signed-off-by: Mohit Agrawal + +commit 211521f039bb5c883ef444577b5962bad9e18be1 +Author: Mohit Agrawal +Date: Fri Nov 30 16:07:39 2018 +0530 + + core: Resolve dict_leak at the time of destroying graph + + Problem: In gluster code some of the places it call's get_new_dict + to create a dictionary without taking reference so at the time + of dict_unref it has become a leak + + Solution: To resolve the same call dict_new instead of get_new_dict + + updates bz#1650403 + Change-Id: I3ccbbf5af07079a4fa09aad2cd0458c8625b2f06 + Signed-off-by: Mohit Agrawal + +commit 8216ed2171789c8b6c6dc1e44cc171c89b1c063d +Author: Xiubo Li +Date: Fri Jan 4 15:22:24 2019 +0800 + + cluster/afr: fix zerofill transaction.start + + This maybe one mistake when coding. + + Fixes: bz#1665332 + Change-Id: Ia8f8dadf4a71579240ff9950b141ca528bd342b3 + Signed-off-by: Xiubo Li + +commit 741f652769bc074fe85da1485e0e16df6e6766f1 +Author: Sanju Rakonde +Date: Thu Jan 10 16:17:39 2019 +0530 + + glusterd: fix crash + + Problem: running "gluster get-state glusterd odir /get-state" + resulted in glusterd crash. + + Cause: In the above command output directory has been specified + without "/" at the end. If "/" is not given at the end, "/" will + be added to path using "strcat", so the added character "/" is + not having memory allocated. When tried to free, glusterd will + crash as"/" has no memory allocated. + + Solution: Instead of concatenating "/" to output directory, add + it to output filename. + + Change-Id: I5dc00a71e46fbef4d07fe99ae23b36fb60dec1c2 + fixes: bz#1665038 + Signed-off-by: Sanju Rakonde + +commit ed2d1ad8266b09e4a71ffd193be3cf85467f4f06 +Author: Vijay Bellur +Date: Thu Jan 10 23:00:49 2019 -0800 + + features/index: Correct incorrect definition in header + + s/QUIESCE/INDEX/ + + fixes: bz#1665363 + + Change-Id: I6dc4fde682cedeaa10d870267b8909af1a9449c0 + Signed-off-by: Vijay Bellur + +commit 01779e6c6c2c876a9e137d51ee1ce6a8062ea893 +Author: Iraj Jamali +Date: Mon Dec 17 11:23:59 2018 +0530 + + fix 32-bit-build-smoke warnings + + fixes: bz#1622665 + + Change-Id: I777d67b1b62c284c62a02277238ad7538eef001e + Signed-off-by: Iraj Jamali + +commit c0c2022e7d7097e96270a74f37813eda0c4e6339 +Author: Krutika Dhananjay +Date: Fri Dec 28 18:53:15 2018 +0530 + + features/shard: Fix launch of multiple synctasks for background deletion + + PROBLEM: + + When multiple sharded files are deleted in quick succession, multiple + issues were observed: + 1. misleading logs corresponding to a sharded file where while one log + message said the shards corresponding to the file were deleted + successfully, this was followed by multiple logs suggesting the very + same operation failed. This was because of multiple synctasks + attempting to clean up shards of the same file and only one of them + succeeding (the one that gets ENTRYLK successfully), and the rest of + them logging failure. + + 2. multiple synctasks to do background deletion would be launched, one + for each deleted file but all of them could readdir entries from + .remove_me at the same time could potentially contend for ENTRYLK on + .shard for each of the entry names. This is undesirable and wasteful. + + FIX: + Background deletion will now follow a state machine. In the event that + there are multiple attempts to launch synctask for background deletion, + one for each file deleted, only the first task is launched. And if while + this task is doing the cleanup, more attempts are made to delete other + files, the state of the synctask is adjusted so that it restarts the + crawl even after reaching end-of-directory to pick up any files it may + have missed in the previous iteration. + + This patch also fixes uninitialized lk-owner during syncop_entrylk() + which was leading to multiple background deletion synctasks entering + the critical section at the same time and leading to illegal memory access + of base inode in the second syntcask after it was destroyed post shard deletion + by the first synctask. + + Change-Id: Ib33773d27fb4be463c7a8a5a6a4b63689705324e + updates: bz#1662368 + Signed-off-by: Krutika Dhananjay + +commit 18bbb0f5b5bf6c96f764b7949df8a0a136b931ce +Author: Amar Tumballi +Date: Fri Dec 28 17:45:58 2018 +0530 + + configure: fix the duplicate CFLAGS options + + updates: bz#1193929 + Change-Id: I403878719a3f81fb2ea951a951f84880fb54f3cc + Signed-off-by: Amar Tumballi + +commit 5a152a7a70f771d951af713ab9701bcbc651e7e2 +Author: Varsha Rao +Date: Wed Jan 9 15:10:37 2019 +0530 + + libglusterfs/common-utils.c: Fix buffer size for checksum computation + + Problem: When quorum count option is updated, the change is not reflected in + the nfs-server.vol file. This is because in get_checksum_for_file(), when the + last part of the file read has size less than buffer size, the read buffer + stores old data value along with correct data value. + + Solution: Pass the bytes read instead of fixed buffer size, for calculating + checksum. + + Change-Id: I4b641607c8a262961b3f3da0028a54e08c3f8589 + fixes: bz#1657744 + Signed-off-by: Varsha Rao + +commit 8c1eda9b5a19861be7e02f89cefae942c624d677 +Author: Kinglong Mee +Date: Wed Jan 9 14:09:03 2019 +0800 + + doc: fix wrong description of localtime-logging in manpages + + -L is the short option of --log-level, not --localtime-logging, + and also, --localtime-logging does not contain an argument. + + Change-Id: I7e1163cb88b84ab5faecd0a65a1f7257e731d2a7 + updates: bz#1664551 + Signed-off-by: Kinglong Mee + +commit aa85b54c6fa329f05ec24c1e98c59b2f993bf32b +Author: Vijay Bellur +Date: Tue Nov 27 11:47:12 2018 +0530 + + extras/systemd: Remove socket activated syslog.target and add documentation keys + + Adopting patch provided by Patrick Matthäi at: + + https://bugzilla.redhat.com/attachment.cgi?id=1470751 + + fixes: bz#1560561 + Change-Id: I363a049c743c65823e6c4f153cbe20b47fcb64fb + Signed-off-by: Vijay Bellur + +commit 1e28c54c5ec8d84ec8a22493161314010992918e +Author: Mohit Agrawal +Date: Wed Jan 2 16:25:35 2019 +0530 + + core: brick process is crashed at the time of spawn thread + + Problem: brick is getting crashed at the time of calling + pthread_detach after just call gf_thread_create.If + sufficient resources are not available on the system + pthread_create returns EAGAIN (non-negative) but the + caller function expects negative error code in case of failure + + Solution: Change the condition in caller function to avoid the crash + + Change-Id: Ifeaa49f809957eb6c33aa9792f5af1b55566756d + fixes: bz#1662906 + +commit fa7ae128706062afefcb0a3117527b8bef21f396 +Author: Vijay Bellur +Date: Thu Jan 10 11:08:49 2019 -0800 + + performance/md-cache: Fix a crash when statfs caching is enabled + + mem_put() in STACK_UNWIND_STRICT causes a crash if frame->local is not null + as md-cache obtains local from CALLOC. + + Changed two occurrences of STACK_UNWIND_STRICT to MDC_STACK_UNWIND as + the latter macro does not rely on STACK_UNWIND_STRICT for cleaning up + frame->local. + + fixes: bz#1632503 + Change-Id: I1b3edcb9372a164ef73119e99a49e747765d7166 + Signed-off-by: Vijay Bellur + +commit 99ac5a83805e46659124acfefbc05c9b6dda1a1b +Author: Amar Tumballi +Date: Thu Jan 10 17:12:53 2019 +0530 + + tests: increase the timeout for distribute bug 1117851.t + + The test is in borderline of 200seconds, and many a times, randomly + takes little more time, and fails the whole regression. Better to keep + timeout high, so we don't 'randomly' fail regression tests. + + updates: bz#1193929 + Change-Id: Ib0d3a9f7a75ee44446ec6da5e0510cccf83eecaa + Signed-off-by: Amar Tumballi + +commit 77669043e290cb6a4c82dded96286370cf5c7db0 +Author: Sunny Kumar +Date: Tue Jan 8 16:35:35 2019 +0530 + + afr : fix memory leak + + This patch fixes memory leak reported by ASan. + + The fix was first merged by + https://review.gluster.org/#/c/glusterfs/+/21805. + + But later change was reverted due to this patch + https://review.gluster.org/#/c/glusterfs/+/21178/. + + updates: bz#1633930 + + Change-Id: I1febe121e0be33a637397a0b54d6b78391692b0d + Signed-off-by: Sunny Kumar + +commit f091c5570efd5c754c40d40336bad8183a3e16e0 +Author: Sunil Kumar Acharya +Date: Thu Dec 27 19:18:35 2018 +0530 + + cluster/afr: Disable client side heals in AFR by default. + + With this changeset, default value for the AFR client side + heal volume option is set to "off" + + fixes: bz#1663102 + Change-Id: Ie4016932339c4896487e3e7cb5caca68739b7ba2 + Signed-off-by: Sunil Kumar Acharya + +commit d1231f00dc176bb9f4583b0a69b81f7e16a74eb5 +Author: Susant Palai +Date: Wed Jan 9 16:57:21 2019 +0530 + + dht: Add NULL check for stbuf in dht_rmdir_lookup_cbk + + Change-Id: I2ced288113a369cc6497a77ac1871007df434da4 + fixes: bz#1664647 + Signed-off-by: Susant Palai + +commit c45050fcdf749706dcaa74c86f43493cdbf254d4 +Author: Krutika Dhananjay +Date: Fri Dec 21 20:51:03 2018 +0530 + + features/locks: Dump connection_id even for posix locks + + ... in statedump for a better debugging experience. + + BEFORE: + + posixlk.posixlk[0](ACTIVE)=type=WRITE, whence=0, start=0, len=0, + pid = 13635, owner=2dd2c3a11706dc8c, client=0x7f159012b000, + connection-id=(null), granted at 2018-12-31 14:20:42 + + connection-id is null above. + + AFTER: + + posixlk.posixlk[0](ACTIVE)=type=WRITE, whence=0, start=0, len=0, + pid = 10977, owner=b485e33df21bdaa2, client=0x7fa24c01ab90, + connection-id=CTX_ID:68e12340-eed2-4386-bf5e-1f43cf8693d9-GRAPH_ID:0- + PID:10901-HOST:dhcp35-215.lab.eng.blr.redhat.com-PC_NAME:patchy-client-0- + RECON_NO:-0, granted at 2018-12-31 14:33:50 + + Change-Id: I4608994bacabb558a3be8c1634ee6b1d2d3022e2 + fixes: bz#1662679 + Signed-off-by: Krutika Dhananjay + +commit d54f5cdfbca7af2da2139fb76af1f1e416a6d848 +Author: Amar Tumballi +Date: Wed Jan 2 18:20:07 2019 +0530 + + timer-wheel: run the timer function outside of locked region + + Surprizingly this also reduced 80% CPU overhead 'perf record' tool reported + in posix_spin_lock in a brick-mux test volume initialization process. + + updates: bz#1193929 + Change-Id: I4e1df60d6fd094105c312df39f1527d3f07bed68 + Signed-off-by: Amar Tumballi + +commit aa28fe32364e39981981d18c784e7f396d56153f +Author: Krutika Dhananjay +Date: Fri Dec 28 07:27:11 2018 +0530 + + features/shard: Assign fop id during background deletion to prevent excessive logging + + ... of the kind + + "[2018-12-26 05:22:44.195019] E [MSGID: 133010] + [shard.c:2253:shard_common_lookup_shards_cbk] 0-volume1-shard: Lookup + on shard 785 failed. Base file gfid = cd938e64-bf06-476f-a5d4-d580a0d37416 + [No such file or directory]" + + shard_common_lookup_shards_cbk() has a specific check to ignore ENOENT error without + logging them during specific fops. But because background deletion is done in a new + frame (with local->fop being GF_FOP_NULL), the ENOENT check is skipped and the + absence of shards gets logged everytime. + + To fix this, local->fop is initialized to GF_FOP_UNLINK during background deletion. + + Change-Id: I0ca8d3b3bfbcd354b4a555eee520eb0479bcda35 + updates: bz#1662368 + Signed-off-by: Krutika Dhananjay + +commit 37653efdc7681d1b0f255054ec2f9c9ddd4c8b14 +Author: Amar Tumballi +Date: Fri Jan 4 07:04:50 2019 +0000 + + Revert "iobuf: Get rid of pre allocated iobuf_pool and use per thread mem pool" + + This reverts commit b87c397091bac6a4a6dec4e45a7671fad4a11770. + + There seems to be some performance regression with the patch and hence recommended to have it reverted. + + Updates: #325 + Change-Id: Id85d6203173a44fad6cf51d39b3e96f37afcec09 + +commit 054c7ea91603acfcb01db8455b25dda7e5e831b2 +Author: Raghavendra Bhat +Date: Mon Jan 7 13:58:01 2019 -0500 + + features/bit-rot: do not send version and signature keys in dict + + In lookup, if the file has been marked as bad, then bit-rot-stub + was sending the version and signature xattr values as well in the + response dictinary. This is not needed. Only bad file marker has + to be sent. + + Change-Id: Id59c02e9857577c60849fd28ef657f71e0b15207 + fixes: bz#1664122 + Signed-off-by: Raghavendra Bhat + +commit 86f5d75c70a5fa6f1790b17d12d56fd8b37b9ddd +Author: Vijay Bellur +Date: Fri Nov 16 23:26:35 2018 +0530 + + performance/io-threads: Improve debuggability in statedump + + statedump from io-threads lacked information to understand the number of + running threads & number of requests in each priority queue. This patch + addresses that. + + Sample statedump output w/ this patch: + + current_high_priority_threads=7 + current_normal_priority_threads=9 + current_low_priority_threads=0 + current_least_priority_threads=0 + fast_priority_queue_length=32 + normal_priority_queue_length=45 + + Also, changed the wording for least priority queue in + iot_get_pri_meaning(). + + Change-Id: Ic5f6391a15cc28884383f5185fce1cb52e0d10a5 + fixes: bz#1664124 + Signed-off-by: Vijay Bellur + +commit 1a3c2a48e7cd44f2cc8b7b5384321d289aedab8e +Author: ShyamsundarR +Date: Thu Dec 20 15:28:37 2018 -0500 + + gfapi: update returned/callback pre/post attributes to glfs_stat + + Change-Id: Ie0fe971e694101aa011d66aa496d0644669c2c5a + Updates: #389 + Signed-off-by: Kinglong Mee + Signed-off-by: ShyamsundarR + +commit c31f1c232a6673c4e3fc3188e15ae0e708a54613 +Author: ShyamsundarR +Date: Wed Nov 21 09:43:23 2018 -0500 + + gfapi: new api glfs_statx as linux's statx + + Change-Id: I44dd6ceef0954ae7fc13f920e84d81bbd3f6a774 + Updates: #389 + Signed-off-by: Kinglong Mee + Signed-off-by: ShyamsundarR + +commit f99f51ca87fd8703947df985901cbce37bc6c818 +Author: Kinglong Mee +Date: Thu Jan 3 17:07:27 2019 +0800 + + glfs-fops.c: fix the bad string length for snprintf + + Snprintf reserves one byte for the ending '\0'. + A NAME_MAX bytes d_name is truncated to NAME_MAX - 1 bytes. + + Change-Id: Ic884d18cee24360e55ddb896dc587b0b74ef97fe + updates: bz#1193929 + Signed-off-by: Kinglong Mee + +commit a9b0003c717087ff168bc143c70559162e53e0d5 +Author: Soumya Koduri +Date: Tue Dec 25 13:29:15 2018 -0500 + + leases: Reset lease_ctx->timer post deletion + + To avoid use_after_free, reset lease_ctx->timer back to NULL + after the structure has been freed. + + Change-Id: Icd213ec809b8af934afdb519c335a4680a1d6cdc + updates: bz#1648768 + Signed-off-by: Soumya Koduri + +commit 8b4822d457cd62c1525b6fbaac8668c79f3951c0 +Author: Kinglong Mee +Date: Thu Dec 20 16:58:34 2018 +0800 + + rpc-clnt: reduce transport connect log for EINPROGRESS + + quotad and ganesha.nfsd prints many logs as, + + [rpc-clnt.c:1739:rpc_clnt_submit ] 0--quota: error returned while attempting to connect to host: (null), port 0 + + Change-Id: Ic0c815400619e4a87a772a51b19822920228c1ef + Updates: bz#1596787 + Signed-off-by: Kinglong Mee + +commit 4a15ea1fd36390fa247dc2e429f14dc8fd621c49 +Author: Pranith Kumar K +Date: Wed Jan 2 18:42:19 2019 +0530 + + rpcsvc: Don't expect dictionary values to be available + + When reconfigure happens, string values from one dictionary + are directly set in another dictionary. This can lead to + invalid memory when the first dictionary is freed up. + So do dict_set_dynstr_with_alloc instead of dict_set_str + + updates bz#1650403 + Change-Id: Id53236467521cfdeb07e7178d87ba6cf88d17003 + Signed-off-by: Pranith Kumar K + +commit 95ec7391d8db26b933e542694add2b419dddf89f +Author: Sanju Rakonde +Date: Fri Jan 4 15:49:53 2019 +0530 + + glusterd: rebalance status should display information of localhost + + Problem: + https://review.gluster.org/#/c/glusterfs/+/21762/ has migrated + rebalance commands from op-sm framework to mgmt v3 framework. + + In a heterogenous cluster, if rebalance commands follow op-sm + framework, localhost information is not displayed in the + output of "gluster v rebalance status". + + Cause: + Previously without https://review.gluster.org/#/c/glusterfs/+/21762/ + rebalance commands were following op-sm framework. + In glusterd_volume_rebalance_use_rsp_dict() current_index variable + keeps track of number/count of peers in trusted storage pool. + In op-sm, glusterd_volume_rebalance_use_rsp_dict() will be called + only for the peers. So the current index should start from 2 + assuming local host as node 1. + + With the above patch, rebalance commands are following mgmt v3 + framework. In mgmt v3, glusterd_volume_rebalance_use_rsp_dict() + is called for all nodes. For localhost it is called from + brick-op function and for peers it is called from brick-op + call back function. So the current index value should start + from 1. + + https://review.gluster.org/#/c/glusterfs/+/21762/ has changed the + value of current index to 1. Because of this, In heterogenous cluster, + local host's information is overwritten by one of the peers information. + And rebalance status will not display localhost's information in + the output. + + Solution: assign a value to current index based on a op-version + check. + + Change-Id: I2dfba1f007e908cf160acc4a4a5d8ef672572e4d + fixes: bz#1663243 + Signed-off-by: Sanju Rakonde + +commit f6d0141b47ac36f6d2b100252241ed64bc92f913 +Author: Anoop C S +Date: Thu Jan 3 10:52:22 2019 +0530 + + extras: Add readdir-ahead to samba group command + + Change-Id: I310f014a9ab8416d9833f5711ff902da1457f415 + updates: bz#1193929 + Signed-off-by: Anoop C S + +commit 0d4535c8db7b4be3fcee685d12f6974f7af89810 +Author: Sanju Rakonde +Date: Thu Jan 3 19:09:36 2019 +0530 + + glusterd: aggregate rsp from peers for profile command + + When we run profile info command, it should display statistics + of all the bricks of the volume. To display information of bricks + which are hosted on peers, we need to aggregate the response from + peers. + + For profile info command, all the statistics will be added into + the dictionary in brick-op phase. To aggregate the information from + peers, we need to call glusterd_syncop_aggr_rsp_dict() in brick-op + call back function. + + fixes: bz#1663223 + + Change-Id: I5f5890c3d01974747f829128ab74be6071f4aa30 + Signed-off-by: Sanju Rakonde + +commit 44f3382328b3bd12d3bbcdbfc408660eecf4befc +Author: Zhang Huan +Date: Fri Dec 28 16:08:50 2018 +0800 + + glusterd: fix memory leak in handshake + + Add missing unref to req_dict to fix memory leak in handle of + handshake. + + Change-Id: I0d8573fc3668c1a0ccc9030e3a096bbe20ed5c36 + fixes: bz#1663077 + Signed-off-by: Zhang Huan + +commit d4fa2906b8e8a6de34c8e7b33b998fbc63f54cb1 +Author: Sanju Rakonde +Date: Wed Jan 2 12:29:53 2019 +0530 + + glusterd: kill the process without releasing the cleanup mutex lock + + Problem: + glusterd acquires a cleanup mutex lock before it starts + cleanup process, so that any other thread which tries to acquire + lock on any resource will be blocked on cleanup mutex lock. + + We don't want any thread to try to acquire any resource, once + the cleanup is started. because other threads might try to acquire + lock on resources which are already freed by the thread which is + going though the cleanup phase. + + previously we were releasing the cleanup mutex lock before the + process exit. As we are releasing the cleanup mutex lock, before + the process can exit some other thread which is blocked on + cleanup mutex lock is acquiring the cleanup mutex lock and + trying to acquire some resources which are already freed as a + part of cleanup. This is leading glusterd to crash. + + Solution: We should exit the process without releasing the + cleanup mutex lock. + + Change-Id: Ibae1c62260f141019017f7a547519a5d38dc2bb6 + fixes: bz#1654270 + Signed-off-by: Sanju Rakonde + +commit d9a8ccd354df6db94477bf9ecb09735194523665 +Author: Soumya Koduri +Date: Wed Dec 26 15:24:49 2018 +0530 + + gfapi: nit cleanup related to releasing fs->mutex lock + + This is follow-up patch to the comment received for + - https://review.gluster.org/#/c/glusterfs/+/21882 + + We need not hold the fs->mutex lock to log error message. + + Change-Id: I29d2ea2e6cfecc3dd94982bd48f4bc9f11cc3aac + fixes: bz#1660577 + Signed-off-by: Soumya Koduri + +commit 1ea203d6b6960621c6b445db42d6254c726df321 +Author: Sunny Kumar +Date: Fri Dec 28 13:04:36 2018 +0530 + + libgfapi : fix coverity issue + + This patch fixes coverity issue in api/src/glfs-fops.c. + + CID: 1389247, 1389296, 1389369, 1389392. + All coverity defects are of type Mixing enum types (MIXED_ENUMS). + + updates: bz#789278 + + Change-Id: I007bb317ed5f0b8ddaf94a93b3a4d02b1e74cb8d + Signed-off-by: Sunny Kumar + +commit 7a84e705ed0b96f479a0fc52fa734e0367bb2af2 +Author: Harpreet Kaur +Date: Thu Dec 27 20:20:56 2018 +0530 + + posix: buffer_size_warning coverity fix + + Defect: CID 1398469- Calling strncpy with a maximum size argument + of 4096 bytes on destination array key of size 4096 bytes might + leave the destination string unterminated. + + Fix: Using snprintf instead of strncpy. + + updates: bz#789278 + + Change-Id: I4fdcd0cbf3af8b2ded94603d92d1ceb4112284c4 + Signed-off-by: Harpreet Kaur + +commit 63088d8225df025e03a0ea0a0d8fdc3e8e9b9b08 +Author: Amar Tumballi +Date: Fri Dec 28 09:56:20 2018 +0530 + + multiple-files: clang-scan fixes + + updates: bz#1622665 + Change-Id: I9f3a75ed9be3d90f37843a140563c356830ef945 + Signed-off-by: Amar Tumballi + +commit 3ce7b5dbf069e7bf09c3470753c21efe03339291 +Author: Yaniv Kaul +Date: Thu Nov 15 22:05:32 2018 +0200 + + libglusterfs/src/mem-types.h: remove unused common enums from mem-types.h + + They were not used at all, just taking space. + I've also marked all those that are not common really, but used + in just one place - they probably should move there (in follow-up + patches) + + As a test, I've removed from the stripe xlator unused private + enums and moved one that was in the common list, but only + used in the stripe code, to be a private enum. + + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + Change-Id: I1158dc1d259f1fd3f69904336c46c9d83cea799f + +commit 36883e160e07466929c2fe7d6050403751d25a49 +Author: Amar Tumballi +Date: Fri Sep 28 23:20:28 2018 +0530 + + configure: add a message about asan option + + This added hint helps to get ASan logs for the daemon processes, with + this one can start using asan for regression tests. + + updates: bz#1633930 + Change-Id: I3b39892d45d29ae514dad8ab10f65703c02003f1 + Signed-off-by: Amar Tumballi + +commit a12bdfa72af9cc8df21d25b580058b49f3aa154a +Author: Sheetal Pamecha +Date: Thu Dec 13 17:59:20 2018 +0530 + + glusterd: NULL pointer dereferencing clang fix + + Added ternary operator to avoid this issue + + Updates: bz#1622665 + + Change-Id: I163d0628304a0d61249d1d97a4a3d3bee4ba4927 + Signed-off-by: Sheetal Pamecha + +commit cd29723ab1a572fd9c2ceb3414b11d654cb9a08a +Author: Sheetal Pamecha +Date: Fri Dec 21 03:59:16 2018 +0530 + + mgmt/glusterd: fix clang warning + + Attempt to free rsp.dict.dict_val twice + + Change-Id: I5dbc50430f59ca8d0c739b0fbe95d71981852889 + Updates: bz#1622665 + Signed-off-by: Sheetal Pamecha + +commit a12cadc1377ef51ad52defd1da91bf8f599e5786 +Author: Pranith Kumar K +Date: Tue Dec 18 14:38:22 2018 +0530 + + cluster/afr: Refactor internal locking code to allow multiple inodelks + + For implementing copy_file_range fop, AFR needs to perform two inodelks in the + same transaction. This patch brings in the necessary structure to make it + easier to do so. + + Entry-locks in AFR were already taking multiple entry-locks on different inodes + with the respective basenames. This patch extends the logic in inodelks to use + the same lockee_t structure. This lead to removal of quite a lot of duplicate + code present in afr-lk-common.c as both the locks are doing same things except + 'winding' part. + + updates: #536 + Change-Id: Ibfce7e3f260bb27b18645152ec680c33866fe0ae + Signed-off-by: Pranith Kumar K + +commit 8d38c5b7337e44ad9f282966c0aa2e99bd7da506 +Author: Sheetal Pamecha +Date: Fri Dec 28 10:44:32 2018 +0530 + + rpc/rpc-lib: fix coverity issue + + Defect: Code can never be reached because of the + condition queue_index > 1024 cannot be true. + + CID: 1398471 Logically dead code + updates: bz#789278 + + Change-Id: I367cda7e734f6d774900a58d8664cffcab69126f + Signed-off-by: Sheetal Pamecha + +commit de1fb17ac392427605ead87690f30f1a488f66a7 +Author: Sunny Kumar +Date: Fri Dec 28 08:38:24 2018 +0530 + + rpc : fix coverity in rpc/rpc-lib/src/rpcsvc.c + + This patch fixes newly introduced coverity. + + CID: 1398472: Dereference before null check. + updates: bz#789278 + + Change-Id: Ie9b13084097de8f24b138acd7608c3e15b3bba9c + Signed-off-by: Sunny Kumar + +commit 89f1ebef957813f1262603ea5ec82539edb1ecad +Author: Niels de Vos +Date: Thu Dec 27 13:21:57 2018 +0100 + + barrier: replace boolean-switch statement with if/else + + Squash some ugly warnings, and make the code a little bit simpler by + removing some unneeded goto jumps. + + On Ubuntu 16.04 the following warnings were reported by Amudhan: + + CC barrier.lo + barrier.c: In function ‘notify’: + barrier.c:499:33: warning: switch condition has boolean value [-Wswitch-bool] + switch (past) { + ^ + barrier.c: In function ‘reconfigure’: + barrier.c:565:25: warning: switch condition has boolean value [-Wswitch-bool] + switch (past) { + ^ + + Change-Id: Ifb6b75058dff8c789b729c76530a1358d391f4d1 + Updates: bz#1193929 + Reported-by: Amudhan P + Signed-off-by: Niels de Vos + +commit a6dc153e47f9025b09e8aae14ca6ba96fa20a23e +Author: Sanju Rakonde +Date: Thu Dec 27 14:54:28 2018 +0530 + + glusterd: coverity fixes + + This patch addresses coverity issues with CID 1398470 and 1398475 + + 1398470 - Missing unlock - False positive, Added a annotation to + make coverity happy + 1398475 - Unused value + + Change-Id: I1bb3df0b716690fad8fc52c393c8b2b6c41f7860 + updates: bz#789278 + Signed-off-by: Sanju Rakonde + +commit b5a8a91c1d86f30cb669ca469b83c99b2e9dafcb +Author: Ashish Pandey +Date: Tue Oct 23 18:03:45 2018 +0530 + + cluster/ta: Check number/type of locks held on ta file + + Change-Id: Iec47856ce2819e7d7d38a60279602e53ba45858d + updates: bz#1624332 + Signed-off-by: Ashish Pandey + +commit a11c5c66321dd8411373a68cc163c981c7d083df +Author: N Balachandran +Date: Wed Dec 26 11:40:26 2018 +0530 + + core: Fixed typos in nl-cache and logging-guidelines.md + + Replaced "recieve" with "receive". + + Change-Id: I58a3d3d4a0093df4743de9fae4d8ff152d4b216c + fixes: bz#1662089 + Signed-off-by: N Balachandran + +commit a3d12d340abc0fb8cfa4d2faffbd59a1e5ba5718 +Author: N Balachandran +Date: Thu Dec 6 19:25:06 2018 +0530 + + cluster/dht: refactor dht_lookup_cbk + + Rearrange the dht_lookup_cbk code to make + it easier to understand. + Corrected a message in dht_linkfile_create_lookup_cbk + + Change-Id: Id41db9ef901732f0410f1c007807362c630218ff + fixes: bz#1590385 + Signed-off-by: N Balachandran + +commit a1e7acc93a416fec6b87cc5601a9922759156771 +Author: Krutika Dhananjay +Date: Fri Dec 21 09:58:16 2018 +0530 + + socket: Remove redundant in_lock in incoming message handling + + A given epoll thread can handle only one incoming (POLLIN) request. + And until the socket is rearmed for listening, it is guaranteed that + there won't be any new incoming requests. As a result, the priv->in_lock + which guards the socket proto state machine seems redundant. + + This patch removes priv->in_lock. + + Change-Id: I26b6ddd852aba8c10385833b85ffd2e53e46cb8c + updates: bz#1467614 + Signed-off-by: Krutika Dhananjay + +commit c3d23b06ce6bda906bdfb9bc8909bf30016c9995 +Author: Sunny Kumar +Date: Thu Dec 20 02:41:17 2018 +0530 + + cli: fix memory leak + + This patch fixes memory leak in cli/src/cli.c. + + Change-Id: I4956c4180b34d4a9e3e6e60eeafba8cb2031896e + updates: bz#1633930 + Signed-off-by: Sunny Kumar + +commit d64fdf867fef36422ab84f2918f5d925597bc7d4 +Author: Harpreet Kaur +Date: Fri Dec 14 13:12:26 2018 +0530 + + posix: stack-buffer-overflow reported by asan + + This patch fixes buffer overflow in + $SRC/xlators/storage/posix/src/posix-inode-fd-ops.c + Memory access at offset 432 overflows "md5_checksum" variable. + SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.5+0xb825a) + + updates: bz#1633930 + + Change-Id: I46010a09161d02cdf0c69679a334ec1d3d49cffb + Signed-off-by: Harpreet Kaur + +commit 8fe3c6107a2b431d7cc0b8cfaeeb7941cf9590f9 +Author: Soumya Koduri +Date: Tue Dec 18 22:07:55 2018 +0530 + + gfapi: Access fs->oldvolfile under mutex lock + + In some cases (for eg., when there are multiple + RPC_CLNT_CONNECT notifications), multiple threads may fetch + volfile and try to update it in 'fs' object simultaneously. + Hence protect those variables' access under fs->mutex lock. + + Change-Id: Idaee9548560db32d83f4c04ebb1f375fee7864a9 + fixes: bz#1660577 + Signed-off-by: Soumya Koduri + +commit 233c909077fb1971e8813240a6161edc30c1e77b +Author: Sunny Kumar +Date: Fri Dec 21 23:50:00 2018 +0530 + + meta : fix coverity issue + + This patch fixes coverity issue possible null dereference. + + Change-Id: I93c0847c3d93b29a1e001ed044a63e908c670167 + updates: bz#789278 + Signed-off-by: Sunny Kumar + +commit 730ab84586b73e8677537ed90b78fabf5dde3b48 +Author: Mohit Agrawal +Date: Thu Dec 20 16:41:37 2018 +0530 + + tests: Brick is getting OOM in ./tests/bugs/core/bug-1432542-mpx-restart-crash.t + + This test "tests/bugs/core/bug-1432542-mpx-restart-crash.t" case creates 20 2x3 + volumes after enabling brick_mux.At the time of creating last volume brick is getting + OOM because brick consumption has increased from previous consumption due to these patches + https://review.gluster.org/#/c/glusterfs/+/19997/, + https://review.gluster.org/#/c/glusterfs/+/20362/ + + To avoid OOM reduce NUM_VOLS to 15 so that brick consumption has reduced + + Change-Id: Ib98b47a3db6b990ff22c7e57396d51e7fef5c7e8 + fixes: bz#1661214 + Signed-off-by: Mohit Agrawal + +commit 0c7425d431b90c9c5c087511b34150e30dbe028a +Author: Mohit Agrawal +Date: Wed Dec 19 08:14:44 2018 +0530 + + rpc: Use adaptive mutex in rpcsvc_program_register + + Adaptive mutexes are used to protect critical/shared data items that + are held for short periods.It provides a balance between spin locks + and traditional mutex.We have observed after use adaptive mutex in + rpcsvc_program_register got some improvement. + + Change-Id: I7905744b32516ac4e4ca3c83c2e8e5e306093add + fixes: bz#1660701 + +commit f2c2c906c0a81d24b14832974994604ea4569e0d +Author: Amar Tumballi +Date: Wed Dec 19 10:25:44 2018 +0530 + + all: handle string-overflow warnings of coverity + + updates: bz#789278 + Change-Id: I7de800b90a614e3666e965b0cafc70026a844b2d + Signed-off-by: Amar Tumballi + +commit e1f92176a8d372e99386c0f007d6a38c0a54ca5b +Author: Amar Tumballi +Date: Wed Dec 19 09:45:42 2018 +0530 + + all: handle USE_AFTER_FREE warnings + + * we shouldn't be using 'local' after DHT_STACK_UNWIND() as it frees + the content of local. Add a 'goto out' or similar logic to handle + the situation. + + * fix possible overlook of unref(dict), instead of unref(xdata). + + * make coverity happy by re-ordering unref in meta-defaults. + + * gfid-access: re-order dictionary allocation so we don't have to + do a extra unref. + + * other obvious errors reported. + + updates: bz#789278 + Change-Id: If05961ee946b0c4868df19861d7e4a927a2a2489 + Signed-off-by: Amar Tumballi + +commit 8cde14a537f0112400744d518ed196eb8fa232f2 +Author: Krutika Dhananjay +Date: Wed Dec 19 17:57:58 2018 +0530 + + tests: Fix zero-flag.t script + + The default value of shard-block-size was changed from 4MB + to 64MB sometime back. The script "fallocate"s a 6MB file + and expects it to have 1 shard under .shard. This worked when + the shard-block-size was 4MB. With the default value now at 64MB, + file "file1" won't have any shards under .shard and the stat on the + 1st shard's path fails with ENOENT. + + Changed the script to explicitly set shard-block-size to 4MB. + + Change-Id: I7f1785922287d16d74c95fa57cbbe12e6e66e4f7 + fixes: bz#1656264 + Signed-off-by: Krutika Dhananjay + +commit 2af8fca492f3e1152177641b5e6ab9ea59ec0acd +Author: Poornima G +Date: Thu Aug 16 16:36:08 2018 +0530 + + posix: use synctask for janitor + + With brick mux, the number of threads increases as the number of + bricks increases. As an initiative to reduce the number of + threads in brick mux scenario, replacing janitor thread to use + synctask infra. + + Now close() and closedir() handle by separate janitor + thread which is linked with glusterfs_ctx. + + Updates #475 + Change-Id: I0c4aaf728125ab7264442fde59f3d08542785f73 + Signed-off-by: Poornima G + +commit e3ec41af9a9f4d906dd7b512b3f4f91a6f338f4b +Author: Rinku Kothiya +Date: Mon Dec 17 19:55:20 2018 +0530 + + rdma: fix possible buffer overflow + + used snprintf instead of sprintf and if the source string is bigger + than destination then logged a warning message. + + clang warning: ‘%s’ directive writing up to 1024 bytes into a region + of size 108. + + updates: bz#1622665 + + Change-Id: Ia5e7c53d35d8178dd2c75708698599fe8bded5de + Signed-off-by: Rinku Kothiya + +commit 9662504d45f3e285772f5188a7edf7ae3665cc6a +Author: karthik-us +Date: Tue Dec 4 11:19:27 2018 +0530 + + cluster/afr: Allow lookup on root if it is from ADD_REPLICA_MOUNT + + Problem: When trying to convert a plain distribute volume to replica-3 + or arbiter type it is failing with ENOTCONN error as the lookup on + the root will fail as there is no quorum. + + Fix: Allow lookup on root if it is coming from the ADD_REPLICA_MOUNT + which is used while adding bricks to a volume. It will try to set the + pending xattrs for the newly added bricks to allow the heal to happen + in the right direction and avoid data loss scenarios. + + Note: This fix will solve the problem of type conversion only in the + case where the volume was mounted at least once. The conversion of + non mounted volumes will still fail since the dht selfheal tries to + set the directory layout will fail as they do that with the PID + GF_CLIENT_PID_NO_ROOT_SQUASH set in the frame->root. + + Change-Id: Ic511939981dad118cc946754341318b164954b3b + fixes: bz#1655854 + Signed-off-by: karthik-us + +commit b87c397091bac6a4a6dec4e45a7671fad4a11770 +Author: Poornima G +Date: Wed Nov 21 12:09:39 2018 +0530 + + iobuf: Get rid of pre allocated iobuf_pool and use per thread mem pool + + The current implementation of iobuf_pool has two problems: + - prealloc of 12.5MB memory, this limits the scale factor of the gluster + processes due to RAM requirements + - lock contention, as the current implementation has one global + iobuf_pool lock. Credits for debugging and addressing the same goes to + Krutika Dhananjay . Issue: #410 + + Hence changing the iobuf implementation to use per thread mem pool. + This may theoritically appear to cause perf dip as there is no preallocation. + But per thread mem pool will not have significant perf impact as the last + allocated memory is kept alive for subsequent allocs, for some time. + The worst case would be if iobufs requested are of random sizes each time. + The best case is, if we get iobuf request of the same size. From the perf + tests, this patch did not seem to cause any perf decrease. + + Note that, with this patch, the rdma performance is going to degrade + drastically. In one of the previous patchsets we had fixes to not + degrade rdma perf, but rdma is not supported and also not tested [1]. + Hence the decision was to not have code in rdma that is not tested + and not supported. + + [1] https://lists.gluster.org/pipermail/gluster-users.old/2018-July/034400.html + + Updates: #325 + Change-Id: Ic2ef3bd498f9250dea25f25ba0c01fde19584b27 + Signed-off-by: Poornima G + +commit d50f22e6ae410fdcde573b6015b97dc1573bbb7e +Author: Raghavendra Gowdappa +Date: Fri Oct 12 10:03:31 2018 +0530 + + performance/io-cache: update pages with write data + + Currently io-cache invalidate pages falling in the range of write. But + instead it can update pages with same data so that reads can make use + of the cache. + + credits: Xavi Hernandez + + Change-Id: I932bd3da97ddfd464187f3009b1013eb334f00a7 + Signed-off-by: Raghavendra Gowdappa + updates: bz#1659869 + +commit 51ff065b8b9d2117688053cddb29186e3135c4a1 +Author: Raghavendra Gowdappa +Date: Fri Dec 14 11:27:33 2018 +0530 + + performance/ob: make open-behind as a child of quick-read + + With read-after-open being set to yes by default, if open-behind sees + any reads, it'll do an open on backend (and hence flush/release + later). This means with the current order of quick-read and + open-behind, open-behind sees all reads and hence also does open + bringing down performance for small file reads. + + Since for small files, reads are absorbed by quick-read, if quick-read + is made a parent of open-behind, ob doesn't witness any reads. For + read-only workloads, this means ob doen't do any opens (even with + read-after-open yes and use-anonymous-fd no). + + Change-Id: I138a42b006d104cff43ee6f07829e39c36f6f234 + Signed-off-by: Raghavendra Gowdappa + Fixes: bz#1659327 + +commit f9859218da827eac5b2102673e7a89497228e672 +Author: Yaniv Kaul +Date: Fri Dec 14 19:18:20 2018 +0200 + + xlators/cluster/afr/src/afr-self-heal-common.c: remove a variable array. + + Added '-Wvla' and saw this - gcc doesn't like variable arrays. + There are plenty of others in the EC code, but this seems OK to remove: + there is no use for the array members (I hope - that was from reading + the code). + + Compile-tested only! + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: I350f4520e52b86c8bbcd60eea1b27ef99cd119aa + +commit f9220c89ae848c72df8232163d5a990283f15f5a +Author: Atin Mukherjee +Date: Mon Dec 17 09:17:44 2018 +0530 + + glusterd: define max-port to 60999 + + As glusterd scans through all the ports in its defined range, with RHEL + 7.3 onwards any port beyond 60999 isn't within the ephemeral port range + and following AVC denial message is seen. + + type=AVC msg=audit(1471946614.154:109): avc: denied { name_bind } for + pid=2302 comm="glusterd" src=61000 scontext=system_u:system_r:glusterd_t:s0 + tcontext=system_u:object_r:ephemeral_port_t:s0 tclass=tcp_socket + + Fix is to define the max port range to 60999 in glusterd.vol file. The + port range can be tweaked through a reconfigure of this configuration + file though. + + Fixes: bz#1659857 + Change-Id: I60fd4a421d8509b8dca4ca13b73999ae33965f72 + Signed-off-by: Atin Mukherjee + +commit 0b4b111fbd80a5d400a07d61e2b99f230f9be76f +Author: Sanju Rakonde +Date: Fri Nov 30 16:16:55 2018 +0530 + + glusterd: migrating rebalance commands to mgmt_v3 framework + + Current rebalance commands use the op_state machine framework. + Porting it to use the mgmt_v3 framework. + + Change-Id: I6faf4a6335c2e2f3d54bbde79908a7749e4613e7 + fixes: bz#1655827 + Signed-off-by: Sanju Rakonde + +commit 9ff080382cb8c8aab561f4131c3f631e33670338 +Author: Poornima G +Date: Wed Nov 21 10:01:08 2018 +0530 + + mem-pool: Add api to mem_get based on requested size + + Currently mem-pool implementation provides api to get from the + mem pool based on the struct type. This is to retain api + compatibility with the old implementation of mem pool. Internally + in the mem pool structure there is a mapping from struct to size + based pools. + + In this patch, we are adding new APIs to fetch memory from mem pool, + given a size. + + Change-Id: Ib220ee45ebd134a7be8f6482db5a592dbb7b9211 + Updates: #325 + Signed-off-by: Poornima G + +commit 822779332e193471a6caa3199f0f618d2aa2c900 +Author: Sunny Kumar +Date: Mon Dec 17 14:07:27 2018 +0530 + + geo-rep : fix slave volume read-only option + + Problem: When separate ssh key is given for non root user setting slave volume + read-only option results in failure. + + Solution: Check for extra param in case separate key is given for non-root user + and take action accordingly. + + Change-Id: Iafe9a2aa6b86cde1dcd7d63771048a6ae33c2cde + fixes: bz#1659971 + Signed-off-by: Sunny Kumar + +commit c228f0c2d94c028619088c07b66f88488f7c3335 +Author: Pranith Kumar K +Date: Sun Dec 2 15:35:09 2018 +0530 + + Don't depend on string options to be valid always + + updates bz#1650403 + Change-Id: Ib5a11e691599ce4bd93c1ed5aca6060592893961 + Signed-off-by: Pranith Kumar K + +commit bdcb2d8497d77ff28cb031ae3992eb7ea0c90486 +Author: Raghavendra Bhat +Date: Mon Dec 3 11:23:20 2018 -0500 + + features/snapview-client: access priv->path inside lock + + To handle the race condition of a fop or a function accessing priv->path + and a reconfigure changing priv->path (because entry point directory + changed), the private structure's path is guarded by the lock. + + updates bz#1650403 + Change-Id: I61c539da06d68d38eafcf2155699c7702f31323e + Signed-off-by: Raghavendra Bhat + +commit 403c69d35827b6cbb430e97a797c318cca81e86e +Author: Yaniv Kaul +Date: Thu Sep 13 16:03:23 2018 +0300 + + AFR xlator: use dict_{setn|getn|deln|get_int32n|set_int32n|set_strn} + + In a previous patch (https://review.gluster.org/20769) we've + added the key length to be passed to dict_* funcs, to remove the need + to strlen() it. This patch moves some xlators to use it. + + - In some cases, moved strlen() of the key length outside of locks, + which is usually a good thing. Please verify it's safe to do so. + - In some cases, created a prefix for the keys, replacing something like + "%d-%d" with a "%s" in snprintf(). Not sure it adds value, but improves + readability. + + Please review carefully. + + Compile-tested only! + + Change-Id: I04f2a1eb2ecfc3283d849d150d10d088ae7aa7f1 + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + +commit f0c46df09fe542d6a365adc0c544ba460598501c +Author: Jiffin Tony Thottan +Date: Wed Dec 12 12:10:44 2018 +0530 + + selinux/glusterd : add "features.selinux" to glusterd-volume-set.c + + Fixes: bz#1659868 + Change-Id: I38675ba4d47c8ba7f94cfb4734692683ddb3dcfd + Signed-off-by: Jiffin Tony Thottan + +commit 152907d438bf8bb571e43ec278ec7b01da2431a6 +Author: Kotresh HR +Date: Wed Dec 5 17:27:07 2018 +0530 + + cluster/afr: Fix mem leak reported by ASAN + + Traceback: + + Direct leak of 765 byte(s) in 9 object(s) allocated from: + #0 0x7ffb9cad2c48 in malloc (/lib64/libasan.so.5+0xeec48) + #1 0x7ffb9c5f8949 in __gf_malloc ./libglusterfs/src/mem-pool.c:136 + #2 0x7ffb9c5f91bb in gf_vasprintf ./libglusterfs/src/mem-pool.c:236 + #3 0x7ffb9c5f938a in gf_asprintf ./libglusterfs/src/mem-pool.c:256 + #4 0x7ffb826714ab in afr_get_heal_info ./xlators/cluster/afr/src/afr-common.c:6204 + #5 0x7ffb825765e5 in afr_handle_heal_xattrs ./xlators/cluster/afr/src/afr-inode-read.c:1481 + #6 0x7ffb825765e5 in afr_getxattr ./xlators/cluster/afr/src/afr-inode-read.c:1571 + #7 0x7ffb9c635af7 in syncop_getxattr ./libglusterfs/src/syncop.c:1680 + #8 0x406c78 in glfsh_process_entries ./heal/src/glfs-heal.c:810 + #9 0x408555 in glfsh_crawl_directory ./heal/src/glfs-heal.c:898 + #10 0x408cc0 in glfsh_print_pending_heals_type ./heal/src/glfs-heal.c:970 + #11 0x408fc5 in glfsh_print_pending_heals ./heal/src/glfs-heal.c:1012 + #12 0x409546 in glfsh_gather_heal_info ./heal/src/glfs-heal.c:1154 + #13 0x403e96 in main ./heal/src/glfs-heal.c:1745 + #14 0x7ffb99bc411a in __libc_start_main ../csu/libc-start.c:308 + + The dictionary is referenced by caller to print the status. + So set it as dynstr, the last unref of dictionary will free it. + + updates: bz#1633930 + Change-Id: Ib5a7cb891e6f7d90560859aaf6239e52ff5477d0 + Signed-off-by: Kotresh HR + +commit b40bb5394dbe5b391d8218d71d672d7e1820e5d3 +Author: ShyamsundarR +Date: Fri Dec 14 16:57:01 2018 -0500 + + dht: Fix clang warnings in dht-common.c + + Change-Id: I0894d62edd68e13d123aaa5ca1827b98283f0d3e + Updates: bz#1622665 + Signed-off-by: ShyamsundarR + +commit eb77d69be528580ca6e4c109762b862114beca87 +Author: Csaba Henk +Date: Mon Oct 22 00:59:05 2018 +0200 + + fuse: SETLKW interrupt + + Use the (f)getxattr based clearlocks interface to + interrupt a pending lock request. + + updates: #465 + Change-Id: I4e91a4d8791fc688fed400a02de4c53487e61be2 + Signed-off-by: Csaba Henk + +commit d49b41e817d592c1904b6f01716df6546dad3ebe +Author: Amar Tumballi +Date: Tue Oct 16 16:31:49 2018 +0530 + + fuse: add --lru-limit option + + The inode LRU mechanism is moot in fuse xlator (ie. there is no + limit for the LRU list), as fuse inodes are referenced from + kernel context, and thus they can only be dropped on request of + the kernel. This might results in a high number of passive + inodes which are useless for the glusterfs client, causing a + significant memory overhead. + + This change tries to remedy this by extending the LRU semantics + and allowing to set a finite limit on the fuse inode LRU. + + A brief history of problem: + + When gluster's inode table was designed, fuse didn't have any + 'invalidate' method, which means, userspace application could + never ask kernel to send a 'forget()' fop, instead had to wait + for kernel to send it based on kernel's parameters. Inode table + remembers the number of times kernel has cached the inode based + on the 'nlookup' parameter. And 'nlookup' field is not used by + no other entry points (like server-protocol, gfapi etc). + + Hence the inode_table of fuse module always has to have lru-limit + as '0', which means no limit. GlusterFS always had to keep all + inodes in memory as kernel would have had a reference to it. + Again, the reason for this is, kernel's glusterfs inode reference + was pointer of 'inode_t' structure in glusterfs. As it is a + pointer, we could never free it (to prevent segfault, or memory + corruption). + + Solution: + + In the inode table, handle the prune case of inodes with 'nlookup' + differently, and call a 'invalidator' method, which in this case is + fuse_invalidate(), and it sends the request to kernel for getting + the forget request. + + When the kernel sends the forget, it means, it has dropped all + the reference to the inode, and it will send the forget with the + 'nlookup' parameter too. We just need to make sure to reduce the + 'nlookup' value we have when we get forget. That automatically + cause the relevant prune to happen. + + Credits: Csaba Henk, Xavier Hernandez, Raghavendra Gowdappa, Nithya B + + fixes: bz#1560969 + Change-Id: Ifee0737b23b12b1426c224ec5b8f591f487d83a2 + Signed-off-by: Amar Tumballi + +commit fc74ef85e0780e0a265275df00e4d0d4a2d05eab +Author: N Balachandran +Date: Fri Dec 14 16:42:26 2018 +0530 + + performance/rda: Fixed dict_t memory leak + + Removed all references to dict_t xdata_from_req which is + allocated but not used anywhere. It is also not cleaned up + and hence causes a memory leak. + + Change-Id: I2edb857696191e872ad12a12efc36999626bacc7 + fixes: bz#1659432 + Signed-off-by: N Balachandran + +commit 5ec271c316ec6538130d25148179721c595dd5a2 +Author: Iraj Jamali +Date: Fri Nov 23 01:58:44 2018 +0530 + + glusterfsd: Fix coverity issue + + Problem reported: value assigned to a variable is never used + + Fixes CID : 1274230 + + updates: bz#789278 + + Change-Id: I7afcb411876dea81c6820c5b31ae0a2896f9ca15 + Signed-off-by: Iraj Jamali + +commit a6a5f7aa6f05d21db7e8b4fbc39f2c6f843aac39 +Author: Anoop C S +Date: Thu Dec 6 15:05:20 2018 +0530 + + extras: New group volume set command for Samba integration + + # gluster volume set group samba + + List of volume set options from group-samba are aimed at improving the below + workloads which consumes time and network hops in SMB world: + + * Listing of large directories + * Negative lookups during creation of files + + Caching the necessary metadata required for these workloads saves us time and + network hops. On the other side we have to ensure correctness(avoiding stale + cache) in caching(via md-cache) with the help of cache invalidation in an + environment where multiple client access is expected. + + Change-Id: Icdd2d8e5eb290e12bc509105418c668f432f4eae + fixes: bz#1656771 + Signed-off-by: Anoop C S + +commit 930d8b706136e2aaa1f3d173f79e1a4970e65561 +Author: Csaba Henk +Date: Thu Dec 6 16:13:46 2018 +0100 + + locks: handle "clear locks" xattr in fgetxattr too + + The lock clearing procedure was kicked in only in + getxattr context. We need it to work the same way + if it's triggered via fgetxattr (as is the case + with interrupt handling). + + Also cleaned up the instrumentation a bit (more logs, + proper management of allocated data). + + updates: #465 + Change-Id: Icfca26ee181da3b8e15ca3fcf61cd5702e2730c8 + Signed-off-by: Csaba Henk + +commit e3d01793a3ef1307240fdc7d7f0d12be1488b921 +Author: Yaniv Kaul +Date: Sun Dec 2 23:19:46 2018 +0200 + + Multiple posix related files: several modifications + + Just looked at posix.c and related code and performed + some changes and cleanups. The only important one is #3 below, + but surely the others (#2 and #4) need careful review. + Changes to other files are as they were related to code paths + in posix.c. + + I'll send a separate patch for other posix related files. + + Main changes: + 1. Proper initializtion for parameters, where it made sense. + 2. Logged outside the lock in several places. + 3. Moved from CALLOC to MALLOC where it made sense. + 4. Aligned structures. + 5. moved dictionary functions to use _sizen where possible. + (dict_get() -> dict_get_sizen() for example) + + Compile-tested only! + + Change-Id: Ia84699fb495e06d095339c91c1ba770d1393bb6c + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + +commit 2421453bf38469a8c0861f205bdee37e771aa39f +Author: Sheetal Pamecha +Date: Mon Dec 10 18:02:19 2018 +0530 + + cli: variable-length array declaration clang fix + + Problem: Declared variable-length array can have zero size + + Added a goto statement to address this issue. + + Updates: bz#1622665 + + Change-Id: Ibf80643490367a5f7e50f66f87e4296380be45de + Signed-off-by: Sheetal Pamecha + +commit 64d800940e67b75d51f536816ee92bae59d6f850 +Author: Sheetal Pamecha +Date: Thu Dec 13 11:14:10 2018 +0530 + + cluster/ec: NULL pointer deferencing clang fix + + Removing VALIDATE_OR_GOTO check on "this" + + Change-Id: I154deaca5302b41c1cafd87077de880dd03ec613 + Updates: bz#1622665 + Signed-off-by: Sheetal Pamecha + +commit bfe2b5e1530efd364af7a175c8a1c89bc4cab0bb +Author: ShyamsundarR +Date: Wed Dec 12 16:45:09 2018 -0500 + + clang: Fix various missing checks for empty list + + When using list_for_each_entry(_safe) functions, care needs + to be taken that the list passed in are not empty, as these + functions are not empty list safe. + + clag scan reported various points where this this pattern + could be caught, and this patch fixes the same. + + Additionally the following changes are present in this patch, + - Added an explicit op_ret setting in error case in the + macro MAKE_INODE_HANDLE to address another clang issue reported + - Minor refactoring of some functions in quota code, to address + possible allocation failures in certain functions (which in turn + cause possible empty lists to be passed around) + + Change-Id: I1e761a8d218708f714effb56fa643df2a3ea2cc7 + Updates: bz#1622665 + Signed-off-by: ShyamsundarR + +commit 8293d21280fd6ddfc9bb54068cf87794fc6be207 +Author: Amar Tumballi +Date: Thu Dec 6 12:29:25 2018 +0530 + + all: remove code which is not being considered in build + + These xlators are now removed from build as per discussion/announcement + done at https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html + + * move rot-13 to playground, as it is used only as demo + purpose, and is documented in many places. + + * Removed code of below xlators: + - cluster/stripe + - cluster/tier + - features/changetimerecorder + - features/glupy + - performance/symlink-cache + - encryption/crypt + - storage/bd + - experimental/posix2 + - experimental/dht2 + - experimental/fdl + - experimental/jbr + + updates: bz#1635688 + Change-Id: I1d2d63c32535e149bc8dcb2daa76236c707996e8 + Signed-off-by: Amar Tumballi + +commit af7e957b4954bd84b8f7df6bfbd59c939092ead2 +Author: Amar Tumballi +Date: Thu Dec 6 16:24:52 2018 +0530 + + xlator: make 'xlator_api' mandatory + + * Remove the options to load old symbol. + * keep only 'xlator_api' symbol from being exported using xlator.sym + * add xlator_api to all the xlators where its missing + + NOTE: This covers all the xlators which has at least a test case + to validate its loading. If there is a translator, which doesn't + have any test, then we should probably remove that from codebase. + + fixes: #164 + Change-Id: Ibcdc8c9844cda6b4463d907a15813745d14c1ebb + Signed-off-by: Amar Tumballi + +commit 088e2cbb5ee3f3e766b7e4021e2d86d0c5187de0 +Author: Amar Tumballi +Date: Tue Dec 11 16:20:58 2018 +0530 + + symlink-cache: remove from the build + + symlink-cache was written as an experiment to reduce the load + on 'build' systems, which keep doing symlink resolution to get + the proper header files. But since last 6+ years, there was no + way to add it to the volfile using gluster cli, and hence was + not supported anymore. As it is not maintained, and as announced + on [1], we are planning to remove it from the build system. + + [1]- https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html + + updates: bz#1635688 + Change-Id: Iaa25069bceed04cf65f79a4b4a02c05cee848eb5 + Signed-off-by: Amar Tumballi + +commit fb917bf10b4783d5c669e81a5be1f902ca48cb84 +Author: Mohit Agrawal +Date: Fri Nov 23 09:39:43 2018 +0530 + + [geo-rep]: Worker still ACTIVE after killing bricks + + Problem: In changelog xlator after destroying listener it call's + unlink to delete changelog socket file but socket file + reference is not cleaned up from process memory + + Solution: 1) To cleanup reference completely from process memory + serialize transport cleanup for changelog and then + unlink socket file + 2) Brick xlator will notify GF_EVENT_PARENT_DOWN to next + xlator only after cleanup all xprts + + Test: To test the same run below steps + 1) Setup some volume and enable brick mux + 2) kill anyone brick with gf_attach + 3) check changelog socket for specific to killed brick + in lsof, it should cleanup completely + + fixes: bz#1600145 + + Change-Id: Iba06cbf77d8a87b34a60fce50f6d8c0d427fa491 + Signed-off-by: Mohit Agrawal + +commit 52d3f82db2f032eae1b60ffa2f283109858ce3df +Author: Ravishankar N +Date: Tue Dec 11 15:32:03 2018 +0530 + + afr: some minor itable related cleanups + + - this->itable always needs to be allocated, hence move it outside + afr_selfheal_daemon_init(). + - Invoke afr_selfheal_daemon_init() only for self-heal daemon case. + - remove redundant itable allocation in afr_discover(). + - destroy itable in fini. + + Updates bz#1193929 + Change-Id: Ib28b50b607386f5a5aa7d2f743c8b506ccb10eae + Signed-off-by: Ravishankar N + +commit 607bbd935f102602810fdeb61079b85ecb58a118 +Author: Mohit Agrawal +Date: Wed Nov 21 14:33:53 2018 +0530 + + rpc: Resolve memory leak in mgmt_pmap_signout_cbk + + Problem: At the time of submit signout request to mgmt + rpc_clnt_mgmt_pmap_signout create a frame but in cbk + frame is not destroyed + + Solution: cleanup frame in mgmt_pmap_signout_cbk to avoid leak + + Change-Id: I9961cacb2e02c8023c4c99e22e299b8729c2b09f + fixes: bz#1658045 + Signed-off-by: Mohit Agrawal + +commit c9d117d54aea1d775e0eef1881892d11fa12811e +Author: Milind Changire +Date: Wed Dec 12 09:23:11 2018 +0530 + + core: move invalid port logs to DEBUG log level + + Stop spamming "invalid port" logs in case sysadmin has reserved a large + number of ports. + + Change-Id: I244ef7693560cc404b36cadc6b05d92ec0e908d3 + fixes: bz#1656517 + Signed-off-by: Milind Changire + +commit 7dadea15c58eb92e5f5727190bf9446dd6fe7a3c +Author: Raghavendra Bhat +Date: Tue Nov 6 15:27:31 2018 -0500 + + copy_file_range support in GlusterFS + + * libglusterfs changes to add new fop + + * Fuse changes: + - Changes in fuse bridge xlator to receive and send responses + + * posix changes to perform the op on the backend filesystem + + * protocol and rpc changes for sending and receiving the fop + + * gfapi changes for performing the fop + + * tools: glfs-copy-file-range tool for testing copy_file_range fop + + - Although, copy_file_range support has been added to the upstream + fuse kernel module, no release has been made yet of a kernel + which contains the support. It is expected to come in the + upcoming release of linux-4.20 + + So, as of now, executing copy_file_range fop on a fused based + filesystem results in fuse kernel module sending read on the + source fd and write on the destination fd. + + Therefore a small gfapi based tool has been written to be able + test the copy_file_range fop. This tool is similar (in functionality) + to the example program given in copy_file_range man page. + + So, running regular copy_file_range on a fuse mount point and + running gfapi based glfs-copy-file-range tool gives some idea about + how fast, the copy_file_range (or reflink) can be. + + On the local machine this was the result obtained. + + mount -t glusterfs workstation:new /mnt/glusterfs + [root@workstation ~]# cd /mnt/glusterfs/ + [root@workstation glusterfs]# ls + file + [root@workstation glusterfs]# cd + [root@workstation ~]# time /tmp/a.out /mnt/glusterfs/file /mnt/glusterfs/new + real 0m6.495s + user 0m0.000s + sys 0m1.439s + [root@workstation ~]# time glfs-copy-file-range $(hostname) new /tmp/glfs.log /file /rrr + OPEN_SRC: opening /file is success + OPEN_DST: opening /rrr is success + FSTAT_SRC: fstat on /rrr is success + copy_file_range successful + + real 0m0.309s + user 0m0.039s + sys 0m0.017s + + This tool needs following arguments + 1) hostname + 2) volume name + 3) log file path + 4) source file path (relative to the gluster volume root) + 5) destination file path (relative to the gluster volume root) + + "glfs-copy-file-range " + + - Added a testcase as well to run glfs-copy-file-range tool + + * io-stats changes to capture the fop for profiling + + * NOTE: + + - Added conditional check to see whether the copy_file_range syscall + is available or not. If not, then return ENOSYS. + + - Added conditional check for kernel minor version in fuse_kernel.h + and fuse-bridge while referring to copy_file_range. And the kernel + minor version is kept as it is. i.e. 24. Increment it in future + when there is a kernel release which contains the support for + copy_file_range fop in fuse kernel module. + + * The document which contains a writeup on this enhancement can be found at + https://docs.google.com/document/d/1BSILbXr_knynNwxSyyu503JoTz5QFM_4suNIh2WwrSc/edit + + Change-Id: I280069c814dd21ce6ec3be00a884fc24ab692367 + updates: #536 + Signed-off-by: Raghavendra Bhat + +commit 5c723ade196600030ee84621384cceb10fff64d8 +Author: karthik-us +Date: Mon Dec 10 18:13:19 2018 +0530 + + cluster/afr: Do not update read_subvol in inode_ctx after rename/link fop + + Since rename/link fops on a file will not change any data in it, it should + not update the read_subvol values in the inode_ctx, which interprets the + data & metadata readable subvols for that file. The old read_subvol values + should be retained even after the rename/link operations. + + Change-Id: I068044a426823a566f5bea8aa063cd689199d6dd + fixes: bz#1657783 + Signed-off-by: karthik-us + +commit 3e3d83ee359c8bc8a8694865e0a8af869b2b8f33 +Author: Harpreet Kaur +Date: Tue Dec 11 15:07:56 2018 +0530 + + tools: stack-buffer-overflow reported by asan + + This patch fixes buffer overflow in $SRC/tools/setgfid2path/src/main.c + Memory access at offset 196 overflows "pgfid" variable + SUMMARY: AddressSanitizer: stack-buffer-overflow (/lib64/libasan.so.5+0x4e935) + + updates: bz#1633930 + + Change-Id: Ib508c57e96c46b628f63c511437b853b39ae7955 + Signed-off-by: Harpreet Kaur + +commit e41fee7ba316655cdaafb9234a1590051f82db11 +Author: Bhumika Goyal +Date: Thu Dec 6 15:04:55 2018 +0530 + + afr: Resource leak coverity fixes + + Problem reported by Coverity: Leak of memory or pointers to + system resources. + Deallocate the memory pointed to by xattr_serz as the memory + reference is not stored anywhere. + + Fixes CID: 1124760, 124787, 1382418 + + Change-Id: Ib9c2ef28c52e2d43de2552cfd959a98b26272bc1 + updates: bz#789278 + Signed-off-by: Bhumika Goyal + +commit 08adbfb5d2edf9dc01ecc2cf2ca5eccb320b8721 +Author: rishubhjain +Date: Mon Dec 10 13:04:13 2018 -0500 + + write-behind/bit-rot: fix identifier + + Rename the identifiers, bit-rot-server to bit-rot in bit-rot.c & write-ahead to + write-behind in write-behind.c to ensure GD2 understands the options + + Change-Id: Id271ae97de2e54f4e30174482c4e1fb6afc728d3 + Fixes: #164 + Signed-off-by: rishubhjain + +commit f50251daeece85d6ada79b1d1f6697d4fac59ad4 +Author: Harpreet Kaur +Date: Mon Dec 10 16:14:54 2018 +0530 + + nfs: memory leak issue reported by asan + + This patch fixes Direct leaks in exports.c + Leaks are happening in exp_file_parse + SUMMARY: AddressSanitizer: 5120 byte(s) leaked in 20 allocation(s). + SUMMARY: AddressSanitizer: 512 byte(s) leaked in 4 allocation(s). + + Updates: bz#1633930 + + Change-Id: Ib4474f8f6c65d737ed54ed35b4234410d1fd673e + Signed-off-by: Harpreet Kaur + +commit 8b3a1b19fbd73545cb86029ee34033d87190bca5 +Author: Amar Tumballi +Date: Wed Dec 5 20:37:53 2018 +0530 + + encryption: remove crypt xlator from build + + Based on the proposal to remove few features as they are not + actively maintained [1], removing crypt translator from the build. + + [1] - https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html + + Crypt xlator helped in on-disk / at-rest encryption of data. But + currently as there are no maintainers for this, planning to remove + it from master codebase. We are planning to host these experimental/ + tech-preview xlators in another repository, so people who want to + contribute can still use the bits. + + updates: bz#1635688 + + Change-Id: I7f2453907a595c34f635a88c49aab0845369c6e7 + Signed-off-by: Amar Tumballi + +commit e82bcc33ed2d5cd54d3f918397f31818089299ad +Author: Mohit Agrawal +Date: Mon Nov 26 14:40:00 2018 +0530 + + posix: posix_health_check_thread_proc crash due to priv is NULL + + Problem: posix_fini sends a cancellation request to health_check + thread and cleanup priv without ensuring health_check thread + is running + + Solution: Make health_check && disk_space thread joinable and call + gf_thread_cleanup_xint to wait unless thread is not finished + + Change-Id: I4d37b08138766881dab0922a47ed68a2c3411f13 + fixes: bz#1636570 + Signed-off-by: Mohit Agrawal + +commit 2b7b6ff28fa92335613d0b5715acd552cfcfd759 +Author: Mohit Agrawal +Date: Fri Dec 7 12:35:20 2018 +0530 + + glusterd: Resolve memory leak in some glusterd functions + + Problem: Functions allocate memory for req structure but after submit + request they missed to cleanup memory + + Solution: After submit request cleanup allocated mmeory + + Change-Id: I8f995787ed8986b882f008ccd588670b5d4139f5 + updates: bz#1633930 + Signed-off-by: Mohit Agrawal + +commit 74c72d0dd9a47b842f4247d939b64089a6fb8e43 +Author: Sunny Kumar +Date: Fri Dec 7 10:53:44 2018 +0530 + + cli : fix memory leak in cli-cmd-volume.c + + This patch fixes ememory leak reported by ASan. + + Tracebacks: + Direct leak of 84 byte(s) in 1 object(s) allocated from: + #0 0x7f71ea107848 in __interceptor_malloc (/lib64/libasan.so.5+0xef848) + #1 0x7f71e9e2ac49 in __gf_malloc ./libglusterfs/src/mem-pool.c:136 + #2 0x7f71e9e2b4bb in gf_vasprintf ./libglusterfs/src/mem-pool.c:236 + #3 0x7f71e9e2b68a in gf_asprintf ./libglusterfs/src/mem-pool.c:256 + #4 0x41e8ec in cli_cmd_bitrot_cbk ./cli/src/cli-cmd-volume.c:1847 + #5 0x410b39 in cli_cmd_process ./cli/src/cli-cmd.c:137 + #6 0x40fe9d in cli_batch ./cli/src/input.c:29 + #7 0x7f71e989558d in start_thread (/lib64/libpthread.so.0+0x858d) + + updates: bz#1633930 + Change-Id: I8977e45add742e67047291f398f0ee79eb09afe4 + Signed-off-by: Sunny Kumar + +commit 6e92171117c73d7a8901800299446a131e54b597 +Author: Harpreet Kaur +Date: Wed Nov 28 14:06:36 2018 +0530 + + geo-rep: Make slave volume read-only (by default) + + Added a command to set "features.read-only" option + to a default value "on" for slave volume. + Changes are made in: + $SRC//extras/hook-scripts/S56glusterd-geo-rep-create-post.sh + for root geo-rep and + $SRC/geo-replication/src/set_geo_rep_pem_keys.sh + for non-root geo-rep. + + Fixes: bz#1654187 + + Change-Id: I15beeae3506f3f6b1dcba0a5c50b6344fd468c7c + Signed-off-by: Harpreet Kaur + +commit 916df2c12b19ac84b7806d31226d7f832ca7e2bb +Author: Atin Mukherjee +Date: Thu Dec 6 23:14:57 2018 +0530 + + glusterd: fix get_mux_limit_per_process to read default value + + get_mux_limit_per_process () reads the global option dictionary and in + case it doesn't find out a key, assumes that + cluster.max-bricks-per-process option isn't configured however the + default value should be picked up in such case. + + Change-Id: I35dd8da084adbf59793d58557e818d8e6c17f9f3 + Fixes: bz#1656951 + Signed-off-by: Atin Mukherjee + +commit 9ee330aaf0831bc04e2ed72c05be0701571b5294 +Author: Raghavendra Gowdappa +Date: Thu Dec 6 13:24:40 2018 +0530 + + performance/readdir-ahead: update stats from prefetched dentries + + stats from prefetched dentries should be invalidated only if the + files pointed to those dentries were written in the window of + prefetching. Otherwise its safe to use these stats. + + Change-Id: I9ea5aeea4c75dfa03387fca32c626cb4e693290d + Signed-off-by: Raghavendra Gowdappa + Fixes: bz#1656348 + +commit 40a9e53a44e887658fade3f03afc018e82b941b9 +Author: Aravinda VK +Date: Thu Dec 6 15:09:26 2018 +0530 + + New xlator option to control enable/disable of xlators in Gd2 + + Since glusterd2 don't maintain the xlator option details in code, it + directly reads the xlators options table from `*.so` files. To support + enable and disable of xlator new option added to the option table with + the name same as xlator name itself. + + This change will not affect the functionality with glusterd1. + + Change-Id: I23d9e537f3f422de72ddb353484466d3519de0c1 + updates: #302 + Signed-off-by: Aravinda VK + +commit f168db1da76775f11026c922a51a718b54abc4c9 +Author: Mohit Agrawal +Date: Thu Dec 6 22:02:28 2018 +0530 + + cli: fix memory leak in cli rpc ops + + Problem: In some of the cli fops dict_allocate_and_serialize + allocate memory for req structure but after submit + request it missed to cleanup memory fo req.dict.dict_val + + Solution: Call GF_FREE for req.dict.dict_val after submit + cli request + + Change-Id: I76c6b3082fa0be21dc595f87701550a318734ea5 + updates: bz#1633930 + Signed-off-by: Mohit Agrawal + +commit 4bdabc49d034ab2b76e4861a6e10ae41deb86d5e +Author: Rinku Kothiya +Date: Wed Dec 5 19:18:17 2018 +0530 + + cli: fix a memory leak reported by ASan. + + Fixed a leak in cli_cmd_volume_remove_brick_cbk. + SUMMARY: AddressSanitizer: 1152 byte(s) leaked in 8 allocation(s) + + updates: bz#1633930 + + Credits: Mohit Agrawal + Change-Id: Idb59c3880329fde59c415c84d7f0bb09ae879a1a + Signed-off-by: Rinku Kothiya + +commit 36e1175df6f404aad89b8a802d4f603ebaa3515b +Author: Kotresh HR +Date: Wed Dec 5 12:55:14 2018 +0530 + + cli: Fix mem-leaks reported by ASAN + + Tracebacks: + + Direct leak of 96 byte(s) in 1 object(s) allocated from: + #0 0x7f3acf9eac48 in malloc (/lib64/libasan.so.5+0xeec48) + #1 0x7f3acf510949 in __gf_malloc ./libglusterfs/src/mem-pool.c:136 + #2 0x7f3acf5111bb in gf_vasprintf ./libglusterfs/src/mem-pool.c:236 + #3 0x7f3acf51138a in gf_asprintf ./libglusterfs/src/mem-pool.c:256 + #4 0x421611 in cli_cmd_volume_set_cbk ./cli/src/cli-cmd-volume.c:868 + #5 0x410599 in cli_cmd_process ./cli/src/cli-cmd.c:135 + #6 0x40f90d in cli_batch ./cli/src/input.c:29 + #7 0x7f3acd78c593 in start_thread pthread_create.c:463 + + Direct leak of 73 byte(s) in 1 object(s) allocated from: + #0 0x7f3acf9eac48 in malloc (/lib64/libasan.so.5+0xeec48) + #1 0x7f3acf510949 in __gf_malloc ./libglusterfs/src/mem-pool.c:136 + #2 0x421519 in gf_strndup ../../libglusterfs/src/mem-pool.h:167 + #3 0x421519 in gf_strdup ../../libglusterfs/src/mem-pool.h:184 + #4 0x421519 in cli_cmd_volume_set_cbk cli/src/cli-cmd-volume.c:859 + #5 0x410599 in cli_cmd_process cli/src/cli-cmd.c:135 + #6 0x40f90d in cli_batch cli/src/input.c:29 + #7 0x7f3acd78c593 in start_thread pthread_create.c:463 + + Change-Id: I3312751c1e3178672360a678fe15b1f7f1054b22 + updates: bz#1633930 + Signed-off-by: Kotresh HR + +commit 340e58f9b3bcdfe4314da65e592dcd5c2daf6fd9 +Author: Amar Tumballi +Date: Wed Nov 28 10:05:39 2018 +0530 + + all: add xlator_api to many translators + + Fixes: #164 + Change-Id: I93ad6f0232a1dc534df099059f69951e1339086f + Signed-off-by: Amar Tumballi + +commit 7ea5f438f60df9aa16027030f2b24f31bc07524b +Author: Rinku Kothiya +Date: Tue Dec 4 19:27:27 2018 +0530 + + cli: memory leak issue reported by asan + + This patch fixes dict leak in cli_cmd_volume_stop_cbk. + SUMMARY: AddressSanitizer: 640 byte(s) leaked in 4 allocation(s) + + Credits: Mohit Agrawal + Change-Id: If14983b8588e68d16d6bbb04b87e2f06fb97023d + fixes: bz#1633930 + Signed-off-by: Rinku Kothiya + +commit 20ef211cfa5b5fcc437484a879fdc5d4c66bbaf5 +Author: ShyamsundarR +Date: Thu Nov 29 14:08:06 2018 -0500 + + libglusterfs: Move devel headers under glusterfs directory + + libglusterfs devel package headers are referenced in code using + include semantics for a program, this while it works can be better + especially when dealing with out of tree xlator builds or in + general out of tree devel package usage. + + Towards this, the following changes are done, + - moved all devel headers under a glusterfs directory + - Included these headers using system header notation <> in all + code outside of libglusterfs + - Included these headers using own program notation "" within + libglusterfs + + This change although big, is just moving around the headers and + making it correct when including these headers from other sources. + + This helps us correctly include libglusterfs includes without + namespace conflicts. + + Change-Id: Id2a98854e671a7ee5d73be44da5ba1a74252423b + Updates: bz#1193929 + Signed-off-by: ShyamsundarR + +commit ad446dabb88439ba83e2092021b09894351e8e71 +Author: Xie Changlong +Date: Mon Dec 3 19:02:32 2018 +0800 + + protocol/server: support server.all-squash + + We still use gnfs on our side, so do a little work to support + server.all-squash. Just like server.root-squash, it's also a + volume wide option. Also see bz#1285126 + + $ gluster volume set server.all-squash on + + Note: If you enable server.root-squash and server.all-squash + at the same time, only server.all-squash works. Please refer + to following table + + +---------------+-----------------+---------------------------+ + | |all_squash | no_all_squash | + +-------------------------------------------------------------+ + | | |anonuid/anongid for root | + |root_squash |anonuid/anongid |useruid/usergid for no-root| + +-------------------------------------------------------------+ + |no_root_squash |anonuid/anongid |useruid/usergid | + +-------------------------------------------------------------+ + + Updates bz#1285126 + Signed-off-by: Xie Changlong + Signed-off-by: Xue Chuanyu + Change-Id: Iea043318fe6e9a75fa92b396737985062a26b47e + +commit 7f7716f8194e06754d0417f27bcc40638c9f9f83 +Author: Sunny Kumar +Date: Wed Dec 5 12:33:48 2018 +0530 + + cli: fix memory leak in cli/src/cli-rpc-ops.c + + This Patch fixes memory leak reported by ASan. + Leaks are in gf_cli_status_cbk as a result of allocatating memory + using gf_asprintf in loop. + + SUMMARY: AddressSanitizer: 535 byte(s) leaked in 7 allocation(s). + + Change-Id: If2fd76c7c1ea6fc44baca295050800074f9d1323 + updates: bz#1633930 + Signed-off-by: Sunny Kumar + +commit d4723bdd30f0955ca68fec8c01bc87229c6a24c0 +Author: Atin Mukherjee +Date: Tue Nov 20 12:32:32 2018 +0530 + + glusterd: glusterd to regenerate volfiles when GD_OP_VERSION_MAX changes + + While glusterd has an infra to allow post install of spec to bring it up + in the interim upgrade mode to allow all the volfiles to be regenerated + with the latest executable, in container world the same methodology is + not followed as container image always point to the specific gluster rpm + and gluster rpm doesn't go through an upgrade process. + + This fix does the following: + 1. If glusterd.upgrade file doesn't exist, regenerate the volfiles + 2. If maximum-operating-version read from glusterd.upgrade doesn't match + with GD_OP_VERSION_MAX, glusterd detects it to be a version where new + options are introduced and regenerate the volfiles. + + Tests done: + + 1. Bring up glusterd, check if glusterd.upgrade file has been created + with GD_OP_VERSION_MAX value. + 2. Post 1, restart glusterd and check glusterd hasn't regenerated the + volfiles as there's is no change in the GD_OP_VERSION_MAX vs the + op_version read from the file. + 3. Bump up the GD_OP_VERSION_MAX in the code by 1 and post compilation + restart glusterd where the volfiles should be again regenerated. + + Note: The old way of having volfiles regenerated during an rpm upgrade + is kept as it is for now but eventually this can be sunset later. + + Change-Id: I75b49a1601c71e99f6a6bc360dd12dd03a96414b + Fixes: bz#1651463 + Signed-off-by: Atin Mukherjee + +commit afc3006b46bf9d6eb05e39af68bcd81041761a9c +Author: Harpreet kaur +Date: Tue Dec 4 18:09:49 2018 +0530 + + cli: memory leak issue reported by asan + + This patch fixes Indirect leaks in cli-cmd-volume.c + Leaks are happening in cli_cmd_quota_cbk and + cli_cmd_quota_handle_list_all. + SUMMARY: AddressSanitizer: 1152 byte(s) leaked in 8 allocation(s) + + Updates: bz#1633930 + + Change-Id: Ia6c0306e88bd81f74d1220303ead8095fbcf5623 + Signed-off-by: Harpreet kaur + +commit 382ad46bbcb79344285d5cb1fe3ce85f83317c44 +Author: Kotresh HR +Date: Tue Dec 4 05:01:54 2018 -0500 + + tests/geo-rep: Mask failure of geo-rep arbiter test + + Comment out the particular test which is failing + arbitrarily. Also changed the code to differentiate + error cases. There could be some race because of + which it's failing arbitrarily. This will be debugged + and fixed in separate patch. + + Change-Id: I925df6421737d7a9abd9446a9d85029b4285ad2c + updates: bz#1193929 + Signed-off-by: Kotresh HR + +commit 5a8a06bc9d84c188d18b60e4bf0a97963572f065 +Author: Chris Holcombe +Date: Thu Nov 29 10:26:44 2018 -0800 + + debug/io-stats: Fix json output + + Summary: The json being output by the io-stats debug xlator + quotes the numbers. This is not necessary and makes parsing + in strongly typed languages more difficult. + + Change-Id: I3ac13700e2c52dbdc29d0bcdd39896d7871f36fe + fixes: bz#1654521 + Signed-off-by: Chris Holcombe + +commit 65dc176e7c3e3d598605b75f06b796fd0ade2c7e +Author: Sheetal Pamecha +Date: Fri Nov 30 22:01:53 2018 +0530 + + rpc-transport/socket: NULL pointer dereferencing clang fix + + Problem: res->ai_addr could be NULL + + Added a check to address this issue + + Change-Id: Iac88a8d6dc1f009836554448afbc228df93decd6 + Updates: bz#1622665 + Signed-off-by: Sheetal Pamecha + +commit 785106e13864b84f35ca3394518d05d69a4e755f +Author: Yaniv Kaul +Date: Sun Nov 25 11:22:30 2018 +0200 + + xlators/mgmt/glusterd/src/glusterd-volgen.c: use dict_ new functions + + In a previous patch (https://review.gluster.org/20769) we've + added the key length to be passed to dict_* funcs, to remove the need + to strlen() it. This patches makes use of these functions over + this whole file. + + Please review carefully, as there are many many changes there. + + Compile-tested only! + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: I2e1ee340300ec330936c31becda6bfe1b6533281 + +commit 9c06057bae91440aabb1a1a69e5315b56454e1a2 +Author: Atin Mukherjee +Date: Wed Dec 5 10:52:30 2018 +0530 + + tests: Mark tests/bugs/shard/zero-flag.t bad + + Change-Id: I2f4ca470c6666584e0feb129ab712f06772a86c2 + Updates: bz#1656264 + Signed-off-by: Atin Mukherjee + +commit 239c67d49d0f9bec10212122513172e523b9abce +Author: Atin Mukherjee +Date: Tue Dec 4 19:19:58 2018 +0530 + + glusterd: set cluster.max-bricks-per-process to 250 + + Commit 6821cec changed this default from 0 to 250 in the option table, + however the same wasn't done in the global option table. + + Change-Id: I6075f2ebc51e839510d6492fb62e706deb2d845b + Fixes: bz#1652118 + Signed-off-by: Atin Mukherjee + +commit 040a1dbcf6d954dc5965ead40d560a3107f2e3aa +Author: Krutika Dhananjay +Date: Wed Nov 28 12:39:31 2018 +0530 + + extras: Add group-distributed-virt for single-brick ovirt-gluster use-case + + Change-Id: I930011327332b7ba30cc76f614efaf5932eb4f3d + fixes: bz#1654138 + Signed-off-by: Krutika Dhananjay + +commit f80d9be732042477fc08ceb5873cd903002d7d1a +Author: Yaniv Kaul +Date: Wed Nov 7 10:27:15 2018 +0200 + + libglusterfs/src/iobuf.c: small refactor to re-use code. + + No functional changes (I hope). + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: Ifbec21c18a6dbe27c5271db156bff4d30ca85dbf + +commit f479f4618923ca497d499dcaa533d19a2403e0b5 +Author: Sunny Kumar +Date: Tue Dec 4 00:18:42 2018 +0530 + + cli: fix memory leak in cli-cmd-system.c + + This patch fixes memory leak reported by ASan. + + SUMMARY: AddressSanitizer: 384 byte(s) leaked in 2 allocation(s). + + updates: bz#1633930 + Change-Id: I93ebddcfeea3d51547e00775db2c9d99f5dfafea + Signed-off-by: Sunny Kumar + +commit 82987486a9c9145caa6ce9ff31506ba2563a4a97 +Author: Eli Schwartz +Date: Tue Dec 4 11:38:48 2018 -0500 + + configure.ac: fix option to stop automake aborting on pointless error + + glusterfs does not follow the GNU coding standards and therefore must + use the "foreign" strictness. Without this, autoreconf -fi would fail to + execute successfully because automake returned non-zero. + + This change ensures that people using autoreconf, the GNU preferred + invocation method for the autotools build system, can successfully set + up the build. + + Remove the pointless --foreign argument from the autogen.sh invocation + of automake. Not only is configure.ac the preferred way to define such + options (rather than handwritten, piecemeal invocations of every tool in + the autotools toolchain), it was never needed in the autogen.sh as that + script provides no error handling at all and always (incorrectly) + returns successfully as long as autotools itself is installed (no matter + how broken glusterfs itself is). + + Change-Id: Ib0246d5368a54594f517a322465cffb9a85c1b49 + fixes: bz#1656100 + Signed-off-by: Eli Schwartz + +commit 9b770760d94b1fc39ade01df35dd3bcf317a71ed +Author: Milan Zink +Date: Tue Jan 16 13:48:49 2018 +0100 + + Do not blindly add volume share section to smb.conf + + With this change, by default GlusterFS volume share section will + no longer be added to smb.conf for client access unless user.cifs + or user.smb volume set options are enabled. This also fixes the + hook script to check for presence of all configuration possibilities + for those volume set options like 'enable' or 'on'. + + Change-Id: Ibecf7fffb4507d7255d963c3b1482afb0d0db984 + Signed-off-by: Milan Zink + Signed-off-by: Anoop C S + Fixes: bz#1575836 + +commit e48678567a5fb01166a065f9e192b80e721e4181 +Author: Sanju Rakonde +Date: Thu Nov 8 18:50:18 2018 +0530 + + glusterd: migrating profile commands to mgmt_v3 framework + + Current profile commands use the op_state machine framework. + Porting it to use the mgmt_v3 framework. + + The following tests were performed on the patch: + case 1: + 1. On a 3 node cluster, created and started 3 volumes + 2. Mounted all the three volumes and wrote some data + 3. Started profile operation for all the volumes + 4. Ran "gluster v status" from N1, + "gluster v profile info" form N2, + "gluster v profile info" from N3 simultaneously in a + loop for around 10000 times + 5. Didn't find any cores generated. + + case 2: + 1. Repeat the steps 1,2 and 3 from case 1. + 2. Ran "gluster v status" from N1, + "gluster v profile info" form N2(terminal 1), + "gluster v profile info" from N2(terminal 2) + simultaneously in a loop. + 3. No cores were generated. + + fixes: bz#1654181 + Change-Id: I83044cf5aee3970ef94066c89fcc41783ed468a6 + Signed-off-by: Sanju Rakonde + +commit 8e8f4bf3fa16d3790a5eb74b8f07b904024ee9d8 +Author: Harpreet Kaur Lalwani +Date: Wed Nov 21 16:13:36 2018 +0530 + + cli: "usage()" and "--help" for gluster cli + + Added a usage message which will be shown when a user enters an + "unrecognized word" or an "unrecognized command" on the cli. + Also added a "--help" option for gluster cli. + + fixes: bz#1535495 + + Change-Id: Ibcfb3d1c84daa1054e09c5cdfa6a5dab19f534a6 + Signed-off-by: Harpreet Kaur Lalwani + +commit 54ebd47e4154c8b37680b2bac43775fc92ced153 +Author: Kotresh HR +Date: Sat Nov 17 13:14:24 2018 +0530 + + geo-rep: Fix syncing of files with non-ascii filenames + + Problem: + Creation of files/directories with non-ascii names fails + to sync to the slave. It crashes with below traceback on + slave. + ... + File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/repce.py", line 118, in worker + res = getattr(self.obj, rmeth)(*in_data[2:]) + File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/resource.py", line 709, in entry_ops + [ESTALE, EINVAL, EBUSY]) + File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/syncdutils.py", line 546, in errno_wrap + return call(*arg) + File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/libcxattr.py", line 83, in lsetxattr + cls.raise_oserr() + File "/usr/lib/x86_64-linux-gnu/glusterfs/python/syncdaemon/libcxattr.py", line 38, in raise_oserr + raise OSError(errn, os.strerror(errn)) + OSError: [Errno 12] Cannot allocate memory + + Cause: + The length calculation arguments passed to blob creation was done before encoding. Hence + was failing in gfid-access layer. + + Fix: + It appears that the calculating lenght properly fixes this issue. But it will cause + issues in other places in 'python2' and not in 'python3'. So encoding and decoding + each required string to make geo-rep compatible with both 'python2' and 'python3' + is a nightmare and is not fool proof. Hence kept 'python2' code as is with out + encode/decode and applied encode/decode only to 'python3' + + Added non-ascii filename tests to regression + + fixes: bz#1650893 + Change-Id: I35cfaf848e07b1a0b5cb93c01b98b472f08271a6 + Signed-off-by: Kotresh HR + +commit 748e993d1f30197c533933ddae889b317ccd00d3 +Author: Milind Changire +Date: Tue Nov 27 11:43:04 2018 +0530 + + rpc: bump up server.event-threads + + Problem: + A single event-thread causes performance issues in the system. + + Solution: + Bump up event-threads to 2 to make the system more performant. + This helps in making the system more responsive and helps avoid the + ping-timer-expiry problem as well. However, setting the event-threads + to 2 is not the only thing required to avoid ping-timer-expiry issues. + + Change-Id: Idb0fd49e078db3bd5085dd083b0cdc77b59ddb00 + fixes: bz#1653277 + Signed-off-by: Milind Changire + +commit b3d88a0904131f6851f4185e43f815ecc3353ab5 +Author: Soumya Koduri +Date: Wed Nov 28 14:14:00 2018 +0530 + + io-cache: xdata needs to be passed for readv operations + + io-cache xlator has been skipping xdata references when the + date needs to be read into page cache. This patch fixes the same. + + Note: similar changes may be needed for other fops as well + which are handled by io-cache. + + Change-Id: I28d73d4ba471d13eb55d0fd0b5197d222df77a2a + updates: bz#1648768 + Signed-off-by: Soumya Koduri + +commit 9fc6cf898bcb7dc0f3f671e734678616722d0721 +Author: Raghavendra Bhat +Date: Mon Dec 3 11:51:52 2018 -0500 + + rpc: check if fini is there before calling it + + The rpc_transport_t structure is allocated and filled in the + rpc_transport_load function. If filling the fileds of the rpc + structure fails, then in the failure handling the structure is + freed by rpc_transport_cleanup. There, it unconditionally calls + fini. But, if the failure handling was invoked because of any + failure in between the allocation of rpc_transport_t and filling + the transport->fini (including the failure to fill fini ()), then + rpc_transport_cleanup can lead to a segfault. + + Change-Id: I8be9b84cd6b19933c559c9736198a6e440373f68 + fixes: bz#1654917 + Signed-off-by: Raghavendra Bhat + +commit 2bb0e89e4bb113a93c6e786446a140cd99261af8 +Author: Sanju Rakonde +Date: Wed Nov 28 16:13:58 2018 +0530 + + glusterd: perform rcu_read_lock/unlock() under cleanup_lock mutex + + Problem: glusterd should not try to acquire locks on any resources, + when it already received a SIGTERM and cleanup is started. Otherwise + we might hit segfault, since the thread which is going through + cleanup path will be freeing up the resouces and some other thread + might be trying to acquire locks on freed resources. + + Solution: perform rcu_read_lock/unlock() under cleanup_lock mutex. + + fixes: bz#1654270 + Change-Id: I87a97cfe4f272f74f246d688660934638911ce54 + Signed-off-by: Sanju Rakonde + +commit 220722b426f4014abdca0c719b2ca4e3aefeecc4 +Author: Sunny Kumar +Date: Fri Nov 30 17:46:59 2018 +0530 + + cli : Memeory leak fix reported by ASAN + + This patch fixes memory leak in cli-rpc-ops.c. + + Functions: gf_cli_create_volume_cbk, gf_cli_delete_volume_cbk, + gf_cli_start_volume_cbk, gf_cli_remove_tier_brick_cbk, + gf_cli_list_volume_cbk. + + updates: bz#1633930 + + Change-Id: I68a650fb972db18c90e6581a960eae3018f32d40 + Signed-off-by: Sunny Kumar + +commit 46c15ea8fa98bb3d92580b192f03863c2e2a2d9c +Author: Mohit Agrawal +Date: Thu Nov 29 19:55:39 2018 +0530 + + server: Resolve memory leak path in server_init + + Problem: 1) server_init does not cleanup allocate resources + while it is failed before return error + 2) dict leak at the time of graph destroying + + Solution: 1) free resources in case of server_init is failed + 2) Take dict_ref of graph xlator before destroying + the graph to avoid leak + + Change-Id: I9e31e156b9ed6bebe622745a8be0e470774e3d15 + fixes: bz#1654917 + Signed-off-by: Mohit Agrawal + +commit f77fb6d568616592ab25501c402c140d15235ca9 +Author: Raghavendra Bhat +Date: Thu Nov 29 12:04:45 2018 -0500 + + features/bitrot: compare the signature with proper length + + * The scrubber was comparing the checksum of the file that it + calculated (by reading the file) with the on disk signature + (stored via xattr) wrongly. It was using strlen to calculate + the signature, while the actual length of the signature is + given by the brick. Just use the actual length that the brick + provides instead of trying to calculate the signature length via + strlen API. + + * In posix, gfid2path was using the same string that contains the + list of all the xattrs of file to save the value of the gfid2path + xattr as well. This causes confusion when gfid2path xattr is queried + by scrubber for getting the actual path of a corrupted file. Use + separate string to fetch the value of the xattr instead of the string + that contains the list of xattrs. + + Change-Id: I2d664ab524d2b312233476cb35863dde3122e9a9 + fixes: bz#1654805 + Signed-off-by: Raghavendra Bhat + +commit 4d58730c0cd6ab5db39aec8a15276f7bd3371b04 +Author: Ravishankar N +Date: Fri Sep 28 17:00:00 2018 +0530 + + afr: assign gfid during name heal when no 'source' is present. + + Problem: + If parent dir is in split-brain or has dirty xattrs set, and the file + has gfid missing on one of the bricks, then name heal won't assign the + gfid. + + Fix: + Use the brick we select the gfid from as the 'source'. + + Note: Problem was found while trying to debug a split-brain issue on + Cynthia Zhou's setup. + + updates: bz#1637249 + Change-Id: Id088d4f0fb017aa35122de426654194e581ed742 + Reported-by: Cynthia Zhou + Signed-off-by: Ravishankar N + +commit 4364093869f59ed2af3f7d10d5a72df490eac9a9 +Author: Poornima G +Date: Tue Nov 20 14:11:08 2018 +0530 + + doc: Add brick mux thread reduction design doc in developer guide + + Change-Id: I5309efb5826d4385eadea29c1cf973f504eef9e5 + Updates: #475 + Signed-off-by: Poornima G + +commit 080aa5b9e9d998552e23f7c33aed3afb0ca93c34 +Author: Soumya Koduri +Date: Wed Nov 28 12:45:41 2018 +0530 + + leases: Do not conflict with internal fops + + Internal fops (with frame->root->pid < 0) are used to heal + or move data and maintains data integrity. That is they do not + modify client data which holds the lease. Hence no need to recall + Lease for such fops. + + Note: Like for locks, we would need rebalance and self-heal + daemon process to heal lease state as well. + + Change-Id: I8988693fef8d00e17c19dcc842e2238f9eb5ab48 + updates: bz#1648768 + Signed-off-by: Soumya Koduri + +commit b56bf714c1f22212700db50c057e4e47b99be739 +Author: Yaniv Kaul +Date: Fri Nov 23 12:14:59 2018 +0200 + + rpc *.h fles: align structs + + Make an effort to slightly better align the structures. + + Change-Id: I6f80a451f2ffbf15adfb986cedc24c2799787b49 + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + +commit 99c72652f81ca5ea212adbb5a555e12a4de94491 +Author: Jiffin Tony Thottan +Date: Thu Nov 29 19:22:40 2018 +0530 + + nfs : set ctx for every inode looked up nfs3_fh_resolve_inode_lookup_cbk() + + The inode ctx for nfs xlator is set with help nfs_fix_generation. + But currently gnfs is crashing because inode_ctx is becoming null + nfs3_resolve_inode_hard() is used to perform a lookup on entire + path and looks like function is missing to set the ctx for inode. + This patch will set ctx for the inode which it looked on. + + Change-Id: I464fa7f78df1bae990ebe97de8ccf6d5fb74fc9f + fixes: bz#1651439 + Signed-off-by: Jiffin Tony Thottan + +commit 7c0cb6eebd37ced16bb3b4410404be12e8c892b5 +Author: Harpreet Lalwani +Date: Mon Oct 15 12:41:17 2018 +0530 + + cli: memory leak issue reported by asan + + This patch fixes Indirect leaks in tests/bugs/heal-symlinks.t. + Leaks are happening in cli_cmd_volume_heal_cbk. + SUMMARY: AddressSanitizer: 640 byte(s) leaked in 4 allocation(s). + + Updates: bz#1633930 + + Change-Id: I970b4229630fdaf01aec66581c1287beef7560a3 + Signed-off-by: Harpreet Lalwani + +commit 0b54c92a22c89fd1d8e03cad2dfb70a5b73ee12a +Author: ShyamsundarR +Date: Fri Nov 30 11:58:57 2018 -0500 + + clang: Fix io-stats.c NULL pointer issue reported by clang + + The issue pertains to checking if conf is NULL in BUMP_FOP + but not providing that safety in io_stats_release when using + conf to lock and bump nr_opens. + + This is now corrected to check if conf is non-NULL before + attempting the lock and bump nr_opens. + + Tested with local clang analyzer to ensure this fixes the + problem. + + Change-Id: Iffd6a97c2060d0a6930a8dc5914b1956c192cab1 + Updates: bz#1622665 + Signed-off-by: ShyamsundarR + +commit 0566ecc878adc5a5aba2c3210485087a9a67da59 +Author: Sunny Kumar +Date: Fri Nov 30 16:39:32 2018 +0530 + + cli : Memeory leak fix reported by ASAN + + This patch fixes memory leak in cli-rpc-ops.c. + All leaks are happening in gf_cli_remove_brick_cbk. + + SUMMARY: AddressSanitizer: 2944 byte(s) leaked in 22 allocation(s). + + updates: bz#1633930 + + Change-Id: I1e58d538eb9135f1aadcdb54d10b72f55e8a53d1 + Signed-off-by: Sunny Kumar + +commit 98a672f5046620f5fc751ea803e0dfa0bf4e18d3 +Author: Yaniv Kaul +Date: Thu Nov 29 22:27:59 2018 +0200 + + Multiple xlator .h files: remove unused private gf_* memory types. + + It seems there were quite a few unused enums (that in turn + cause unndeeded memory allocation) in some xlators. + I've removed them, hopefully not causing any damage. + + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: I8252bd763dc1506e2d922496d896cd2fc0886ea7 + +commit e74d997f0d7eeb91fe6b5f0f0c3969bf4ac53f9f +Author: ShyamsundarR +Date: Thu Nov 29 15:37:23 2018 -0500 + + clang: Fix clang warnings in snapview-server.c + + The warning by clang is due to the fact that we check for + frame->root to be NULL, but in stack unwind, we ignore the + same. + + If frame is non-NULL then frame->root is non-NULL as frame + creation ensures this. Further, across the code we do not + check both frame and frame->root for validity. + + Hence to fix these clang issues, removing the check for + frame->root in the various functions. + + NOTE: Initially clang reported 14 issues in the file, but + post commit 6eabefe6 the number reduced to 4, unsure why as + that commit does not address this issue. + + Change-Id: I04b63f2d006a1f95773aae9f904b4bd3d5118e62 + Updates: bz#1622665 + Signed-off-by: ShyamsundarR + +commit 95e380eca19b9f0d03a53429535f15556e5724ad +Author: Raghavendra Gowdappa +Date: Wed Oct 31 16:10:58 2018 +0530 + + rpcsvc: provide each request handler thread its own queue + + A single global per program queue is contended by all request handler + threads and event threads. This can lead to high contention. So, + reduce the contention by providing each request handler thread its own + private queue. + + Thanks to "Manoj Pillai" for the idea of pairing a + single queue with a fixed request-handler-thread and event-thread, + which brought down the performance regression due to overhead of + queuing significantly. + + Thanks to "Xavi Hernandez" for discussion on + how to communicate the event-thread death to request-handler-thread. + + Thanks to "Karan Sandha" for voluntarily running + the perf benchmarks to qualify that performance regression introduced + by ping-timer-fixes is fixed with this patch and patiently running + many iterations of regression tests while RCAing the issue. + + Thanks to "Milind Changire" for patiently running + the many iterations of perf benchmarking tests while RCAing the + regression caused by ping-timer-expiry fixes. + + Change-Id: I578c3fc67713f4234bd3abbec5d3fbba19059ea5 + Fixes: bz#1644629 + Signed-off-by: Raghavendra Gowdappa + +commit f0232d07f7e6543b56830be28f6e80f9085e6241 +Author: Kaleb S. KEITHLEY +Date: Tue Nov 27 11:19:59 2018 -0500 + + core: ctx calls naked calloc() + + liblglusterfs provides wrapper functions MALLOC/__gf_default_malloc, + CALLOC/__gf_default_calloc, and REALLOC/__gf_default_realloc for those + few places outside of mempool.c that need to call malloc/calloc/realloc + directly. + + Notable exceptions are "contrib" code, e.g. rbtree and timer-wheel, + and perhaps parsers generated by yacc+lex. But even parsers can be + fixed to at least call the wrappers mentioned above, if not our own + allocators. + + Change-Id: Ib8069815eba9b6c04c3adaf59727ec8d8795c4d1 + updates: bz#1193929 + Signed-off-by: Kaleb S. KEITHLEY + +commit 18b6d7ce7d490e807815270918a17a4b392a829d +Author: Raghavendra Gowdappa +Date: Fri Nov 16 16:27:17 2018 +0530 + + libglusterfs: rename macros roof and floor to not conflict with math.h + + Change-Id: I666eeb63ebd000711b3f793b948d4e0c04b1a242 + Signed-off-by: Raghavendra Gowdappa + Updates: bz#1644629 + +commit 9f9f46ff2d30ff87a6a4f8c2af491ea1aa92fbb2 +Author: Kaleb S. KEITHLEY +Date: Tue Nov 27 14:24:15 2018 -0500 + + glusterd: volume-ops calls naked malloc + + libglusterfs provides wrapper functions MALLOC/__gf_default_malloc, + CALLOC/__gf_default_calloc, and REALLOC/__gf_default_realloc for those + few places outside of mempool.c that need to call malloc/calloc/realloc + directly. + + Notable exceptions are "contrib" code, e.g. rbtree and timer-wheel, + and perhaps parsers generated by yacc+lex. But even parsers can be + fixed to at least call the wrappers mentioned above, if not our own + allocators + + Change-Id: Ie6156307b6d2183be9c9aff153afb7598974f4e4 + updates: bz#1193929 + Signed-off-by: Kaleb S. KEITHLEY + +commit 3566903e03f90e262483a5d53a6c85f0b16ece3a +Author: Harpreet Kaur +Date: Tue Nov 27 12:17:38 2018 +0530 + + tests/geo-rep: Add Arbiter volume test case + + Added geo-rep regression tests with Arbiter volume. + + Fixes: bz#1653565 + + Change-Id: Id99523c1f1d3d301fbe871aa0641d9ae4ed7b8d7 + Signed-off-by: Harpreet Kaur + +commit bbf1b9090b6b51292afab4af4479ef2d4ca61265 +Author: Amar Tumballi +Date: Sun Nov 25 11:01:01 2018 +0530 + + posix: fix memory leak + + Direct leak of 609960 byte(s) in 4485 object(s) allocated from: + #0 0x7f0d719bea50 in __interceptor_calloc (/lib64/libasan.so.5+0xefa50) + #1 0x7f0d716dc08f in __gf_calloc ../../../libglusterfs/src/mem-pool.c:111 + #2 0x7f0d5d41d9b2 in __posix_get_mdata_xattr ../../../../../xlators/storage/posix/src/posix-metadata.c:240 + #3 0x7f0d5d41dd6b in posix_get_mdata_xattr ../../../../../xlators/storage/posix/src/posix-metadata.c:317 + #4 0x7f0d5d39e855 in posix_fdstat ../../../../../xlators/storage/posix/src/posix-helpers.c:685 + #5 0x7f0d5d3d65ec in posix_create ../../../../../xlators/storage/posix/src/posix-entry-ops.c:2173 + + Direct leak of 609960 byte(s) in 4485 object(s) allocated from: + #0 0x7f0d719bea50 in __interceptor_calloc (/lib64/libasan.so.5+0xefa50) + #1 0x7f0d716dc08f in __gf_calloc ../../../libglusterfs/src/mem-pool.c:111 + #2 0x7f0d5d41ced2 in posix_set_mdata_xattr ../../../../../xlators/storage/posix/src/posix-metadata.c:359 + #3 0x7f0d5d41e70f in posix_set_ctime ../../../../../xlators/storage/posix/src/posix-metadata.c:616 + #4 0x7f0d5d3d662c in posix_create ../../../../../xlators/storage/posix/src/posix-entry-ops.c:2181 + + We were freeing only the first context in inode during forget, and not the second. + + updates: bz#1633930 + Change-Id: Ib61b4453aa3d2039d6ce660f52ef45390539b9db + Signed-off-by: Amar Tumballi + +commit 6d69a663497ba2bb90b42eae8384cc57d6e4b283 +Author: Xavi Hernandez +Date: Tue Nov 27 12:21:01 2018 +0100 + + mem-pool: minor fix and clarification + + A comment has been added to pool_destructor() function to explain why + locks are not needed there. Also, the initialization of 'poison' field + has been moved inside a locked region for further safety and clarity. + + Change-Id: Idbf23bda7f9228d60c644a1bea4b6c2cfc582090 + updates: bz#1193929 + Signed-off-by: Xavi Hernandez + +commit 0a3540293bf2f4e96d79ca0d1baa168712472279 +Author: Shwetha K Acharya +Date: Fri Nov 23 17:28:07 2018 +0530 + + geo-rep: Geo-rep help text issue + + Modified Geo-rep help text for better sanity. + + Change-Id: I48f4d0fd60c1ffcde753b37416e0c73afd0b5702 + fixes: bz#1652887 + Signed-off-by: Shwetha K Acharya + +commit a52d2d704318a930b0a2eb6d92701499fa97e52e +Author: Atin Mukherjee +Date: Thu Nov 22 09:58:52 2018 +0530 + + glusterd: perform store operation in cleanup lock + + All glusterd store operation and cleanup thread should work under a + critical section to avoid any partial store write. + + Change-Id: I4f12e738f597a1f925c87ea2f42565dcf9ecdb9d + Fixes: bz#1652430 + Signed-off-by: Atin Mukherjee + +commit c7eb1883bea6e72a72908b2e2966d4893d47db16 +Author: Sunny Kumar +Date: Fri Nov 23 12:23:05 2018 +0530 + + glusterd : fix high sev coverity issue + + This patch fixes CID : 1174824 : RESOURCE_LEAK + + Change-Id: I59d2d6ebc1fa3d7ebe0b97c7dbe3c5539128522a + updates: bz#789278 + Signed-off-by: Sunny Kumar + +commit 01f3358501672e7c0fa8ae1f749f060af29bcd69 +Author: Yaniv Kaul +Date: Sun Nov 25 12:04:50 2018 +0200 + + libglusterfs/src/dict.c : consistent initialization of parameters. + + Some were assigned NULL, for no good reason, some were assigned proper + initial value. Made them all consistent, as much as possible, to be + assigned reasonable initial values. + No expected functional changes (and I also assume the compiler + already did most of this work behind the scenes anyway, so no + performance implications either). + + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: I2bc0d4f2221124b5f9ef6150c86b7259074e7013 + +commit b2a50989822c135c2e4cb84ad7ad400957a49d10 +Author: Niels de Vos +Date: Tue Nov 13 12:53:17 2018 +0100 + + build: add option to compile with ThreadSanitizer + + ThreadSanitizer is a debugging tool that can detect threads that race + for data modifications. These races can result in data corruption and + are difficult to track and fix. + + Change-Id: Ibbdaf17c811e30e79cd5bdcf9cd9ff2d0cdb2abb + URL: https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual + Reported-by: Yaniv Kaul + Fixes: #543 + Signed-off-by: Niels de Vos + +commit fc9889d0373c323aab0d93f8ca31d2d8151bd041 +Author: Ravishankar N +Date: Fri Oct 26 17:51:38 2018 +0530 + + glfsheal: add a '--nolog' flag + + ....and if set, change the log level to GF_LOG_NONE. This is useful for + monitoring applications which invoke the heal info set of commands once + every minute, leading to un-necessary glfsheal* logs in + /var/log/glusterfs/. For example, we can now run + + `gluster volume heal info --nolog` + `gluster volume heal info split-brain --nolog` etc. + + The default log level is still retained at GF_LOG_INFO. + + The patch also changes glfsheal internally to accept '--xml' instead of 'xml'. + Note: The --nolog flag is *not* displayed in the help anywhere, for the + sake of consistency in how the other flags are not displayed anywhere in + the help. + + fixes: bz#1643519 + Change-Id: Ia08b6aa6e4a0548379db7e313dd4411ebc66f206 + Signed-off-by: Ravishankar N + +commit b346c84ad5f090c3d99dc1cb80f24ca10747a085 +Author: Ashish Pandey +Date: Fri Aug 31 14:20:23 2018 +0530 + + cluster/afr: Add test for thin-arbiter feature + + Test : Check success/failure of write fop while + different bricks/ta process are down. + + Change-Id: I3c376935df93ebf1f794c964bd19bc1280d91c59 + updates: bz#1624332 + Signed-off-by: Ashish Pandey + +commit a2829d1151cabd13764e271a07568b9c90261a76 +Author: Susant Palai +Date: Fri Aug 3 17:43:28 2018 +0530 + + coding-standard: memset before string functions similar to sprintf/snprintf etc + + String functions like sprintf/snprintf/vprintf etc terminates the string with a + null character. This makes meset redundant and also incurs some performance + penalty. + + Also added a comment about using GF_MALLOC instead of GF_CALLOC for allocating + buffer for strings, targeted by such functions. + + Fixes: bz#1193929 + Change-Id: I4f40d4fd5342b70983936119606c6c9f352c303c + Signed-off-by: Susant Palai + +commit c97938e0508d991f44fd6a02216ecae120bfcac8 +Author: root +Date: Fri Nov 23 19:30:01 2018 +0530 + + geo-rep: add no-verify and ssh-port options for create command + + Added the missing options and their description. + + fixes: bz#1652911 + Change-Id: Id9135953bc6d32e645f004e1c77449899ca3d67c + Signed-off-by: root + +commit 31f85a4c7b20d9e594109f933f97127ba43029a8 +Author: Xavi Hernandez +Date: Wed Nov 7 18:54:23 2018 +0100 + + libglusterfs: fix memory corruption caused by per-thread mem pools + + There was a race in the per-thread memory pool management that could lead + to memory corruption. The race appeared when the following sequence of + events happened: + + 1. Thread T1 allocated a memory object O1 from its own private pool P1 + 2. T1 terminates and P1 is marked to be destroyed + 3. The mem-sweeper thread is woken up and scans all private pools + 4. It detects that P1 needs to be destroyed and starts releasing the + objects from hot and cold lists. + 5. Thread T2 releases O1 + 6. O1 is added to the hot list of P1 + + The problem happens because steps 4 and 6 are protected by diferent locks, + so they can run concurrently. This means that both T1 and T2 are modifying + the same list at the same time, potentially causing corruption. + + This patch fixes the problem using the following approach: + + 1. When an object is released, it's only returned to the hot list of the + corresponding memory pool if it's not marked to be destroyed. Otherwise + the memory is released to the system. + 2. Object release and mem-sweeper thread synchronize access to the deletion + mark of the memory pool to prevent simultaneous access to the list. + + Some other minor adjustments are made to reduce the lengths of the locked + regions. + + Fixes: bz#1651165 + Change-Id: I63be3893f92096e57f54a6150e0461340084ddde + Signed-off-by: Xavi Hernandez + +commit b2776b1ec1ad845ba568c4439bca3b57cc4d2592 +Author: Kotresh HR +Date: Tue Nov 20 12:36:55 2018 +0530 + + geo-rep: Fix permissions with non-root setup + + Problem: + In non-root fail-over/fail-back(FO/FB), when slave is + promoted as master, the session goes to 'Faulty' + + Cause: + The command 'gluster-mountbroker ' + is run as a pre-requisite on slave in non-root setup. It modifies the permission and group of following required directories and files recursively - [1] /var/lib/glusterd/geo-replication - [2] /var/log/glusterfs/geo-replication-slaves + [1] /var/lib/glusterd/geo-replication + [2] /var/log/glusterfs/geo-replication-slaves + + In a normal setup, this is executed on slave node and hence + doing it recursively is not an issue on [1]. But when original + master becomes slave in non-root during FO/FB, it contains + ssh public keys and modifying permissions on them causes + geo-rep to fail with incorrect permissions. + + Fix: + Don't do permission change recursively. Fix permissions for + required files. + + fixes: bz#1651498 + Change-Id: I68a744644842e3b00abc26c95c06f123aa78361d + Signed-off-by: Kotresh HR + +commit ad35193718a99494ab1b852ca4cbdf054f73de88 +Author: Soumya Koduri +Date: Sun Nov 18 23:38:08 2018 +0530 + + gfapi: Offload callback notifications to synctask + + Upcall notifications are received from server via epoll + and same thread is used to forward these notifications + to the application. This may lead to deadlock and hang + in the following scenario. + + Consider if as part of handling these callbacks, + application has to do some operations which involve + sending I/Os to gfapi stack which inturn have to wait for + epoll threads to receive repsonse. Thus this may lead to + deadlock if all the epoll threads are waiting to complete + these callback notifications. + + To address it, instead of using epoll thread itself, + make use of synctask to send those notificaitons to the + application. + + Change-Id: If614e0d09246e4279b9d1f40d883a32a39c8fd90 + updates: bz#1648768 + Signed-off-by: Soumya Koduri + +commit 0967f3dd0d73263c843d76e1837aa78c3fbf14c1 +Author: Mohammed Rafi KC +Date: Fri Nov 23 11:31:38 2018 +0530 + + coverity: Fix coverity issues + + This patch fixes coverity + CID : 1356537 + https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389108&defectInstanceId=26791927&mergedDefectId=1356537 + CID : 1395666 + https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389187&defectInstanceId=26791932&mergedDefectId=1395666 + CID : 1351707 + https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389027&defectInstanceId=26791973&mergedDefectId=1351707 + CID : 1396910 + https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389027&defectInstanceId=26791973&mergedDefectId=13596910 + + Change-Id: I8094981a741f4d61b083c05a98df23dcf5b022a2 + updates: bz#789278 + Signed-off-by: Mohammed Rafi KC + +commit 6821cec47e2b7d37b1cda90a89bff12b2ac026ec +Author: Atin Mukherjee +Date: Wed Nov 21 07:49:07 2018 +0530 + + glusterd: make max-bricks-per-process default value to 250 + + Change-Id: Ia2c6a10e2b76a4aa8bd4ea97e5ce33bdc813942e + Fixes: bz#1652118 + Signed-off-by: Atin Mukherjee + +commit 2097f5ef15c809ed4d8465c9fb26916c6d661bce +Author: Sanju Rakonde +Date: Mon Nov 19 15:13:02 2018 +0530 + + glusterd: volume status should not show NFS daemon + + With commit 8ad159b2a7, bz#1511339 got reintroduced. + + fixes: bz#1511339 + + Change-Id: I1e34c1fc60c6dda04af25d123f1ca40964cadb7a + Signed-off-by: Sanju Rakonde + +commit 988bbd966d4332f5b1074aea7e5467a6399bac83 +Author: Mohammed Rafi KC +Date: Fri Nov 23 12:38:44 2018 +0530 + + meta/coverity: Fix coverity in meta xlator + + CID : 1356536 Macro compares unsigned to 0 + https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389645&defectInstanceId=26791929&mergedDefectId=1356536 + CID : 1356535 Macro compares unsigned to 0 + https://scan6.coverity.com/reports.htm#v42907/p10714/fileInstanceId=87389645&defectInstanceId=26791926&mergedDefectId=1356535 + + Change-Id: Icb1c9035589fa871c7223f767adbe0dfa672a9b4 + updates: bz#789278 + Signed-off-by: Mohammed Rafi KC + +commit 424978302c7d5d0e03e54a6284c250e951ca694d +Author: Poornima G +Date: Thu Nov 22 21:41:37 2018 +0530 + + Coverity fix for calling risky function - fscanf + + fscanf with %s reads a word, there is no restriction on the length + of that word, and the caller is required to pass a sufficiently + large buffer for storing thw word. If the input word exceeds the + buffer size, it will cause buffer overflow. + + To fix this, use fscanf with width parameter. Width specifies + the maximum number of characters to be read in the current reading + operation. + + Change-Id: If250abf5eb637b9fc2a79047e3599f83254cd4e5 + updates: bz#1193929 + Signed-off-by: Poornima G + +commit a0fdc9202ca37dccab937e166c8ee696d049e08f +Author: Xavi Hernandez +Date: Fri Nov 23 10:37:40 2018 +0100 + + core: create a constant for default network timeout + + A new constant named GF_NETWORK_TIMEOUT has been defined and all + references to the hard-coded timeout of 42 seconds have been + replaced with this constant. + + Change-Id: Id30f5ce4f1230f9288d9e300538624bcf1a6da27 + fixes: bz#1652852 + Signed-off-by: Xavi Hernandez + +commit 7e691da0d37745e12d2f3e132545db82f05ea8f6 +Author: Pranith Kumar K +Date: Fri Nov 16 11:18:27 2018 +0530 + + features/changelog: Fix dictionary-leak + + rpcsvc_transport_unix_options_build() allocates the dictionary and sets + it in the options variable, there is no need to allocate it before passing + to the function in changelog_rpc_server_init() + + updates bz#1650403 + Change-Id: I5b4caedba6bda706dee723a2be34c3981bf971fb + Signed-off-by: Pranith Kumar K + +commit c0983c3532e2da04c8c8f63df2717c154e0724db +Author: Susant Palai +Date: Wed Nov 21 11:45:23 2018 +0530 + + dht: fix buffer overflow + + CID: 1382461 + + Change-Id: I25b5edf7fd5fdaa52079d0348ebb7f5de9f11503 + updates: bz#789278 + Signed-off-by: Susant Palai + +commit da81c9938ec77401738999cf52ebf2fef695ba4d +Author: Milind Changire +Date: Thu Nov 22 09:56:55 2018 +0530 + + rpc: stop log flooding about ENODATA + + Problem: + Logs are being flooded with ENODATA errors. + This log was introduced via https://review.gluster.org/c/glusterfs/+/21481 + + Solution: + Add a flag to remember that ENODATA error was logged for a + socket/transport + + Change-Id: I54c10b87e46c2592339cc8b966333b8d08331750 + fixes: bz#1650389 + Signed-off-by: Milind Changire + +commit 12285e76e8f93ef6f6aa2611869bd1f40955dc9e +Author: Mohit Agrawal +Date: Wed Nov 21 19:02:42 2018 +0530 + + core: Resolve memory leak at the time of graph init + + Problem: In the commit 751b14f2bfd40e08ad395ccd98c6eb0a41ac4e91 + one code path is missed to avoid leak at the time + of calling graph init + + Solution: Before destroying graph call xlator fini to avoid leak for + server-side xlators those call init during graph init + + Credit: Pranith Kumar Karampuri + fixes: bz#1651431 + + Change-Id: I6e7cff0d792ab9d954524b28667e94f2d9ec19a2 + Signed-off-by: Mohit Agrawal + +commit 429843eb9e3685d11479c58b8bc6416889a01ee3 +Author: Shwetha Acharya +Date: Wed Nov 21 12:24:00 2018 +0530 + + geo-rep: validate the config checkpoint date format + + Added a strlen check to ensure that the format is (Y-m-d H:M:S). + + Change-Id: I8844aaa33418d43ffe2320c4a05eb1eddd306903 + updates: bz#1651584 + Signed-off-by: Shwetha Acharya + +commit ada43dc22d158dcc8998bb35497f885951b52159 +Author: Shwetha Acharya +Date: Thu Nov 15 15:24:22 2018 +0530 + + protocol/client: unchecked return value + + Problem: In client_process_response_v2, value returned from + function client_post_common_dict is not checked for errors + before being used. + + Solution: Added a check condition to resolve the issue. + + CID: 1390020 + + Change-Id: I4d297f33c8dd332ae5f6f21667a4871133b2b570 + updates: bz#789278 + Signed-off-by: Shwetha Acharya + +commit 650b5c5271abeb0eef59ac1ebb0ea3c8c37023ab +Author: Raghavendra Bhat +Date: Wed Oct 31 16:31:35 2018 -0400 + + snapview-server: close the gfapi handle present in a forgotten inode + + Currently, the snapdaemon can reach the lru limit of the inode table + and start sending forgets on the inodes that are least recently used. + snapview-server maintains the mapping between the domain of the + snapdaemon and the gfapi instance which it uses to access the snapshots + via a handle that is stored in the inode context of snapdaemon's inode. + The handle is glfs_h_object structure which itself points to the actual + inode present in the gfapi world. + + But, when snapview-server receives forget on a inode, it deleted the + inode context without actually closing the handle it had obtained to + map the inode from snapdaemon to the inode in gfapi world. + + So, this change makes sure that, the handle is closed as part of the + inode forget. And this closure of the handle will result in gfapi + world receiving forget and unref on its corresponding inode. But + care must be taken to ensure before the closure to ensure that + the gfapi instance from which the handle came from, is still valid + and not destroyed. Otherwise, sending a forget downward to the gfapi + world might result in the access of freed pointers. Hence, the + snapview-server xlator first checks whether that gfapi instance is + still there or not and then proceeds with closure of the handle. + + Change-Id: Ia7bb45112d0c651cc95f2e54d33d925dbd6955b0 + fixes: bz#1646728 + Signed-off-by: Raghavendra Bhat + +commit 751b14f2bfd40e08ad395ccd98c6eb0a41ac4e91 +Author: Mohit Agrawal +Date: Fri Nov 16 09:25:02 2018 +0530 + + core: Resolve memory leak at the time of graph init + + Problem: Memory leak when graph init fails as during volfile + exchange between brick and glusterd + + Solution: Fix the error code path in glusterfs_graph_init + + Change-Id: If62bee61283fccb7fd60abc6ea217cfac12358fa + fixes: bz#1651431 + Signed-off-by: Mohit Agrawal + +commit fbfceb9f2ee240737b329de8aa5b13562f99fddb +Author: Iraj Jamali +Date: Tue Oct 23 14:18:40 2018 +0530 + + glusterfsd: NULL pointer dereferencing clang fix + + Added a check to avoid clang warning + + Updates: bz#1622665 + + Change-Id: If9ae4e4f2ae13c85dad0e87d8dd6930dde74bbda + Signed-off-by: Iraj Jamali + +commit 4e0fab473a4ef8792e332efc83456bf63b540435 +Author: Sheetal Pamecha +Date: Mon Nov 19 10:26:54 2018 +0530 + + core: Retrieving the value of "client.ssl" option, before SSL is set up, fails + + Added a default value "off" for (client|server).ssl + + fixes: bz#1651059 + Change-Id: I3d9c80093ac471d9d770fbd6c67f945491cf726e + Signed-off-by: Sheetal Pamecha + +commit 5231d3d165135f7aae8716069c67788555332136 +Author: Yaniv Kaul +Date: Fri Nov 16 12:32:22 2018 +0200 + + libglusterfs/src/common-utils.h: faster mem_0filled() function + + based on the amusing discussion @ https://rusty.ozlabs.org/?p=560 + + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: I1cac54067eb44801b216d5620fc5ee2c89befdd0 + +commit bdf8d8684fa4814cf055350db38f53618c5de6ae +Author: Kaleb S. KEITHLEY +Date: Fri Nov 16 12:46:49 2018 -0500 + + core: fix strncpy, coverity annotation + + For added fun, coverity is not smart enough to detect that the + strncpy() is safe, and for extra laughs, using coverity annotations + doesn't do anything either; but we're adding them anyway, along + with marking the BUFFER_SIZE_WARNINGS as false positives on + scan.coverity.com. + + Change-Id: If7fa157eca565842109f32fee0399ac183b19ec7 + updates: bz#1193929 + Signed-off-by: Kaleb S. KEITHLEY + +commit 60689bd26f0c9cb9e761f2cf8c5f2b90e39884eb +Author: Vijay Bellur +Date: Fri Nov 16 11:25:16 2018 +0530 + + features/locks: Move logging outside of a locked region + + In pl_metalk(), logging was being done in a synchronized region. + Moving the log out of the synchronized region to avoid other threads + from being blocked on the lock. + + Thanks to Yaniv Kaul for pointing this out. + + Change-Id: I0cb39fb23ae7c798ca9c42c390500491aa8e622b + updates: bz#1644758 + Signed-off-by: Vijay Bellur + +commit 5664c58089127ba5214a7d922eed1aa1b4932402 +Author: N Balachandran +Date: Fri Nov 9 17:06:22 2018 +0530 + + cluster/dht: sync brick root perms on add brick + + If a single brick is added to the volume and the + newly added brick is the first to respond to a + dht_revalidate call, its stbuf will not be merged + into local->stbuf as the brick does not yet have + a layout. The is_permission_different check therefore + fails to detect that an attr heal is required as it + only considers the stbuf values from existing bricks. + To fix this, merge all stbuf values into local->stbuf + and use local->prebuf to store the correct directory + attributes. + + Change-Id: Ic9e8b04a1ab9ed1248b6b056e3450bbafe32e1bc + fixes: bz#1648298 + Signed-off-by: N Balachandran + +commit 5af9799ab7c6185a852c48ef6b8655d294a50d2d +Author: Sunny Kumar +Date: Thu Aug 30 14:48:51 2018 +0530 + + cli : fix coverity issue in cli-xml-output.c + + This patch fixes 1124659, 1241480 and 1274196. + + Change-Id: Ib89f53b8e34fcc47184d08ad57f2ee32fd00d78c + updates: bz#789278 + Signed-off-by: Sunny Kumar + +commit b4faa9e7a25bdf0582f8b0fd69aa1381c307a61e +Author: Mohammed Rafi KC +Date: Thu Nov 15 13:18:36 2018 +0530 + + glusterd/mux: Optimize brick disconnect handler code + + Removed unnecessary iteration during brick disconnect + handler when multiplex is enabled. + + Change-Id: I62dd3337b7e7da085da5d76aaae206e0b0edff9f + fixes: bz#1650115 + Signed-off-by: Mohammed Rafi KC + +commit c2e758b54d8a3f778e3e63db0000bb8b63de9b25 +Author: Soumya Koduri +Date: Mon Oct 29 14:41:26 2018 +0530 + + lease: Treat unlk request as noop if lease not found + + When the glusterfs server recalls the lease, it expects + client to flush data and unlock the lease. If not it sets + a timer (starting from the time it sends RECALL request) and post + timeout, it revokes it. + + Here we could have a race where in client did send UNLK + lease request but because of network delay it may have reached + after server revokes it. To handle such situations, treat + such requests as noop and return sucesss. + + Change-Id: I166402d10273f4f115ff04030ecbc14676a01663 + updates: bz#1648768 + Signed-off-by: Soumya Koduri + +commit b7aec05aa965202ab73120acf0da4c32fe0cf16c +Author: Soumya Koduri +Date: Sun Nov 11 22:53:07 2018 +0530 + + leases: Fix incorrect inode_ref/unrefs + + From testing & code-reading, found couple of places where + we incorrectly unref the inode resulting in use_after_free + crash or ref leaks. This patch addresses couple of them. + + a) When we try to grant the very first lease for a inode, + inode_ref is taken in __add_lease. This ref should be active + till all the leases granted to that inode are released (i.e, + till lease_cnt > 0). In addition even after lease_cnt becomes '0', + the inode should be active till all the blocked fops are resumed. + + Hence release this ref, after resuming all those fops. To avoid + granting new leases while resuming those fops, defined a new boolean + (blocked_fops_resuming) to flag it in the lease_ctx. + + b) 'new_lease_inode' which creates new lease_inode_entry and + takes ref on inode, is used while adding that entry to + client_list and recall_list. + + Use its counter function '__destroy_lease_inode' which does unref + while removing those entries from those lists. + + c) inode ref is also taken when added to timer->data. Unref the same + after processing timer->data. + + Change-Id: Ie77c78ff4a971e0d9a66178597fb34faf39205fb + updates: bz#1648768 + Signed-off-by: Soumya Koduri + +commit 04be5463b20ababc29942fa967017e763d0ae2af +Author: Soumya Koduri +Date: Sat Nov 10 05:55:29 2018 -0500 + + gfapi: Send fop_attr dict as part of syncop_open + + Leaseid (stored in thread locals) is sent to server via xdata. + This dict variable is set but not passed as argument in glfs_h_open(). + Fixed the same. + + Change-Id: Idd2f8a0ec184b4b6b1ad1e6e5d75df551c36a96d + updates: bz#1648768 + Signed-off-by: Soumya Koduri + +commit 818e60ac9269c49396480a151c049042af5b2929 +Author: Mohit Agrawal +Date: Tue Nov 13 08:12:06 2018 +0530 + + glusterd: fix Resource leak coverity issue + + Problem: In commit bcf1e8b07491b48c5372924dbbbad5b8391c6d81 code + was missed to free path return by function search_brick_path_from_proc + + This patch fixes CID: + 1396668: Resource leak + + Change-Id: I4888c071c1058023c7e138a8bcb94ec97305fadf + fixes: bz#1646892 + Signed-off-by: Mohit Agrawal + +commit 8204c072ee80c5901ac38e66e346a2ba7da31892 +Author: Shwetha Acharya +Date: Wed Nov 14 16:28:03 2018 +0530 + + cli: cluster.server-quorum-type help text is missing + + Added a default value "none" and additional description. + + Change-Id: I3a5c06f8ec1e502fc399860e4b5cb835102cd71d + Updates: bz#1608512 + Signed-off-by: Shwetha Acharya + +commit fda594875c4cdb2a22e27aa13f5c66bee032ccb5 +Author: Soumya Koduri +Date: Fri Nov 9 02:29:52 2018 -0500 + + afr: open_ftruncate_cbk should read fd from local->cont.open struct + + afr_open stores the fd as part of its local->cont.open struct + but when it calls ftruncate (if open flags contain O_TRUNC), the + corresponding cbk function (afr_ open_ftruncate_cbk) is + incorrectly referencing uninitialized local->fd. This patch fixes + the same. + + Change-Id: Icbdedbd1b8cfea11d8f41b6e5c4cb4b44d989aba + updates: bz#1648687 + Signed-off-by: Soumya Koduri + +commit 4a4ba1f2eb0be2da9e88560246730af87788295f +Author: Kaleb S. KEITHLE +Date: Fri Nov 9 09:45:05 2018 -0500 + + core: fix strncpy warnings + + Since gcc-8.2.x (fedora-28 or so) gcc has been emitting warnings + about buggy use of strncpy. + + Most uses that gcc warns about in our sources are exactly backwards; + the 'limit' or len is the strlen/size of the _source param_, giving + exactly zero protection against overruns. (Which was, after all, one + of the points of using strncpy in the first place.) + + IOW, many warnings are about uses that look approximately like this: + ... + char dest[8]; + char src[] = "this is a string longer than eight chars"; + ... + strncpy (dest, src, sizeof(src)); /* boom */ + ... + + The len/limit should be sizeof(dest). + + Note: the above example has a definite over-run. In our source the + overrun is typically only theoretical (but possibly exploitable.) + + Also strncpy doesn't null-terminate on truncation; snprintf does; prefer + snprintf over strncpy. + + Mildly surprising that coverity doesn't warn/isn't warning about this. + + Change-Id: I022d5c6346a751e181ad44d9a099531c1172626e + updates: bz#1193929 + Signed-off-by: Kaleb S. KEITHLE + +commit 76906af9d70fc784de728a70e3dbda62dece5e10 +Author: Kaleb S. KEITHLE +Date: Fri Nov 9 11:27:11 2018 -0500 + + core: fix strncpy warnings + + Since gcc-8.2.x (fedora-28 or so) gcc has been emitting warnings + about buggy use of strncpy. + + e.g. + warning: ‘strncpy’ output truncated before terminating nul + copying as many bytes from a string as its length + and + warning: ‘strncpy’ specified bound depends on the length of the + source argument + + Since we're copying string fragments and explicitly null terminating + use memcpy to silence the warning + + Change-Id: I413d84b5f4157f15c99e9af3e154ce594d5bcdc1 + updates: bz#1193929 + Signed-off-by: Kaleb S. KEITHLEY + +commit 8a5adc811637b147e6e42d952498bc99e3d670bb +Author: Yaniv Kaul +Date: Thu Nov 8 08:25:00 2018 +0200 + + rpc/rpc-lib/src/rpc-clnt.c: unlock sooner, if we fail to connect. + + Previously, we did not go to unlock the mutex if we failed + to connect. This patch fixes it. + + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: I0fcca066a2601dba6bc3e9eb8b3c9fc757ffe4db + +commit 013c8295d7cd7f5ad52bcf2585936ed320b8bbc7 +Author: Pranith Kumar K +Date: Wed Nov 14 15:26:30 2018 +0530 + + glusterfsd: Make io-stats xlator search position independent + + Problem: + glusterfsd notify trigger for profile info command expects + decompounder xlator to have the name of the brick and its + immediate child to be io-stats xlator. In GD2 decompounder + xlator doesn't exist, so this is preventing io-stats xlator + from receiving the profile info collection notification. + + Fix: + search for io-stats xlator below server xlator till the first + instance is found and send notification for it. + + fixes bz#1649709 + Change-Id: I92a1d9019bbd5546050ab43d50d571c444e027ed + Signed-off-by: Pranith Kumar K + +commit 4c17065a02fb32acda32aac64da93ea5d326a7d5 +Author: Susant Palai +Date: Tue Nov 13 12:13:03 2018 +0530 + + posix: Fix null pointer dererfence + + CID: 1124799 1214618 + + Change-Id: Iff05180983fe9600be0a2ce015a137e4efb8f533 + updates: bz#789278 + Signed-off-by: Susant Palai + +commit 3e20df8674d489fba707079e2b5a58347a3b3928 +Author: Susant Palai +Date: Thu Nov 8 12:27:07 2018 +0530 + + feature/shard: Fix coverity issue - Use after free + + CID: 1325524 + + Change-Id: Ic713285bd9e76d8e4dc1815aa471087d279008b5 + updates: bz#789278 + Signed-off-by: Susant Palai + +commit 142b840fe14c3b4281a0eaeede918c3e121de84b +Author: Sanju Rakonde +Date: Tue Nov 13 10:56:05 2018 +0530 + + glusterd/snapshot: copy-paste typo + + Change-Id: Ice3663084b2d0a0a10d75ad68fe5fe494f928250 + updates: bz#1193929 + Signed-off-by: Sanju Rakonde + +commit f1a826e1b38d5ecaf9470c61198c4d4362b4c29a +Author: Susant Palai +Date: Thu Nov 8 14:47:27 2018 +0530 + + features/ctime: Fix Coverity issue + + CID : 1394632 Dereference after null check + + Change-Id: If0bef48b070935854e9d2988393dba07c9001cd2 + updates: bz#789278 + Signed-off-by: Susant Palai + +commit 54a5f0a07817098134219aea9414b029013927f3 +Author: Prashanth Pai +Date: Sat Oct 27 16:32:05 2018 +0530 + + glusterfsd: Make each multiplexed brick sign in + + NOTE: This change will be consumed by brick mux implementation of + glusterd2 only. No corresponsing change in glusterd1 has been made. + + When a multiplexed brick process is shutting down, it sends sign out + requests to glusterd for all bricks that it contains. However, sign in + request is only sent for a single brick. Consequently, glusterd has to + use some tricky means to repopulate pmap registry with information of + multiplexed bricks during glusterd restart. + + This change makes each multiplexed brick send a sign in request to + glusterd2 which ensures that glusterd2 can easily repopulate pmap + registry with port information. + + As a bonus, sign in request will now also contain PID of the brick + sending the request so that glusterd2 can rely on this instead of + having to read/manage brick pidfiles. + + Change-Id: I409501515bd9a28ee7a960faca080e97cabe5858 + updates: bz#1193929 + Signed-off-by: Prashanth Pai + +commit 28b4096fe484f545ae578dcef040a69acf6205cd +Author: Kinglong Mee +Date: Sat Sep 29 11:32:17 2018 +0800 + + md-cache: request ACLs related xattrs when mode change + + If glusterfs client changes mode, ACLs related xattrs may changed too. + + Change-Id: Ifa5bff1f77ab7b176e54da4607ea9c1e66fc5588 + Updates: bz#1634220 + Signed-off-by: Kinglong Mee + +commit 9ce088e947d0867ded1bd969d9b22624a59f178b +Author: Atin Mukherjee +Date: Fri Nov 9 12:44:20 2018 +0530 + + glusterd: don't call svcs_reconfigure for all volumes during op-version bump up + + With having large number of volumes in a configuration having + svcs_reconfigure () called for every volumes makes cluster.op-version bump up to + time out. Instead call svcs_reconfigure () only once. + + Change-Id: Ic6a133d77113c992a4dbeaf7f5663b7ffcbb0ae9 + Fixes: bz#1648237 + Signed-off-by: Atin Mukherjee + +commit 96ae7dd2262a3ac72aea14c69f7404a8f8435a5c +Author: Sunny Kumar +Date: Thu Nov 8 14:14:04 2018 +0530 + + quiesce : fix coverity issue + + This patch fixes 1388996 : Dereference null return value + + updates: bz#789278 + + Change-Id: I9351ae43736efd2f9abe4e1888dba89b6b3e1fe3 + Signed-off-by: Sunny Kumar + +commit f68f9106087a3dc4e6da88a09285ac723096d7e9 +Author: Vijay Bellur +Date: Wed Nov 7 06:31:19 2018 -0800 + + features/changelog: Avoid a potential null dereference + + Addresses CID 1396292 + + Change-Id: I9141502a12fb3e18c04d07c79da87a5ebb2cfc23 + updates: bz#789278 + Signed-off-by: Vijay Bellur + +commit bcf1e8b07491b48c5372924dbbbad5b8391c6d81 +Author: Mohit Agrawal +Date: Tue Nov 6 16:23:51 2018 +0530 + + core: Portmap entries showing stale brick entries when bricks are down + + Problem: pmap is showing stale brick entries after down the brick + because of glusterd_brick_rpc_notify call gf_is_service_running + before call pmap_registry_remove to ensure about brick instance. + + Solutiom: 1) Change the condition in gf_is_pid_running to ensure about + process existence, use open instead of access to achieve + the same + 2) Call search_brick_path_from_proc in __glusterd_brick_rpc_notify + along with gf_is_service_running + + Change-Id: Ia663ac61c01fdee6c12f47c0300cdf93f19b6a19 + fixes: bz#1646892 + Signed-off-by: Mohit Agrawal + +commit e134ef2493e8517a6f341416c11230c2bb5bcd6c +Author: Yaniv Kaul +Date: Thu Nov 8 07:50:48 2018 +0200 + + rpc-clnt*: several code changes to reduce conn lock times + + Assorted code refactoring to reduce lock contention. + Also, took the opportunity to reorder structs more properly. + Removed dead code. + + Hopefully, no functional changes. + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: I5de6124ad071fd5e2c31832364d602b5f6d6fe28 + +commit cac2dba48bf8029b2b0421850fcc4598e33569f6 +Author: Yaniv Kaul +Date: Sun Oct 21 03:55:04 2018 +0300 + + libglusterfs multiple files: remove dead initilization + + Per newer GCC releases and clang-scan, some trivial + dead initialization (values that were set but were never + read) were removed. + + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: Ia9959b2ff87d2e9cb46864e68ffe7dccb984db34 + +commit db28fc7a35b784a4ca6a361961081f93e968cfcb +Author: Ravishankar N +Date: Thu Nov 8 16:03:23 2018 +0530 + + cli: avoid unnecessary strtail for geo rep config. + + Found while looking at this function for another patch. + + Compile Tested Only! + + Updates bz#1193929 + Change-Id: I46a9e95bf4d6609bc122edf86418659369258abe + Signed-off-by: Ravishankar N + +commit cefdd02776d204744a13215029f1c3fe024283e4 +Author: Kotresh HR +Date: Fri Nov 2 09:08:42 2018 +0530 + + ctime: Enable ctime feature by default + + This patch does following. + + 1. Enable ctime feature by default. + + 2. Earlier, to enable the ctime feature, two options + needed to be enabled + a. gluster vol set utime on + b. gluster vol set ctime on + + This is inconvenient from the usability point of + view. Hence changed it to following single option + + a. gluster vol set ctime on + + fixes: bz#1624724 + Change-Id: I04af0e5de1ea6126c58a06ba8a26e22f9f06344e + Signed-off-by: Kotresh HR + +commit 185106a574646bdc2d4ec50756c52db61ad14d98 +Author: Atin Mukherjee +Date: Tue Nov 6 21:35:36 2018 +0530 + + cli: add a warning/confirmation message in peer detach code path + + On a multi node cluster if one of the node is detached which had active + clients mounted through the same server address, this can cause all the + clients to loose any volfile changes. This is due to the lack of infra + in glusterd to let client know the list of IPs and attempt to connect to + other active nodes as failback. Such framework does exist in GD2 but not + in GD1. + + This patch ensures to take a preventive measure to have a warning + message thrown to user to ensure all such connected clients are + remounted through a different IP. + + Change-Id: I740b01868abbd75bf0a609cfaf00114d4d78aa96 + Fixes: bz#1647074 + Signed-off-by: Atin Mukherjee + +commit 6d4cd8ce6c0d88d331ffed97c51d3061a3900561 +Author: Kinglong Mee +Date: Thu Nov 8 10:21:29 2018 +0800 + + gfapi: fix bad dict setting of lease-id + + lease_id is a 16 bits opaque data, copying it by gf_strdup is wrong. + + Invalid read of size 2 + at 0x483FA2F: memmove (vg_replace_strmem.c:1270) + by 0xE2EF6FB: ??? (in /usr/lib64/libtirpc.so.3.0.0) + by 0xE2EE047: xdr_opaque (in /usr/lib64/libtirpc.so.3.0.0) + by 0x107A97DC: xdr_gfx_value (glusterfs4-xdr.c:207) + by 0x107A98C0: xdr_gfx_dict_pair (glusterfs4-xdr.c:321) + by 0xE2EF35E: xdr_array (in /usr/lib64/libtirpc.so.3.0.0) + by 0x107A9A89: xdr_gfx_dict (glusterfs4-xdr.c:335) + by 0x107AA97B: xdr_gfx_write_req (glusterfs4-xdr.c:897) + by 0x107A181E: xdr_serialize_generic (xdr-generic.c:25) + by 0x231044A2: client_submit_request (client.c:205) + by 0x2314D3C1: client4_0_writev (client-rpc-fops_v2.c:3863) + by 0x230FD5FA: client_writev (client.c:956) + Address 0xad659e18 is 72 bytes inside a block of size 73 alloc'd + at 0x483880B: malloc (vg_replace_malloc.c:299) + by 0x106BA7EC: __gf_malloc (mem-pool.c:136) + by 0x1064521E: gf_strndup (mem-pool.h:166) + by 0x1064521E: gf_strdup (mem-pool.h:183) + by 0x1064521E: get_fop_attr_thrd_key (glfs.c:627) + by 0x1064D8E9: glfs_pwritev@@GFAPI_3.4.0 (glfs-fops.c:1154) + by 0x10610C0C: glusterfs_write2 (handle.c:2092) + by 0x54D30C: mdcache_write2 (mdcache_file.c:647) + by 0x48A3FC: nfs4_write (nfs4_op_write.c:459) + by 0x48A44D: nfs4_op_write (nfs4_op_write.c:487) + by 0x4634F5: nfs4_Compound (nfs4_Compound.c:947) + by 0x460155: nfs_rpc_process_request (nfs_worker_thread.c:1329) + by 0x4608A3: nfs_rpc_valid_NFS (nfs_worker_thread.c:1539) + by 0x488F12F: svc_vc_decode (svc_vc.c:825) + + Updates bz#1647651 + Change-Id: Ib9fff55c897bc43c15036a869888e763df133757 + Signed-off-by: Kinglong Mee + +commit bdb4ca184913c82ccf9552298f5d5b597794f2aa +Author: Sanju Rakonde +Date: Tue Nov 6 19:44:16 2018 +0530 + + glusterd: allow shared-storage to use bricks under glusterd working directory + + With commit 44e4db, we are not allowing user to create a volume + using glusterd's working directory as a brick or any sub directory + under glusterd's working directory as a brick.This has broken + shared-storage since the volume "gluster-shared-storage" is + created using the bricks under glusterd's working directory. + + With this patch, we let the "gluster-shared-storage" volume + to use bricks under glusterd's working directory. + + fixes: bz#1647029 + Change-Id: Ifcbcf4576eea12cf46f199dea287b29bd3ec3bfd + Signed-off-by: Sanju Rakonde + +commit 3056419608d5e1835d41612e09b56511d0f9a101 +Author: ShyamsundarR +Date: Wed Nov 7 15:17:55 2018 -0500 + + coverity: ignore tainted access reported in gf_free + + Earlier commit had the annotation incorrect, and also did not + wrap the sanitization in a separate function. (see commit 39a1db1) + + The issues are corrected in this patch, and also a coverity + stand alone run has been tested to ensure the annotations are + respected by coverity. + + Change-Id: I4a93b6981e2ff4bba9a29e590b17da248931c8ae + Updates: bz#789278 + Signed-off-by: ShyamsundarR + +commit a907e468e724c32b9833ce59806fc215c7122d63 +Author: Amar Tumballi +Date: Fri Aug 10 15:57:50 2018 +0530 + + bd: remove from the build + + Based on the proposal to remove few features as they are not + actively maintained [1], removed BD (block device) translator + from the build. + + [1] - https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html + + Updates: bz#1635688 + Change-Id: Ia96db406c58a7aef355dde6bc33523bb2492b1a9 + Signed-off-by: Amar Tumballi + +commit 8f82c1165871e43de945ba0ed3fdaaf0d68aeef3 +Author: Vijay Bellur +Date: Tue Nov 6 10:12:10 2018 -0800 + + features/locks:Use pthread_mutex_unlock() instead of pthread_mutex_lock() + + Fixes CID 1396581 + + Change-Id: Ic04091b5783a75d8e1e605a9c1c28b77fea048d3 + updates: bz#789278 + Signed-off-by: Vijay Bellur + +commit c3fcff9ccbfcec1be242fd5cf210c9995586b078 +Author: Amar Tumballi +Date: Wed Oct 3 17:13:09 2018 +0530 + + glupy: remove from the build + + Based on the proposal to remove few features as they are not + actively maintained [1], removing 'glupy' translator from the + build. + + [1] https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html + + This patch aims at clearing the translator from build and tests. + A followup is needed to remove the code from repository. + + Updates: bz#1642810 + Change-Id: I41d0c1956330c3bbca62c540ccf9ab01bbf3a092 + Signed-off-by: Amar Tumballi + +commit e78682bb7c2e40b7f818efdcd56aca459b9dbb03 +Author: Amar Tumballi +Date: Fri Nov 2 10:39:58 2018 +0530 + + xlators/experimental: remove from the build + + Based on the proposal to remove few features as they are not + actively maintained [1], removing all experimental translators + from the build. + + [1] https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html + + Note that as followup patch, there would be a patch to remove the code. + + Updates: bz#1635688 + Change-Id: I8ebc256517feb37fc7580104e8bebe27d047f959 + Signed-off-by: Amar Tumballi + +commit ee630e250fdc0081ae58c078ee5f5500561984df +Author: Hu Jianfei +Date: Tue Nov 6 06:47:08 2018 -0500 + + glusterfsd: Do not process GLUSTERD_NODE_STATUS if graph is not ready + + Otherwise, gnfs will crash if we try to get nfs clients status in + following situation. Also see commit 2f9e555f. + + Reproducible Steps: + 1. systemctl restart glusterd; gluster volume status rep + 2. systemctl restart glusterd; gluster volume status rep nfs clients + + step 1 works ok, but step 2 will lead localhost gnfs crash with + certain probability. + + /lib64/libglusterfs.so.0(+0x270f0)[0x7effb6c7b0f0] + /lib64/libglusterfs.so.0(gf_print_trace+0x334)[0x7effb6c854a4] + /lib64/libc.so.6(+0x35270)[0x7effb52e7270] + /usr/sbin/glusterfs(glusterfs_handle_node_status+0x155)[0x7effb7196905] + /lib64/libglusterfs.so.0(+0x63f40)[0x7effb6cb7f40] + /lib64/libc.so.6(+0x46d40)[0x7effb52f8d40] + + Updates: bz#1646869 + + Change-Id: Ia4cb009f821d32b2d18ba48d3467cc81a4b07747 + Signed-off-by: Xie Changlong + Signed-off-by: Hu Jianfei + +commit d945c44c6289eadcda805f728fcc638586658c37 +Author: Pranith Kumar K +Date: Tue Nov 6 21:27:33 2018 +0530 + + cluster/afr: s/uuid_is_null/gf_uuid_is_null + + Updates bz#1193929 + Change-Id: I1b312dabffac7e101df8ce15557527fd28a2c61f + Signed-off-by: Pranith Kumar K + +commit d76611fbba18d3120ac59f8f127981d0c950962a +Author: Yaniv Kaul +Date: Tue Nov 6 18:18:30 2018 +0200 + + libglusterfs/src/iobuf.c: don't forget to unlock a mutex + + commit ed83a4ee7b73e6b04694d1ac11ed25d2983ac943 changed locking + order and forgot to unlock in a negative path (when index was -1). + Coverity caught it (thanks!) as CID 1396581: Program hangs (LOCK) + + Note: I'm unlocking before logging the failure. I think it's the right + order - logging can take a while (especially if your disk is slow). + + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: I82ac241edf1d511bf6807cf9c46c538ab9f4acc4 + +commit bab025b08e63afd28cba6a3e2c5e18474904dcd3 +Author: Amar Tumballi +Date: Tue Nov 6 15:58:45 2018 +0530 + + tests/interrupt.t: remove 'stripe' volume type + + Merged the patch which introduced this testcase after the + 'remove stripe' patch got merged, and hence the confusion. + + Updates: bz#1193929 + Change-Id: Ia08552debb111292caf14e51ea6a27334fe5c788 + Signed-off-by: Amar Tumballi + +commit 9777662406319422450989db104d5a588e52104d +Author: Kinglong Mee +Date: Mon Oct 15 15:41:23 2018 +0800 + + md-cache: new option "cache-glusterfs-acl" for virtual glusterfs ACLs + + Change-Id: I020ab08dba48f13cf7b8908e96280f1e92e9b9db + Updates: bz#1634220 + Signed-off-by: Kinglong Mee + +commit 5f19d8231cedf72af554d6f5e9c2636b1586ec16 +Author: Kinglong Mee +Date: Sat Sep 29 11:54:07 2018 +0800 + + md-cache: request cached xattrs at getxattr/fgetxattr + + Change-Id: I8e3ad961164815683776850e3a5fd4f510003690 + Updates: bz#1634220 + Signed-off-by: Kinglong Mee + +commit 7be4f21f257f23d8e4f2fd57aefa8736cae4cdbf +Author: Kinglong Mee +Date: Sat Sep 29 11:45:11 2018 +0800 + + md-cache: extends xa_time when previous attributes equals cached attributes + + Some operations like read/write only update iatt and ia_time, + without any operion request xattrs from glusterfsd, + the xa_time is timeout before ia_time always. + + This patch updates xa_time when update ia_ttime. + + Change-Id: I77e3984f38c1c4dbebfde9729b8117fbacde9674 + Updates: bz#1634220 + Signed-off-by: Kinglong Mee + +commit 93e9b4c167f582234e08e2608fc844bdf02fd507 +Author: Kinglong Mee +Date: Mon Oct 15 16:15:17 2018 +0800 + + md-cache: remove xattr setting after new file created + + Fops of creating file does not request cached xattrs, + the xattr in reply is not cached xattrs. + + Change-Id: Iab2db686e92466e72cfee8ac494e851d797c10b3 + Updates: bz#1634220 + Signed-off-by: Kinglong Mee + +commit 40318205bfcf75c6eee1c4c18f103260a77a7886 +Author: Sanju Rakonde +Date: Mon Nov 5 11:28:46 2018 +0530 + + glusterd: initialise caps inside #ifdef HAVE_BD_XLATOR block + + Note: The problem is seen when we disable bd xlator. + + Problem: When we create a volume, volume info file is having + caps value as 15 in nodes which hosts bricks for that volume. + Remainig nodes in cluster are not having caps field. When + glusterd is restarted, peers are going into rejected state, + because of this mismacth in configuration files. + + Cause: In glusterd_op_create_volume(), we initialise caps + value as 15 in the beginning. Later, we check whether brick + belongs to the same node or not. If brick doesn't belong to + the same node, caps value will be set to 0. If brick belongs + to the same node, we will change the caps value inside + + Solution: If brick doesn't belongs to the same node,caps is + set to 0 and if brick belongs to same brick caps value is + changed inside #ifdef HAVE_BD_XLATOR block. So, to have the + consistency across the cluster, we need to initialise caps + value inside #ifdef HAVE_BD_XLATOR block, only when brick + belongs to the same node. + + fixes: bz#1645986 + Change-Id: I2648f420b21d6e69e7c38b0f4736d41e0f15a7f5 + Signed-off-by: Sanju Rakonde + +commit eb75b04fe15b8b7c0fadbafe9b2ed0c8ce87def8 +Author: Amar Tumballi +Date: Thu Sep 20 23:19:39 2018 +0530 + + doc: add a new contributor 'hints' guide + + Keeping this in glusterfs Repo for glusterfs specific improvements. + There would be a link to this page, and some more similar pages from + docs.gluster.org + + updates: bz#1193929 + Change-Id: Ie98670cc32e62951f1b1880b1ae39f5cc2b45329 + Signed-off-by: Amar Tumballi + +commit c2c70552188ee1b15bb748b4f2272062505c7696 +Author: Susant Palai +Date: Fri Nov 2 09:23:42 2018 +0530 + + lock: Do not allow meta-lock count to be more than one + + In the current scheme of glusterfs where lock migration is + experimental, (ideally) the rebalance process which is migrating + the file should request for a metalock. Hence, the metalock count + should not be more than one for an inode. In future, if there is a + need for meta-lock from other clients, this patch can be reverted. + + Since pl_metalk is called as part of setxattr operation, any client + process(non-rebalance) residing outside trusted network can exhaust + memory of the server node by issuing setxattr repetitively on the + metalock key. The current patch makes sure that more than + one metalock cannot be granted on an inode. + + Fixes CVE-2018-14660 + + updates: bz#1644758 + Change-Id: Ie1e697766388718804a9551bc58351808fe71069 + Signed-off-by: Susant Palai + +commit 4c6b063463ae48b3509ff8e66cd391f8637a86af +Author: Csaba Henk +Date: Tue Aug 21 12:44:54 2018 +0200 + + fuse: diagnostic FLUSH interrupt + + We add dummy interrupt handling for the FLUSH + fuse message. It can be enabled by the + "--fuse-flush-handle-interrupt" hidden command line + option, or "-ofuse-flush-handle-interrupt=yes" + mount option. + + It serves no other than diagnostic & demonstational + purposes -- to exercise the interrupt handling framework + a bit and to give an usage example. + + Documentation is also provided that showcases interrupt + handling via FLUSH. + + Change-Id: I522f1e798501d06b74ac3592a5f73c1ab0590c60 + updates: #465 + Signed-off-by: Csaba Henk + +commit bceb9f25671e65cb2f0987a84370055e7c36900f +Author: Csaba Henk +Date: Thu Aug 9 11:46:33 2018 +0200 + + fuse: interrupt handling framework + + - add sub-framework to send timed responses to kernel + - add interrupt handler queue + - implement INTERRUPT + + fuse_interrupt looks up handlers for interrupted messages + in the queue. If found, it invokes the handler function. + Else responds with EAGAIN with a delay. + + See spec at + + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/fuse.txt?h=v4.17#n148 + + and explanation in comments. + + Change-Id: I1a79d3679b31f36e14b4ac8f60b7f2c1ea2badfb + updates: #465 + Signed-off-by: Csaba Henk + +commit 258db7178663305c26aa0068d4f72159ff0bc3ba +Author: Yaniv Kaul +Date: Sun Nov 4 16:17:27 2018 +0200 + + libglusterfs/src/iobuf.c: where possible, pass the index parameter + + Don't 'calculate' again where it can be passed. + If possible, do not perform under lock. + + Also remove some NULL checks, assuming they were done by the callers. + Left a remark for each such change. + + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: Ia5c2851506da3388cb2d4445334c58881e2c4416 + +commit ed83a4ee7b73e6b04694d1ac11ed25d2983ac943 +Author: Yaniv Kaul +Date: Sun Nov 4 13:47:25 2018 +0200 + + libglusterfs/src/iobuf.c: take the pool lock once in new pool + + When creating a new pool, take the pool lock once and create + all arenas, instead of taking and releasing for each arena. + + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: I7daa39de960e47e66a32ecab724cf3a61ccdc01b + +commit ba52abc6931baecb73d690b289f8feb32205424f +Author: Yaniv Kaul +Date: Sun Nov 4 11:00:11 2018 +0200 + + libglusterfs/src/iobuf.c: remove some if statements + + Small code refactoring to remove some if statements + in several functions. No functional changes expected. + + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: If9f8d5d53c9688fb994b6d690aea66f65fa01c55 + +commit d2b745319334a1025b9e47f55928033b8d1c7c46 +Author: Amar Tumballi +Date: Fri Nov 2 10:39:18 2018 +0530 + + logging: create parent dir if not available + + As glusterfs logging uses different directory than /var/log + (ie, /var/log/glusterfs), there is a chance it may not be + present when starting glusterfs. Create parent dir if it + doesn't exist. + + Updates: bz#1193929 + Change-Id: I8d6f7e5a608ba53258b14617f5d103d1e98b95c1 + Signed-off-by: Amar Tumballi + +commit 3c6cf9a4a1b46cab2dc53c1ee0afca0fe993102e +Author: Kotresh HR +Date: Mon Nov 5 11:46:41 2018 +0530 + + geo-rep: Fix traceback with symlink metadata sync + + While syncing metadata, 'os.chmod', 'os.chown', + 'os.utime' should be used without de-reference. + But python supports only 'os.chown' without + de-reference. That's mostly because Linux + doesn't support 'chmod' on symlink file itself + but it does support 'chown'. + + So while syncing metadata ops, if it's symlink + we should only sync 'chown' and not do 'chmod' + and 'utime'. It will lead to tracebacks with + errors like EROFS, EPERM, ACCESS, ENOENT. + All the three errors (EPERM, ACCESS, ENOENT) + were handled except EROFS. But the way it was + handled was not fool proof. The operation is + tried and failure was handled based on the errors. + All the errors with symlink file for 'chown', + 'utime' had to be passed to safe errors list of + 'errno_wrap'. This patch handles it better by + avoiding 'chmod' and 'utime' if it's symlink + file. + + fixes: bz#1646104 + Change-Id: Ic354206455cdc7ab2a87d741d81f4efe1f19d77d + Signed-off-by: Kotresh HR + +commit 74e8328d3f6901d6ba38a313965fe910c8411324 +Author: Amar Tumballi +Date: Thu Nov 1 07:25:25 2018 +0530 + + all: fix the format string exceptions + + Currently, there are possibilities in few places, where a user-controlled + (like filename, program parameter etc) string can be passed as 'fmt' for + printf(), which can lead to segfault, if the user's string contains '%s', + '%d' in it. + + While fixing it, makes sense to make the explicit check for such issues + across the codebase, by making the format call properly. + + Fixes: CVE-2018-14661 + + Fixes: bz#1644763 + Change-Id: Ib547293f2d9eb618594cbff0df3b9c800e88bde4 + Signed-off-by: Amar Tumballi + +commit 2effe3b0d3fa51fc627c970353de2e326bcf1ef2 +Author: Amar Tumballi +Date: Thu Nov 1 07:16:32 2018 +0530 + + protocol: remove the option 'verify-volfile-checksum' + + 'getspec' operation is not used between 'client' and 'server' ever since + we have off-loaded volfile management to glusterd, ie, at least 7 years. + + No reason to keep the dead code! The removed option had no meaning, + as glusterd didn't provide a way to set (or unset) this option. So, + no regression should be observed from any of the existing glusterfs + deployment, supported or unsupported. + + Updates: CVE-2018-14653 + + Updates: bz#1644756 + Change-Id: I4a2e0f673c5bcd4644976a61dbd2d37003a428eb + Signed-off-by: Amar Tumballi + +commit 5441fb4196a94d238377c427f400fe5e28ae5d46 +Author: Amar Tumballi +Date: Thu Nov 1 07:02:11 2018 +0530 + + server: don't allow '/' in basename + + Server stack needs to have all the sort of validation, assuming + clients can be compromized. It is possible for a compromized + client to send basenames with paths with '/', and with that + create files without permission on server. By sanitizing the basename, + and not allowing anything other than actual directory as the parent + for any entry creation, we can mitigate the effects of clients + not able to exploit the server. + + Fixes: CVE-2018-14651 + + Fixes: bz#1644755 + Change-Id: I5dc0da0da2713452ff2b65ac2ddbccf1a267dc20 + Signed-off-by: Amar Tumballi + +commit acb208221bfe3ac897d8eb4fbe18fa6c8aa9286e +Author: Amar Tumballi +Date: Thu Nov 1 07:21:41 2018 +0530 + + io-stats: prevent taking file dump on server side + + By allowing clients taking dump in a file on brick process, we are + allowing compromised clients to create io-stats dumps on server, + which can exhaust all the available inodes. + + Fixes: CVE-2018-14659 + + Fixes: bz#1644757 + Change-Id: I32bfde9d4fe646d819a45e627805b928cae2e1ca + Signed-off-by: Amar Tumballi + +commit 49f1b76f471f0845a2c7edf69f5629226f73ad27 +Author: Sunny Kumar +Date: Sat Nov 3 23:09:40 2018 +0530 + + glusterd : fix high sev coverity issue + + This patch fixes CID : 1174824 : RESOURCE_LEAK + + updates: bz#789278 + + Change-Id: I2a4f8b508995de112fa16e1094e44ecd4b625312 + Signed-off-by: Sunny Kumar + +commit bd1a8fc74ac9322384daab94bf5736cae15ecbfe +Author: Ravishankar N +Date: Thu Nov 1 21:31:41 2018 +0530 + + index: prevent arbitrary file creation outside entry-changes folder + + Problem: + A compromised client can set arbitrary values for the GF_XATTROP_ENTRY_IN_KEY + and GF_XATTROP_ENTRY_OUT_KEY during xattrop fop. These values are + consumed by index as a filename to be created/deleted according to the key. + Thus it is possible to create/delete random files even outside the gluster + volume boundary. + + Fix: + Index expects the filename to be a basename, i.e. it must not contain any + pathname components like "/" or "../". Enforce this. + + Fixes: CVE-2018-14654 + + Fixes: bz#1644760 + Change-Id: I35f2a39257b5917d17283d0a4f575b92f783f143 + Signed-off-by: Ravishankar N + +commit 643c9d049de970d27b2bfa806c4d47ea6eabefe6 +Author: Raghavendra Bhat +Date: Tue Oct 16 15:34:20 2018 -0400 + + features/snapview-server: change gf_log instances to gf_msg + + Change-Id: Ib8bdf210a896423abcd7413dd4896d424ac0f561 + fixes: bz#1626610 + Signed-off-by: Raghavendra Bhat + +commit 029a7e5c1908f53cc4411a8d6cbf6a4e2b207879 +Author: Kinglong Mee +Date: Thu Oct 18 17:46:26 2018 +0800 + + dht: fix use after free in dht_rmdir_readdirp_cbk + + The frame is freed when linkfile exist in dht_rmdir_is_subvol_empty(), + the following message use the freed local. + + Change-Id: I41191e8bd477f031a2444d5f15e578dc4f086e6b + Updates: bz#1640489 + Signed-off-by: Kinglong Mee + +commit aad1e56286c35237decb106434596fb7f081ee53 +Author: Atin Mukherjee +Date: Sat Nov 3 12:13:29 2018 +0530 + + glusterd: coverity fixes + + Addresses CIDs : 1124769, 1124852, 1124864, 1134024, 1229876, 1382382 + + Also addressed a spurious failure in + tests/bugs/glusterd/df-results-post-replace-brick-operations.t to ensure + post replace brick operation and before triggering 'df' from mount, + client has connection to the newly replaced bricks. + + Change-Id: Ie5d7e02f89400a661491d7fc2a120d6f6a83a1cc + Updates: bz#789278 + Signed-off-by: Atin Mukherjee + +commit 91cb12be96fb543ee9c0b47bfa8792786286aff7 +Author: Sunny Kumar +Date: Tue Oct 30 20:22:41 2018 +0530 + + posix : fix coverity issues in posix-entry-ops.c + + This patch fixes CID: + 1. 1389762 : Explicit null dereferenced + 2. 1390462 : Argument cannot be negative + 3. 1124552 : Explicit null dereferenced + 4. 1356522 : Argument cannot be negative + + updates: bz#789278 + Change-Id: I1262f3b4b61a6e65bb34884f46df9a24b8dd03f1 + Signed-off-by: Sunny Kumar + +commit a665120d77072cfc8daca88d717055132a178be1 +Author: Sunny Kumar +Date: Wed Sep 26 00:30:26 2018 +0530 + + glusterd : fix high coverity issues glusterd-store.c + + This patch fixes CID 1224305, 1202395, 1202394, 1174824, 1174825, 1174826 + and 1202397. + + All issues are of RESOURCE_LEAK type. + + Change-Id: Ie9944d5bdd0bd2788afdb1b6bb329aa3c44b90d0 + updates: bz#789278 + Signed-off-by: Sunny Kumar + +commit 36e2ec3c88eba7a1bcd8aa6f64e4672349ff1d0c +Author: Kinglong Mee +Date: Thu Oct 18 19:42:48 2018 +0800 + + md-cache: removexattr must be send to glusterfsd + + Change-Id: I53a583ec14bce65e8914bc496123dee3abe61f6c + Updates: bz#1634220 + Signed-off-by: Kinglong Mee + +commit c2a543ec947ac56f882a9c0a890f49c63dedeaff +Author: Amar Tumballi +Date: Wed Oct 17 23:03:04 2018 +0530 + + xlator: add generic option parsing framework + + As an example, and also as an enhancement, added 'log-level' + as a default option to every translator (glusterfs already + support infrastructure to handle xl->loglevel). + + Corresponding infrastructure to add per xlator log-level + is not present in glusterd volume-set. Plan is to get it + sorted out in later patches or in GD2. + + * Why this is needed? - Mainly because we need to only add + different log-level to some xlator to debug few things in a + production system, while not changing overall log-level. This + helps in better debug-ability. + + Updates: bz#1193929 + + Change-Id: Ia4098ce39197cd423345b3d31fe8315481681ab8 + Signed-off-by: Amar Tumballi + +commit 55a6ba56bea9ec0d3316c005300c514ea3ab0e54 +Author: Amar Tumballi +Date: Wed Oct 3 17:00:24 2018 +0530 + + tiering: remove the translator from build and glusterd + + Based on the proposal to remove few features as they are not + actively maintained [1], removing tier translator from the + build. Also make sure there are no regression tests involving + tiering feature are present. + + [1] https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html + + Change-Id: I2c177f711f9b54b7b24e1a13525ff3132bd9a9c5 + updates: bz#1642807 + Signed-off-by: Amar Tumballi + +commit 6e8f7bb6ab457cfee42e405243cf4db82a9a56b8 +Author: Sanju Rakonde +Date: Tue Oct 30 16:36:50 2018 +0530 + + glusterd: set fsid while performing replace brick + + While performing the replace-brick operation, we should set + fsid value to the new brick. + + fixes: bz#1637196 + + Change-Id: I9e9a4962fc0c2f5dff43e4ac11767814a0c0beaf + Signed-off-by: Sanju Rakonde + +commit 5d0c8e8ec9b68352cf53f8e430897096e2caf477 +Author: Varsha Rao +Date: Mon Oct 29 09:53:27 2018 +0530 + + posix: Fix coverity issue + + This patch fixes the unchecked return value, coverity issue. + CID: 1391412 + + Change-Id: If85f4afdf8c6d37602c62fbf4d7c730e18be81e7 + updates: bz#789278 + Signed-off-by: Varsha Rao + +commit 00a5e2a5112971e4d3dca8419f24d878b4199d37 +Author: Kotresh HR +Date: Tue Oct 30 10:56:52 2018 +0530 + + posix/ctime: Avoid log flood in posix_update_utime_in_mdata + + posix_update_utime_in_mdata() unconditionally logs an error if + consistent time attributes features is not enabled. This log + does not add any value, prints an incorrect errno & floods + the log file. Hence nuking this log message in this patch. + + fixes: bz#1644129 + Change-Id: I9a1f9e7ada3366d2830f18d81f16a1461040092e + Signed-off-by: Kotresh HR + +commit d3ec5f5a089edb68206b5d4a469358867340d4f7 +Author: Amar Tumballi +Date: Thu Nov 1 07:08:29 2018 +0530 + + glusterd-handshake: prevent a buffer overflow + + as key size in xdr can be anything, it can be bigger than the + 'NAME_MAX' allowed in the structure, which can allow for service denial + attacks. + + Fixes: CVE-2018-14653 + + Fixes: bz#1644756 + Change-Id: I2dc5e99af27ddf44c12c94b07e51adb8674cce80 + Signed-off-by: Amar Tumballi + +commit 7fac81aeab5805fb2bd719d7489636633bb5e32a +Author: Amar Tumballi +Date: Mon Oct 29 14:16:20 2018 +0530 + + mem-pool: change the values to 64bits + + total_allocs of certain type of variables can be 4billion in a + single day depending on load. So, 32 bits for that is not enough. + + Also, size_t is good variable size for one allocation, but the + sum of allocations, should be 64bits to make sure we don't + overflow the variable. + + Updates: bz#1639599 + Change-Id: If3b19687f94425e913a0201ae5d73661eda51f06 + Signed-off-by: Amar Tumballi + +commit 7150c51ad75ccba22045a35fc31e5037612d1ad4 +Author: Xavi Hernandez +Date: Wed Oct 31 12:26:43 2018 +0100 + + cluster/ec: prevent infinite loop in self-heal full + + There was a problem in commit 7f81067 that caused infinite loop when + full heal was triggered. + + The previous commit was made to prevent self-heal to go idle after a + replace brick operation. One of the changes consisted on setting a + flag to force an immediate scan of the dirty directory if a heal on + a directory succeeded (assuming it could have generated newer entries). + + However that change was causing an issue with a full self-heal, since + every time an already healed directory was checked and it returned + suceessfully, it was also setting the flag, forcing self-heal to start + over again. + + This patch fixes this issue by only setting the flag if the heal is not + full. It's assumed that a full self-heal will already traverse all + entries automatically, so there's no need to force a new scan later. + + Change-Id: Id12dbfc04e622b18183e796cc6cc87ccc30a6d55 + fixes: bz#1636631 + Signed-off-by: Xavi Hernandez + +commit d2d3c37fa8efca74e375b8a0dc7fa720c3b84dcc +Author: Harpreet Lalwani +Date: Thu Oct 4 16:09:08 2018 +0530 + + cluster/dht: NULL pointer dereferencing clang fix + + Dereferencing NUll pointers this,local and stbuf. + + 1.Replaced this->name with "dht". + 2.Removed GF_VALIDATE_OR_GOTO. + 3.Removed the check for "stbuf" and "this". + + Updates: bz#1622665 + + Change-Id: Id2fb2270d5ec37b76fa2aae1f1c8dca72dcc728a + Signed-off-by: Harpreet Lalwani + +commit 9be6bf3d90e3783b3ba559c93d41b933f8d53f03 +Author: Ashish Pandey +Date: Wed Oct 17 15:18:34 2018 +0530 + + cluster/ec: Change log level to DEBUG for lookup combine + + As lookup is not a locked fop, we can not trust the + data received in this to be same. + + Changing the log level to DEBUG in case lookup finds any + difference. + + Change-Id: I39499c44688a2455c7c6c69a798762d045d21b39 + updates: bz#1640066 + BUG: 1640066 + Signed-off-by: Ashish Pandey + +commit fdb34014f1a16f7bf022353881e5a213538e96b2 +Author: Atin Mukherjee +Date: Thu Oct 25 12:37:42 2018 +0530 + + tests: brick-mux-fd-cleanup.t should be under core directory + + Fixes: bz#1637934 + Change-Id: I5f95beab62bd2bdde3bbee94c308b0ad03e94379 + Signed-off-by: Atin Mukherjee + +commit 733139551322e49e7e5617356cf96e30780d2749 +Author: Amar Tumballi +Date: Wed Oct 3 15:30:10 2018 +0530 + + stripe: remove the translator from build and glusterd + + Based on the proposal to remove few features as they are not + actively maintained [1], removing stripe translator from the + build. Also make sure there are no regression tests involving + stripe translator. + + [1] https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html + + Note that this patch aims at removing the translator from build, and + a followup patch is needed to remove the code from repository. + + Updates: bz#1364707 + Change-Id: I235b305338f138e29e9f30cba65bc0dadbebbbd5 + Signed-off-by: Amar Tumballi + +commit 19775e0445411cca9ddd9d294fd54d0b6fbe6a03 +Author: Kotresh HR +Date: Fri Oct 26 03:45:46 2018 -0400 + + geo-rep: Add more intelligence to automatic error handling + + Geo-rep's automatic error handling does gfid conflict + resolution. But if there are ENOENT errors because the + parent is not synced to slave, it doesn' handle them. + This patch adds the intelligence to create missing + parent directories on slave. It can create the missing + directories upto the depth of 10. + + fixes: bz#1643402 + Change-Id: Ic97ed1fa5899c087e404d559e04f7963ed7bb54c + Signed-off-by: Kotresh HR + +commit 5987b3388126a3c5e77481913cbaa4142117d19a +Author: Kotresh HR +Date: Mon Oct 29 18:23:17 2018 +0530 + + geo-rep/scripts: Fix traceback in gluster-mountbroker + + When 'gluster-mountbroker status' was issued, it + crashes in a corner case with 'str object has not + attribute get'. Fixed the same. + + fixes: bz#1643929 + Signed-off-by: Kotresh HR + Change-Id: Iaf1a937ed0136b3b2058230c75fa89a215d8a5eb + +commit 33e96100e17e9a293db6d63d9d5449d6c2d69376 +Author: Kotresh HR +Date: Mon Oct 29 17:55:28 2018 +0530 + + georep: python2 to python3 compat - scheduler + + 1. scheduler - Popen + 2. syncdutils - corner case on failure + + fixes: bz#1643932 + Change-Id: I65af97a244a8790e976acedc2728db6ebbf2ae10 + Signed-off-by: Kotresh HR + +commit 6cc573631df28eb357ffb006d1dbfe1bfd60aeba +Author: Mohit Agrawal +Date: Tue Oct 30 12:35:59 2018 +0530 + + core: Use GF_ATOMIC ops to update inode->nlookup + + fixes: bz#1644164 + + Change-Id: I0ac5aff565b3a30d5ff25ec5a3f20e0bda424a5d + Signed-off-by: Mohit Agrawal + +commit bae584148761ad98cd3d5c380f8cea1ff83aa8c3 +Author: Kotresh HR +Date: Mon Oct 29 18:08:28 2018 +0530 + + cliutils: python2 to python3 compat + + Make Popen py2 and py3 compatiable + + fixes: bz#1643935 + Change-Id: Ife34cb38024dcdc0420436e7d76fd208223f9d86 + Signed-off-by: Kotresh HR + +commit 0c835893fdce59872103253985d152f4592eea89 +Author: Shwetha Acharya +Date: Tue Oct 23 12:57:45 2018 +0530 + + rpc-transport/socket: NULL pointer dereferencing clang fix + + Problem: ctx and res can be NULL. + + Solution: introduced a VALIDATE_OR_GOTO statement, hence removed + the null check for ctx; added a check for res. + + Updates: bz#1622665 + + Change-Id: Ifee4c73e260530ab44c0a34c5ff5568f38f92c94 + Signed-off-by: Shwetha Acharya + +commit d7fa1a85b1d5213128ec1f58d1e22af2495b9a3e +Author: Harpreet Kaur Lalwani +Date: Thu Oct 25 18:48:22 2018 +0530 + + core: auth.ssl-allow has no option description + + Added a description for auth.ssl-allow + + Change-Id: I50cd7c738007c3d7a1b333dae62dbb5e46a7ee67 + fixes: bz#1643349 + Signed-off-by: Harpreet Kaur Lalwani + +commit 0857d837d0f9350c91f57e1096683b5abf973dcb +Author: Kaleb S. KEITHLEY +Date: Fri Oct 26 09:28:59 2018 -0400 + + build/packaging: el-X (x > 7) isms + + lvm2(-devel) 2.03.00 no longer has liblvm2app.so. (I expect a + similar change in fedora-30 before too much longer, but for + now fedora-30 still has lvm2 and lvm2-devel 2.02.181 + + rpcgen has been removed from glibc-common and unbundled rpcgen + is now required. + + And I guess nobody has ever built rpms with '--without bd' or we + would have discovered the attempted inclusion of .../storage/bd.so + in the rpm when it hadn't actually been built. + + Change-Id: I71e26c3d06af5d329ae89cc249a4ad88664ddf53 + updates: bz#1193929 + Signed-off-by: Kaleb S. KEITHLEY + +commit 0f817c7795f115fb67b0973ce0965bcd3de8d196 +Author: Amar Tumballi +Date: Fri Oct 12 22:23:17 2018 +0530 + + server-protocol: set the frame type to TYPE_FOP + + This will allow proper printing of exact 'fop' type to be logged in + string, not number, during backtraces. + + Considering this was not done on brick processes, we have no easy + way to glance and understand which fops were pending. + + What gets changed: + + After a crash, most of the core-dumps logged were of the form: + ``` + pending frames: + frame : type(0) op(18) + frame : type(0) op(18) + frame : type(0) op(28) + ``` + would change to + ``` + pending frames: + frame : type(1) op(SETXATTR) + frame : type(1) op(SETXATTR) + frame : type(1) op(READDIR) + ``` + + updates: bz#1639599 + Change-Id: I0e3d2a8dee9cfde7ed0112a948f5213f546efb80 + Signed-off-by: Amar Tumballi + +commit ff18121945bff394f3234e9f1a9d61ac97d4d493 +Author: Kotresh HR +Date: Thu Oct 25 03:23:56 2018 -0400 + + geo-rep: Fix issue in gfid-conflict-resolution + + Problem: + During gfid-conflict-resolution, geo-rep crashes + with 'ValueError: list.remove(x): x not in list' + + Cause and Analysis: + During gfid-conflict-resolution, the entry blob is + passed back to master along with additional + information to verify it's integrity. If everything + looks fine, the entry creation is ignored and is + deleted from the original list. But it is crashing + during removal of entry from the list saying entry + not in list. The reason is that the stat information + in the entry blob was modified and sent back to + master if present. + + Fix: + Send back the correct stat information for + gfid-conflict-resolution. + + fixes: bz#1642865 + Change-Id: I47a6aa60b2a495465aa9314eebcb4085f0b1c4fd + Signed-off-by: Kotresh HR + +commit 196a2258ac33b6369efbf8979d5246e203dddbf2 +Author: Milind Changire +Date: Thu Oct 25 13:05:13 2018 +0530 + + transport: log socket closures more verbose + + Problem: + Intentional and unintentional socket closures cannot be identified + + Solution: + Log intentional socket closures with at least INFO log level + + Change-Id: Ic02c882b16ab2193e57f8c3e6c3a82c4fe0f6875 + fixes: bz#1642800 + Signed-off-by: Milind Changire + +commit c66ea8566d18230ce20b55640b25a06f6f56ec7d +Author: Harpreet Lalwani +Date: Tue Oct 23 18:23:53 2018 +0530 + + posix: Null pointer dereferencing clang fix + + Added a check for "top" + + Updates: bz#1622665 + + Change-Id: I354fdc7150b2f1eb452702ddb653e2d6ed609c10 + Signed-off-by: Harpreet Lalwani + +commit bf5bfa5f2fcd1a73078c289aeac715bd82c366ed +Author: Amar Tumballi +Date: Thu Oct 25 19:48:37 2018 +0530 + + statedump: fix clang null dereference error + + ctx->active can be null, and is checked elsewhere in the + same function. In another case, where 'ctx->active' gets + dereferenced, it needs to be validated before the loop + is hit. + + Updates: bz#1622665 + Change-Id: I4ec917e96c0756586fc7a74c76848bb9589a0293 + Signed-off-by: Amar Tumballi + +commit ace454cf407753625acc2d4d090cb529bd13b183 +Author: root +Date: Thu Oct 25 05:47:23 2018 -0400 + + afr/lease: Read child nodes from lease structure + + For lease operation, we allocate and store child nodes + data in lease structure. Use the same in afr_lease_cbk() + while checking for the quorum. + + Change-Id: If1fdd5a0798888afd39ad3df57d96487baf9d1e6 + updates: #350 + Signed-off-by: Soumya Koduri + +commit 0e7929ef0272a95e5d24a23f15de3a0bb88a094c +Author: Milind Changire +Date: Thu Oct 25 14:03:07 2018 +0530 + + glusterd: raise default transport.listen-backlog + + Problem: + data center setups with large number of bricks with replication + causes a flood of connections from bricks and self-heal daemons + to glusterd causing connections to be dropped due to insufficient + listener socket backlog queue length + + Solution: + raise default value of transport.listen-backlog to 1024 + + Change-Id: I879e4161a88f1e30875046dff232499a8e2e6c51 + fixes: bz#1642850 + Signed-off-by: Milind Changire + +commit 053b1309dc8fbc05fcde5223e734da9f694cf5cc +Author: Ravishankar N +Date: Sun Sep 23 16:59:58 2018 +0530 + + afr: thin-arbiter 2 domain locking and in-memory state + + 2 domain locking + xattrop for write-txn failures: + -------------------------------------------------- + - A post-op wound on TA takes AFR_TA_DOM_NOTIFY range lock and + AFR_TA_DOM_MODIFY full lock, does xattrop on TA and releases + AFR_TA_DOM_MODIFY lock and stores in-memory which brick is bad. + + - All further write txn failures are handled based on this in-memory + value without querying the TA. + + - When shd heals the files, it does so by requesting full lock on + AFR_TA_DOM_NOTIFY domain. Client uses this as a cue (via upcall), + releases AFR_TA_DOM_NOTIFY range lock and invalidates its in-memory + notion of which brick is bad. The next write txn failure is wound on TA + to again update the in-memory state. + + - Any incomplete write txns before the AFR_TA_DOM_NOTIFY upcall release + request is got is completed before the lock is released. + + - Any write txns got after the release request are maintained in a ta_waitq. + + - After the release is complete, the ta_waitq elements are spliced to a + separate queue which is then processed one by one. + + - For fops that come in parallel when the in-memory bad brick is still + unknown, only one is wound to TA on wire. The other ones are maintained + in a ta_onwireq which is then processed after we get the response from + TA. + + Change-Id: I32c7b61a61776663601ab0040e2f0767eca1fd64 + updates: bz#1579788 + Signed-off-by: Ravishankar N + Signed-off-by: Ashish Pandey + +commit aae1c402b74fd02ed2f6473b896f108d82aef8e3 +Author: Sanju Rakonde +Date: Wed Oct 3 23:58:37 2018 +0530 + + glusterd: ensure volinfo->caps is set to correct value. + + With the commit febf5ed4848, during the volume create op, + we are setting volinfo->caps to 0, only if any of the bricks + belong to the same node and brickinfo->vg[0] is null. + Previously, we used to set volinfo->caps to 0, when + either brick doesn't belong to the same node or brickinfo->vg[0] + is null. + + With this patch, we set volinfo->caps to 0, when either brick + doesn't belong to the same node or brickinfo->vg[0] is null. + (as we do earlier without commit febf5ed4848). + + fixes: bz#1635820 + Change-Id: I00a97415786b775fb088ac45566ad52b402f1a49 + Signed-off-by: Sanju Rakonde + +commit c5d285b173f253be19458a6ba4470671978ab698 +Author: Sunny Kumar +Date: Wed Oct 24 15:23:34 2018 +0530 + + posix : fix coverity issues in posix-inode-fd-ops.c + + This patch fixes CID: 1356526 and 1382369 : Argument cannot be negative + + Change-Id: I1aab5be2d217479db9f67a26b62854a0b38c1747 + updates: bz#789278 + Signed-off-by: Sunny Kumar + +commit 0ca6773eaf5aeb507ebc72d2c2f61902eeff414c +Author: Sanju Rakonde +Date: Mon Oct 8 19:33:58 2018 +0530 + + tests: correction in tests/bugs/glusterd/optimized-basic-testcases-in-cluster.t + + Patch https://review.gluster.org/#/c/glusterfs/+/19135/ has + optimised glusterd test cases by clubbing the similar test + cases into a single test case. + + https://review.gluster.org/#/c/glusterfs/+/19135/15/tests/bugs/glusterd/bug-1293414-import-brickinfo-uuid.t + test case has been deleted and added as a part of + tests/bugs/glusterd/optimized-basic-testcases-in-cluster.t + + In the original test case, we create a volume with two bricks, + each on a separate node(N1 & N2). From another node in cluster(N3), + we try to detach a node which is hosting bricks. It fails. + + In the new test, we created volume with single brick on N1. + and from another node in cluster, we tried to detach N1. we + expect peer detach to fail, but peer detach was success as + the node is hosting all the bricks of volume. + + Now, changing the new test case to cover the original test case scenario. + + Please refer https://bugzilla.redhat.com/show_bug.cgi?id=1642597#c1 to + understand why the new test case is not failing in centos-regression. + + fixes: bz#1642597 + + Change-Id: Ifda12b5677143095f263fbb97a6808573f513234 + Signed-off-by: Sanju Rakonde + +commit 06bad119b8c773a34cd2942d665112fbf7799788 +Author: Sheetal Pamecha +Date: Tue Oct 9 11:34:08 2018 +0530 + + features/namespace: NULL pointer deferencing clang fix + + Removed VALIDATE_OR_GOTO check on "this" + + Updates: bz#1622665 + + Change-Id: Ie0d74525901ebf9daa1a5e788a035db6dc5d8c06 + Signed-off-by: Sheetal Pamecha + +commit 8d2a684ba102c5b2f558ac9bee819500da94421e +Author: Sunny Kumar +Date: Wed Oct 24 18:09:09 2018 +0530 + + geo-rep : fix high sev coverity isuue + + This patch fixes CID: 1382374: USE_AFTER_FREE. + + Change-Id: If408f52ee291312fb83095126ebd6bb79ae95e26 + updates: bz#789278 + Signed-off-by: Sunny Kumar + +commit ee1982b083c06ddaebfc4b6da8a0827f3b7c24a9 +Author: Sunny Kumar +Date: Tue Oct 16 14:06:10 2018 +0530 + + shard : fix coverity issue in shard.c + + This patch fixes CID: + 1394664 : CHECKED_RETURN + 1356534 : Macro compares unsigned to 0 (NO_EFFECT) + 1356532 : Macro compares unsigned to 0 (NO_EFFECT) + + updates: bz#789278 + + Change-Id: I04d64fd8c007627611710dc56109b76eeb59333a + Signed-off-by: Sunny Kumar + +commit e15a5a5cc67fa3323722353bb4ccca0ea41aa594 +Author: Sunil Kumar Acharya +Date: Wed Oct 24 18:11:13 2018 +0530 + + cluster/ec : Prevent volume create without redundant brick + + Problem: + EC volumes can be created without any redundant brick. + + Solution: + Updated the conditional check to avoid volume create without + redundant brick. + + fixes: bz#1642448 + Change-Id: I0cb334b1b9378d67fcb8abf793dbe312c3179c0b + Signed-off-by: Sunil Kumar Acharya + +commit 87613d265a1a394d785daeed569b384cd74c6574 +Author: Han Han +Date: Mon Oct 15 09:53:06 2018 +0800 + + mount.glusterfs: A more explicit check to avoid identical mounts + + Change check condition from + "[[:space:]+]${mount_point}[[:space:]+]fuse" to + "[[:space:]+]${mount_point}[[:space:]+]fuse.glusterfs". Fix false + postive check result for mount points of other FUSEes, such as "fuse.sshfs". + + Change-Id: I13898b50a651a8f5ecc3a94d01b3b5de37ec4cbc + fixes: bz#1640026 + Signed-off-by: Han Han + +commit cf5b13896d65b6916634976a3a5f61ddeefbc19c +Author: Soumya Koduri +Date: Mon Oct 22 21:16:53 2018 +0530 + + leases:Mark the fop conflicting if lease_id not set + + Glusterfs leases expects lease_id to be set and sent + for each fop to determine conflict resolution with the + existing lease. + Incase if not set (most likely if there is an older + client in a mixed cluster), it makes sense to consider + it as conflicitng fop and recall the lease. + + Also fixed the return status check for __remove_lease(), + wherein non-negative value is considered as success case. + + Change-Id: I5bcfba4f7c71a5af7cdedeb03436d0b818e85783 + updates: #350 + Signed-off-by: Soumya Koduri + +commit 63a8d72736aec13ae90eb1a425ffd2078e5236ad +Author: Arjun +Date: Mon Oct 22 13:08:53 2018 +0530 + + src/glusterd-snapshot-utils.c: dereferencing the snap_vol before freeing it + + The patch fixes CID: 1325520 + + Change-Id: Ic7d3fac6adabe96d1d44f13b57d6dc67da0476d1 + updates: bz#789278 + Signed-off-by: Arjun + +commit c34e4161f3cb6539ec83a9020f3d27eb4759a975 +Author: Mohit Agrawal +Date: Thu Oct 18 14:06:04 2018 +0530 + + glusterfs: During reconfigure set log-level per xlator level + + Problem: In brick_mux environment, while a user has enabled brick-log-level + for anyone volume, it automatically enables for other volumes + also those are attached with same brick. + + Solution: A log-level option is automatically enabled for other volumes + because log-level saved in glusterfsd_ctx and ctx is common for + volumes those are attached with same brick. To resolve it + set log level for all children xlator's at the time of the graph + reconfigure at io-stat xlator. + + Change-Id: Id9a6efa05d286e0bea2d47f49292d084e7bb2fcf + fixes: bz#1640495 + Signed-off-by: Mohit Agrawal + +commit 1be6703b1005bf572cea70f2254d7b5a8ed02351 +Author: Sanju Rakonde +Date: Sun Oct 7 17:44:19 2018 +0530 + + glusterd: set integer instead of string + + dict_get_str_boolean expects a integer, so we need + to set all the boolean variables as integers to + avoid log messages like below: + + [2018-09-10 03:55:19.236387] I [dict.c:2838:dict_get_str_boolean] (-->/usr/local/lib/libgfrpc.so.0(rpc_clnt_reconnect+0xc2) [0x7ff7a83d0452] -->/usr/local/lib/glusterfs/4.2dev/rpc-transport/socket.so(+0x65b0) [0x7ff7a06cf5b0] -->/usr/local/lib/libglusterfs.so.0(dict_get_str_boolean+0xcf) [0x7ff7a85fc58f] ) 0-dict: key transport.socket.ignore-enoent, integer type asked, has string type [Invalid argument] + + This patch addresses all such instances in glusterd. + + Change-Id: I7e1979fcf381363943f4d09b94c3901c403727da + updates: bz#1193929 + Signed-off-by: Sanju Rakonde + +commit 68299b244372b1668c1708bff15a239649226dee +Author: Kotresh HR +Date: Sun Oct 14 19:54:48 2018 +0530 + + cli: Fix heap-buffer-overflow issue reported by ASAN + + GF_MALLOC was being used to allocate memory which is + not initialized. strcat is used on it which could + result in buffer overflow if it contains garbage before + '\0'. So changed it to GF_CALLOC. + + Traceback: + + ==23427==ERROR: AddressSanitizer: heap-buffer-overflow ... + WRITE of size 5 at 0x6080000083fe thread T3 + #0 0x7fb60966991c in __interceptor_strcat ... + #1 0x48adc0 in config_parse ... + #2 0x48cde8 in cli_cmd_gsync_set_parse ... + ... + + Updates: bz#1633930 + Change-Id: I3710f011d8139984b1898265d84d150c9bdc962b + Signed-off-by: Kotresh HR + +commit f73b4476b15f9d6d3dc3c8e20c9742aacd857f9f +Author: Ashish Pandey +Date: Thu Oct 18 17:15:58 2018 +0530 + + cluster/afr : Check for UP bricks before starting heal + + Problem: + Currently for replica volume, even if only one brick is UP + SHD will keep crawling index entries even if it can not + heal anything. + + In thin-arbiter volume which is also a replica 2 volume, + this causes inode lock contention which in turn sends + upcall to all the clients to release notify locks, even + if it can not do anything for healing. + + This will slow down the client performance and kills the + purpose of keeping in memory information about bad brick. + + Solution: Before starting heal or even crawling, check if + sufficient number of children are UP and available to check + and heal entries. + + Change-Id: I011c9da3b37cae275f791affd56b8f1c1ac9255d + updates: bz#1640581 + Signed-off-by: Ashish Pandey + +commit bd4d8b182662e08cccc57efa1616651df448b445 +Author: Sanju Rakonde +Date: Tue Oct 23 11:50:37 2018 +0530 + + glusterd: improve logging for stage_deleted flag + + Change-Id: I5f0667a47ddd24cb00949c875c19f3d1dbd8d603 + fixes: bz#1605077 + Signed-off-by: Sanju Rakonde + +commit 874ce6ef6e33f1493c888760714503ac992b708d +Author: Harpreet Lalwani +Date: Mon Oct 8 15:58:17 2018 +0530 + + rpc/rpc-lib: Uninitialized argument value of a function + + trav->saved_at.tv_sec is not initialized. + + Calling "list_empty" function before initializing "trav". + + Updates: bz#1622665 + + Change-Id: Ib5c2703a07a9c56ccd115001aca500f7a23c4a2e + Signed-off-by: Harpreet Lalwani + +commit 4634bb05cc82526e5c55e60746ae5d167f28bea0 +Author: Kinglong Mee +Date: Sat Sep 29 11:02:58 2018 +0800 + + md-cache: request cached xattrs at stat/fstat + + Ganesha always operate file by filehandle, and translates to + glusterfs's stat/fstat many time. + + Change-Id: Idd0dc33c31131331ac948754c8b7f898777c31d3 + Updates: bz#1634220 + Signed-off-by: Kinglong Mee + +commit 3dea105556130abd4da0fd3f8f2c523ac52398d1 +Author: Ravishankar N +Date: Sun Oct 21 17:32:52 2018 +0530 + + tests: check for shd up status in bug-1637802-arbiter-stale-data-heal-lock.t + + Problem: + https://review.gluster.org/#/c/glusterfs/+/21427/ seems to be failing + this .t spuriously. On checking one of the failure logs, I see: + + 22:05:44 Launching heal operation to perform index self heal on volume patchy has been unsuccessful: + 22:05:44 Self-heal daemon is not running. Check self-heal daemon log file. + 22:05:44 not ok 20 , LINENUM:38 + + In glusterd log: + [2018-10-18 22:05:44.298832] E [MSGID: 106301] [glusterd-syncop.c:1352:gd_stage_op_phase] 0-management: Staging of operation 'Volume Heal' failed on localhost : Self-heal daemon is not running. Check self-heal daemon log file + + But the tests which preceed this check whether via a statedump if the shd is + conected to the bricks, and they have succeeded and even started + healing. From glustershd.log: + + [2018-10-18 22:05:40.975268] I [MSGID: 108026] [afr-self-heal-common.c:1732:afr_log_selfheal] 0-patchy-replicate-0: Completed data selfheal on 3b83d2dd-4cf2-4ea3-a33e-4275be40f440. sources=[0] 1 sinks=2 + + So the only reason I can see launching heal via cli failing is a race where + shd has been spawned but glusterd has not yet updated in-memory that it is up, + and hence failing the CLI. + + Fix: + Check for shd up status before launching heal via CLI + + Change-Id: Ic88abf14ad3d51c89cb438db601fae4df179e8f4 + fixes: bz#1641344 + Signed-off-by: Ravishankar N + +commit 9eab065769d4b4fd41821232746fb8f1235bead4 +Author: Kinglong Mee +Date: Sat Sep 29 11:58:42 2018 +0800 + + posix: fill glusterfs.posix.* acl xattrs at dict + + Change-Id: I0730a037f96c4386c72ecf2f61c71ec17ffbc1b0 + Updates: bz#1634220 + Signed-off-by: Kinglong Mee + +commit 826e03db0903abab852bda37d6d77f3dd0f83cc6 +Author: Kinglong Mee +Date: Thu Oct 18 19:35:40 2018 +0800 + + md-cache: fix dict leak of cached xattr + + Change-Id: I52f8e13e68528ba9679537ffdddf58ec08f9fd0c + Updates: bz#1634220 + Signed-off-by: Kinglong Mee + +commit 92c22abb440ba8f8025441b16f3811b05927a16d +Author: Bhumika Goyal +Date: Thu Oct 18 17:30:09 2018 +0530 + + xlators: some high severity coverity fixes + + Fixes: 124759 1288787 + + Change-Id: Ib8999242fc3ea5f4ea80246659899d2d4f06c506 + updates: bz#789278 + Signed-off-by: Bhumika Goyal + +commit ac9976f0c52306f4f2d9b11dcf6a830d1ec2e445 +Author: Varsha Rao +Date: Thu Oct 18 12:03:37 2018 +0530 + + performance/write-behind: Fix NULL dereference issue + + This patches fixes the following coverity issues: + CID: 1396101, 1396102 - Dereference null return value. + + Change-Id: I7ec783a61c06a1378863e974ff6e0baae418aec2 + updates: bz#789278 + Signed-off-by: Varsha Rao + +commit e1a9c23b83b8d46bf44a7a9952da0c61c8a46c79 +Author: Arjun Sharma +Date: Mon Oct 15 17:37:36 2018 +0530 + + protocol/server: added check for positve value in server-handshake.c + + This patch fixes CID 1124651 + + Change-Id: I6f33954f08cfdd7cb4236f9a81ec7980f81d19e7 + updates: bz#789278 + Signed-off-by: Arjun + +commit c5f5ce2a9b1c085209cae21a7e1df5f60bc1a7da +Author: Bhumika Goyal +Date: Thu Oct 18 14:15:40 2018 +0530 + + rdma: coverity fixes + + Fixes CID: 1382442 1382415 1382379 1382355 + + Change-Id: Ia712e37cb5a6db452d3178386394f87f83b85d38 + updates: bz#789278 + Signed-off-by: Bhumika Goyal + +commit 59629f1da9dca670d5dcc6425f7f89b3e96b46bf +Author: Raghavendra Gowdappa +Date: Thu Oct 18 18:25:46 2018 +0530 + + mount/fuse: return ESTALE instead of ENOENT on all inode based operations + + This patch is continuation of commit + fb4b914ce84bc83a5f418719c5ba7c25689a9251. This patch extends that + logic to all inode based operations and not just open(dir). + + + + mount/fuse: never fail open(dir) with ENOENT + + open(dir) being an operation on inode should never fail with + ENOENT. If gfid is not present, the appropriate error is ESTALE. This + will enable kernel to retry open after a revalidate lookup. + + + + Change-Id: I6313f520827e9af725485631cb6a9d9718243bc4 + Signed-off-by: Raghavendra G + Fixes: bz#1627620 + +commit 0819a9af02cc76b5549c822d5c088e2c740a60d7 +Author: Sheetal Pamecha +Date: Tue Sep 25 16:58:24 2018 +0530 + + cluster/ec: NULL pointer deferencing clang fix + + Removing VALIDATE_OR_GOTO check on "this" + + Updates: bz#1622665 + + Change-Id: Ic7cffbb697da814f835d0ad46e25256da6afb406 + Signed-off-by: Sheetal Pamecha + +commit 15c99765e0597b835d92560fc926067313848c88 +Author: Krutika Dhananjay +Date: Wed Oct 17 14:26:14 2018 +0530 + + storage/posix: Do not fail entry creation fops if gfid handle already exists + + PROBLEM: + tests/bugs/shard/bug-1251824.t fails occasionally with EIO due to gfid + mismatch across replicas on the same shard when dd is executed. + + CAUSE: + Turns out this is due to a race between posix_mknod() and posix_lookup(). + + posix mknod does 3 operations, among other things: + 1. creation of the entry itself under its parent directory + 2. setting the gfid xattr on the file, and + 3. creating the gfid link under .glusterfs. + + Consider a case where the thread doing posix_mknod() (initiated by shard) + has executed steps 1 and 2 and is on its way to executing 3. And a + parallel LOOKUP from another thread on noting that loc->inode->gfid is NULL, + tries to perform gfid_heal where it attempts to create the gfid link + under .glusterfs and succeeds. As a result, posix_gfid_set() through + MKNOD (step 3) fails with EEXIST. + + In the older code, MKNOD under such conditions was NOT being treated + as a failure. But commit e37ee6d changes this behavior by failing MKNOD, + causing the entry creation to be undone in posix_mknod() (it's another + matter that the stale gfid handle gets left behind if lookup has gone + ahead and gfid-healed it). + All of this happens on only one replica while on the other MKNOD succeeds. + + Now if a parallel write causes shard translator to send another MKNOD + of the same shard (shortly after AFR releases entrylk from the first + MKNOD), the file is created on the other replica too, although with a + new gfid (since "gfid-req" that is passed now is a new UUID. This leads + to a gfid-mismatch across the replicas. + + FIX: + The solution is to not fail MKNOD (or any other entry fop for that matter + that does posix_gfid_set()) if the .glusterfs link creation fails with EEXIST. + + Change-Id: I84a5e54d214b6c47ed85671a880bb1c767a29f4d + fixes: bz#1638453 + Signed-off-by: Krutika Dhananjay + +commit 273c895747d073d43a1e8617218d4bfd2cf13f18 +Author: Mohit Agrawal +Date: Wed Oct 17 13:08:59 2018 +0530 + + ctr: fix coverity issue in changetimerecorder.c + + This patch fixes CID: + 1396179: Read from pointer after free + 1396178: Use after free + + Change-Id: I47a2e4aa257e0c4dbdf2e1fd2e0748902764463f + fixes: bz#789278 + Signed-off-by: Mohit Agrawal + +commit 145e180517054626d07892219fdee689b703c218 +Author: Sunny Kumar +Date: Wed Oct 17 15:40:04 2018 +0530 + + shard : fix newly introduced coverity + + This patch fixes CID: 1396177: NULL dereference. + + updates: bz#789278 + + Change-Id: Ic5d302a5e32d375acf8adc412763ab94e6dabc3d + Signed-off-by: Sunny Kumar + +commit 219cd649fdbd7bfd6c2268a0a4f66bcc15918e31 +Author: N Balachandran +Date: Wed Oct 17 18:48:19 2018 +0530 + + debug/io-stats: io stats filenames contain garbage + + As dict_unserialize does not null terminate the value, + using snprintf adds garbage characters to the buffer + used to create the filename. + The code also used this->name in the filename which + will be the same for all bricks for a volume. The + files were thus overwritten if a node contained + multiple bricks for a volume. The code now uses + the conf->unique instead if available. + + Change-Id: I2c72534b32634b87961d3b3f7d53c5f2ca2c068c + fixes: bz#1640165 + Signed-off-by: N Balachandran + +commit 6257276d9de3f15643f159b2ec627a67c84fc23d +Author: Raghavendra Gowdappa +Date: Fri Oct 12 10:31:04 2018 +0530 + + api: fill out attribute information if not valid + + translators like readdir-ahead selectively retain entry information of + iatt (gfid and type) when rest of the iatt is invalidated (for write + invalidating ia_size, (m)(c)times etc). Fuse-bridge uses this + information and sends only entry information in readdirplus + response. However such option doesn't exist in gfapi. This patch + modifies gfapi to populate the stat by forcing an extra lookup. + + Thanks to Shyamsundar Ranganathan and Prashanth + Pai for tests. + + Change-Id: Ieb5f8fc76359c327627b7d8420aaf20810e53000 + Fixes: bz#1630804 + Signed-off-by: Raghavendra Gowdappa + Signed-off-by: Soumya Koduri + +commit 24dbcfb6ebaab021e2db4f63bd66f3b06192bc89 +Author: Kinglong Mee +Date: Sat Sep 29 12:10:46 2018 +0800 + + posix: return more xattrs at getxattr/fgetxattr when client request + + Change-Id: I37ac6186b3631979d2503d1b185a61b8094dbd0d + Updates: bz#1634220 + Signed-off-by: Kinglong Mee + +commit 573253d250972dad60ec28cd101f9facd82a0fe2 +Author: Sunny Kumar +Date: Tue Oct 16 16:45:34 2018 +0530 + + nfs : fix coverity issue in nfs3.c + + This patch fixes CID 1274073. + + updates: bz#789278 + + Change-Id: I34146bfdfe19bae4592062e710a89ab07b2c5c07 + Signed-off-by: Sunny Kumar + +commit a9c232319f28376f88ac624ac132413ec408b784 +Author: Sunny Kumar +Date: Tue Oct 16 14:48:00 2018 +0530 + + trash : fix high sev coverity issue in trash.c + + This patch fixes CID 1288790: RESOURCE_LEAK. + + updates: bz#789278 + + Change-Id: I34bb410f1d3027e2d4c21044e87e319360344e04 + Signed-off-by: Sunny Kumar + +commit 0402a13914084219db3a6f6867117b8757112b24 +Author: Amar Tumballi +Date: Mon Oct 8 19:22:53 2018 +0530 + + glusterfsd: fix the asan leak message + + Fixes below trace of ASan: + + Direct leak of 130 byte(s) in 1 object(s) allocated from: + #0 0x7fa794bb5850 in malloc (/lib64/libasan.so.4+0xde850) + #1 0x7fa7944e5de9 in __gf_malloc ../../../libglusterfs/src/mem-pool.c:136 + #2 0x40b85c in gf_strndup ../../../libglusterfs/src/mem-pool.h:166 + #3 0x40b85c in gf_strdup ../../../libglusterfs/src/mem-pool.h:183 + #4 0x40b85c in parse_opts ../../../glusterfsd/src/glusterfsd.c:1049 + #5 0x7fa792a98720 in argp_parse (/lib64/libc.so.6+0x101720) + #6 0x40d89f in parse_cmdline ../../../glusterfsd/src/glusterfsd.c:2041 + #7 0x406d07 in main ../../../glusterfsd/src/glusterfsd.c:2625 + + + updates: bz#1633930 + Change-Id: I394b3fc24b7a994c1b03635cb5e973e7290491d3 + Signed-off-by: Amar Tumballi + +commit 46689e34b920147cb7222d166e7b85ef8f105b60 +Author: Yaniv Kaul +Date: Sun Oct 14 02:15:40 2018 +0300 + + servers-helpers.c: reduce clang warnings on dead initialization. + + Assign a value to a parameter on its definition. + Removes tens of clang warnings. + + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: I828bacb4033111af6162772a554cc5c6b2820169 + +commit 39a1db1402bea36cb5727a5041440f10bf4660e9 +Author: ShyamsundarR +Date: Mon Oct 15 20:45:18 2018 -0400 + + coverity: ignore tainted access reported in gf_free + + Coverity reports tainted pointer access in _gf_free if the pointer passed in + was used by any IO related function by the caller. The taint within gf_free + is a false positive, as the tainted region is from the passed in pointer + till its allocated lenght, and not for contents before the pointer (i.e + the GF_MEM_HEADER_SIZE bytes before the passed in pointer), as that is + exclusively handled by the gf_alloc family of functions. + + CID: 1228602, 1292646, 1292647, 1292648, 1292649, 1383192, 1383195, 1389691 + + Should additionally fix, + CID: 1292650, 1292651, 1357874, 1382373, 1382404, 1382407 + + Change-Id: I48c5a4028e7b0224c432bbc30f8c29408c2a466b + Updates: bz#789278 + Signed-off-by: ShyamsundarR + +commit f179d09326c519abb1868de79598719b93219544 +Author: ShyamsundarR +Date: Mon Oct 15 20:50:26 2018 -0400 + + glusterfsd: Fix coverity issues around unused values + + This patch fixes, + CID: 1274064, 1274232 + + The fix is to not add into the return dict the throughput + and time values on error computing the same. The pattern + applied is the same as when an error occurs during adding + either the throughput or the time value to the dict. + + Change-Id: I33e21e75efbc691f18b818934ef3bf70dd075097 + Updates: bz#789278 + Signed-off-by: ShyamsundarR + +commit f50625e7b08814e8e1d06a733e9b3516e9cea5e2 +Author: Kinglong Mee +Date: Tue Oct 9 15:57:31 2018 +0800 + + libgfapi: Send path with "." for the root when loc.parent is set + + fixes: bz#1582516 + Change-Id: Ia9649d7c3c0930dfec656d364cf6e9a98c774dd2 + Signed-off-by: Kinglong Mee + +commit a303cd1acc3c9ff475fe5ece643de4cbea1c1a51 +Author: Soumya Koduri +Date: Wed Oct 10 21:37:07 2018 +0530 + + gfapi: Bug fixes in leases processing code-path + + This patch fixes below issues in gfapi lease code-path + * 'glfs_setfsleasid' should allow NULL input to be + able to reset leaseid + * Applications should be allowed to (un)register for + upcall notifications of type GLFS_EVENT_LEASE_RECALL + * APIs added to read contents of GLFS_EVENT_LEASE_RECALL + argument which is of type "struct glfs_upcall_lease" + + Change-Id: I3320ddf235cc82fad561e13b9457ebd64db6c76b + updates: #350 + Signed-off-by: Soumya Koduri + +commit 593bbb28d95d1ebf11aa6f4d1f256529ed2dba88 +Author: Milind Changire +Date: Sat Oct 13 10:15:42 2018 +0530 + + libglusterfs: fix sys_socket coverity issue + + CID 1396081: Control flow issues (UNREACHABLE) + + Change-Id: Ifad303853224cb9abc91c1083bb1529f4c13b1d3 + updates: bz#789278 + Signed-off-by: Milind Changire + +commit 98f68cf115a30a101d3be2252ecbe1391720ed88 +Author: Yaniv Kaul +Date: Sat Oct 13 00:56:42 2018 +0300 + + Multiple xlators: perform gettimeofday() not under lock + + While it may slightly reduce accuracy, I think it's better to + acquire the time outside a lock and then memcpy the value while + under lock. + + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: Ic8fb94a56c4fa2d3b13e59767e13646fb39342ba + +commit fd70a7d790710da01a8ddd56785a28ab54e07550 +Author: Sunny Kumar +Date: Wed Oct 10 01:25:41 2018 +0530 + + mount : fix high sev coverity issues in mount3.c + + This patch fixes CID 1395067, 1388767 and 1395068. + + updates: bz#789278 + + Change-Id: Ie92252281bf559dd29fab462e121445ff4d3b865 + Signed-off-by: Sunny Kumar + +commit 386f1d7926e4497fc2a905367ade2e3f6972eba7 +Author: Raghavendra Gowdappa +Date: Thu Oct 11 16:22:28 2018 +0530 + + cluster/dht: fixes to unlinking invalid linkto file + + If unlinking of an invalid linkto file failed in lookup-everywhere + codepath, lookup was failed with EIO. The rational as per the comment + was, + + + + /* When dht_lookup_everywhere is performed, one cached + *and one hashed file was found and hashed file does + *not point to the above mentioned cached node. So it + *was considered as stale and an unlink was performed. + *But unlink fails. So may be rebalance is in progress. + *now ideally we have two data-files. One obtained during + *lookup_everywhere and one where unlink-failed. So + *at this point in time we cannot decide which one to + *choose because there are chances of first cached + *file is truncated after rebalance and if it is chosen + *as cached node, application will fail. So return EIO. + */ + + + + However, this reasoning is only valid when + * op_errno is EBUSY, indicating rebalance is in progress + * op_errno is ENOTCONN as wecannot determine what was the status of + file on brick. + + Hence this patch doesn't fail lookup unless unlink fails with an + either EBUSY or ENOTCONN + + Change-Id: Ife55f3d97fe557f3db05beae0c2d786df31e8e55 + Fixes: bz#1635145 + Signed-off-by: Raghavendra Gowdappa + +commit 7152ace0b3586289be068f09e2c20cf0a8d2d166 +Author: Kaleb S. KEITHLEY +Date: Mon Oct 15 08:26:32 2018 -0400 + + core: libuuid-devel breakage + + The #include "uuid.h" left over from using .../contrib/uuid is debatably + incorrect now that we use the "system header" file /usr/include/uuid/uuid.h + from libuuid-devel. + + Unfortunately this is complicated by things like FreeBSD having its own + /usr/include/uuid.h, and the e2fsprogs-libuuid uuid.h in installed - as + most third-party packages in FreeBSD are - in /usr/local as + /usr/local/include/uuid/uuid.h + + With a system header file it should at least be #include , and + even better as #include , much like the way + and are included. Using #include guarantees + not getting the /usr/include/uuid.h on FreeBSD, but clang/cc knows to + find "system" header files like this in /usr/local/include; with or + without the -I/... from uuid.pc. Also using #include "uuid.h" leaves + the compiler free to find a uuid.h from any -I option it might be passed. + (Fortunately we don't have any at this time.) + + As we now require libuuid-devel or e2fsprogs-libuuid and configure will + exit with an error if the uuid.pc file doesn't exist, the HAVE_LIBUUID + (including the #elif FreeBSD) tests in compat-uuid.h are redundant. We + are guaranteed to have it, so testing for it is a bit silly IMO. It may + also break building third party configure scripts if they omit defining + it. (Just how hard do we want to make things for third party developers?) + + Change-Id: I7317f63c806281a5d27de7d3b2208d86965545e1 + updates: bz#1193929 + Signed-off-by: Kaleb S. KEITHLEY + +commit e627977617dd765f6b58a70882c6acda6c6aab6e +Author: Krutika Dhananjay +Date: Fri Oct 5 11:32:21 2018 +0530 + + features/shard: Hold a ref on base inode when adding a shard to lru list + + In __shard_update_shards_inode_list(), previously shard translator + was not holding a ref on the base inode whenever a shard was added to + the lru list. But if the base shard is forgotten and destroyed either + by fuse due to memory pressure or due to the file being deleted at some + point by a different client with this client still containing stale + shards in its lru list, the client would crash at the time of locking + lru_base_inode->lock owing to illegal memory access. + + So now the base shard is ref'd into the inode ctx of every shard that + is added to lru list until it gets lru'd out. + + The patch also handles the case where none of the shards associated + with a file that is about to be deleted are part of the LRU list and + where an unlink at the beginning of the operation destroys the base + inode (because there are no refkeepers) and hence all of the shards + that are about to be deleted will be resolved without the existence + of a base shard in-memory. This, if not handled properly, could lead + to a crash. + + Change-Id: Ic15ca41444dd04684a9458bd4a526b1d3e160499 + updates: bz#1605056 + Signed-off-by: Krutika Dhananjay + +commit 76cc1ea613e038ced4bc6ae26233cb0681b63be5 +Author: Pranith Kumar K +Date: Fri Sep 28 13:03:38 2018 +0530 + + libglusterfs/dict: Add sizeof()-1 variants of dict functions + + One needs to be very careful about giving same key for the key and + SLEN(key) arguments in dict_xxxn() functions. Writing macros that + would take care of passing the SLEN(key) would help reduce this + burden on the developer and reviewer. + + updates: bz#1193929 + Change-Id: I312c479b919826570b47ae2c219c53e2f9b2ddef + Signed-off-by: Pranith Kumar K + +commit c962e2cbd73e78f31e690f7b1f8456616006c543 +Author: Kotresh HR +Date: Fri Oct 12 14:25:00 2018 +0530 + + glusterd/geo-rep: Fix memory corruption + + Problem and Analysis: + The length of canonical format of uuid is 36 but + 'GF_UUID_BUF_SIZE 50' was being used everywhere. + glusterd/geo-rep code was earlier using strncpy, + but recently changes to memcpy with the drive + to avoid strncpys. This leads to memory corruption + and glusterd is crashing without a core with geo-rep + creation with ASAN build. + + Fix: + 'GF_UUID_BUF_SIZE 37' (+ 1 for NULL byte) + And change geo-rep to use UUID_CANONICAL_FORM_LEN + instead + + Updates: bz#1633930 + Change-Id: Ibd347d542b92e64a96ce06780cda643557233bc7 + Signed-off-by: Kotresh HR + +commit ac074e03437faf6f2f0897e6d9e7249ac0599b64 +Author: Kotresh HR +Date: Thu Oct 11 23:39:13 2018 +0530 + + cli: Fix memory leaks reported by ASAN + + This patch addresses memory leaks other than + 'gf_cli_rsp' response structure. + + Updates: bz#1633930 + Change-Id: Idc5940dca623e33bc01004a9324bc435fc60b006 + Signed-off-by: Kotresh HR + +commit f6789462610ab5bae029cb114fa27453a54c8f9c +Author: Sunny Kumar +Date: Thu Oct 11 12:20:10 2018 +0530 + + libglusterfs : fix newly introduced coverity defect + + CID: 1396060 + updates: bz#789278 - In a normal setup, this is executed on slave node and hence - doing it recursively is not an issue on [1]. But when original - master becomes slave in non-root during FO/FB, it contains - ssh public keys and modifying permissions on them causes - geo-rep to fail with incorrect permissions. + Change-Id: Ia25aa9a4ca7505e747aa92bb3ae81415da7d19d1 + Signed-off-by: Sunny Kumar + +commit 7bf95631b52bd05b06122180f8bd4aa62c70b1a9 +Author: Mohit Agrawal +Date: Wed Oct 10 10:31:18 2018 +0530 + + core: glusterfsd keeping fd open in index xlator - Fix: - Don't do permission change recursively. Fix permissions for - required files. + Problem: At the time of processing GF_EVENT_PARENT_DOWN + at brick xlator, it forwards the event to next xlator + only while xlator ensures no stub is in progress. + At io-thread xlator it decreases stub_cnt before the process + a stub and notify EVENT to next xlator - Backport of: - > Patch: https://review.gluster.org/#/c/glusterfs/+/21689/ - > BUG: bz#1651498 - > Change-Id: I68a744644842e3b00abc26c95c06f123aa78361d - > Signed-off-by: Kotresh HR - (cherry picked from commit b2776b1ec1ad845ba568c4439bca3b57cc4d2592) + Solution: Introduce a new counter to save stub_cnt and decrease + the counter after process the stub completely at io-thread + xlator. + To avoid brick crash at the time of call xlator_mem_cleanup + move only brick xlator if detach brick name has found in + the graph + Note: Thanks to pranith for sharing a simple reproducer to + reproduce the same - fixes: bz#1654117 - Change-Id: I68a744644842e3b00abc26c95c06f123aa78361d + fixes bz#1637934 + Change-Id: I1a694a001f7a5417e8771e3adf92c518969b6baa + Signed-off-by: Mohit Agrawal + +commit 777412c5e8a1e8613061fef31bd8a60d4cd54b6e +Author: Sheetal Pamecha +Date: Thu Oct 11 04:00:08 2018 +0530 + + libglusterfs: fix log message in options.c + + This patch fixes https://github.com/gluster/glusterfs/issues/519 + + Credits: "Fabian Wannenmacher <@wanneut>" + + Updates: bz#1193929 + + Change-Id: If8d60c3379093a868ad6ba8c2ad86a4b99d35f2c + Signed-off-by: Sheetal Pamecha + +commit 09baa5d7fb91d1f50976807f1da0f7bbf177fa00 +Author: Ashish Pandey +Date: Thu Oct 11 12:12:38 2018 +0530 + + features/locks: Fix Coverity issues + + CID: + 1395812 Explicit null dereferenced + 1356542 Dereference null return value + + https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=86261835&defectInstanceId=26407100&mergedDefectId=1395812 + https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=86261835&defectInstanceId=26407215&mergedDefectId=1356542 + + Change-Id: I2c20972a8080fa7a70b88eab0688b9cf734bbf24 + updates: bz#789278 + Signed-off-by: Ashish Pandey + +commit b2e592a4a9beb0ef3f8986e3ff3a630981bcad1f +Author: Sunny Kumar +Date: Thu Oct 11 17:36:43 2018 +0530 + + snapshot : fix high sev coverity on snapview-server.c + + This patch fixes CID 1325525 (double free). + + updates: bz#789278 + + Change-Id: I26a5f428dde83dd7708815f06830decf4068b94c + Signed-off-by: Sunny Kumar + +commit 67624335f5d2ca9c8b0c7d1630e7186cb5cdd6d6 +Author: Iraj Jamali +Date: Tue Oct 9 12:07:11 2018 +0530 + + performance/nl-cache: clang fix + + Argument with 'nonnull' attribute passed null. + + Adding a check to avoid the issue. + + Updates: bz#1622665 + + Change-Id: I1d3a166e154a51da59bebb93a49f5174e593c98e + Signed-off-by: Iraj Jamali + +commit 16704e575cfece60ed3d4ad413aaefabcae0474b +Author: Kotresh HR +Date: Thu Oct 11 12:51:03 2018 +0530 + + cli: Fix memory leaks reported by ASAN + + 'gf_cli_rsp' structure has 'op_errstr' and 'dict.dict_val' + which could get allocated by xdr and should be freed. This + patch takes care of all instances of the same. + + Updates: bz#1633930 + Change-Id: I2a5d129ffe85cfca743c89edb45b658f3ce688cb Signed-off-by: Kotresh HR -commit 65264180a386c7f10af5756175fdd8e096a7b115 -Author: Soumya Koduri -Date: Sun Nov 11 22:53:07 2018 +0530 +commit 33eefcec0ad2df3d6aac0ac225b64c61d42e56ef +Author: Iraj Jamali +Date: Wed Oct 10 12:29:21 2018 +0530 - leases: Fix incorrect inode_ref/unrefs + mgmt/glusterd: clang fix - From testing & code-reading, found couple of places where - we incorrectly unref the inode resulting in use_after_free - crash or ref leaks. This patch addresses couple of them. + Argument with 'nonnull' attribute passed null. - a) When we try to grant the very first lease for a inode, - inode_ref is taken in __add_lease. This ref should be active - till all the leases granted to that inode are released (i.e, - till lease_cnt > 0). In addition even after lease_cnt becomes '0', - the inode should be active till all the blocked fops are resumed. + Added checks to avoid the issues. - Hence release this ref, after resuming all those fops. To avoid - granting new leases while resuming those fops, defined a new boolean - (blocked_fops_resuming) to flag it in the lease_ctx. + Updates: bz#1622665 - b) 'new_lease_inode' which creates new lease_inode_entry and - takes ref on inode, is used while adding that entry to - client_list and recall_list. + Change-Id: I0dba1185cee5baba3c124d687560a06fe182381e + Signed-off-by: Iraj Jamali + +commit 522dcab94ae9938c072cf50062b507cedafdc011 +Author: Shwetha Acharya +Date: Mon Oct 1 12:39:48 2018 +0530 + + mgmt/glusterd: NULL pointer dereferencing clang fix - Use its counter function '__destroy_lease_inode' which does unref - while removing those entries from those lists. + Problem: dereferencing of this->name; volinfo and xl + can be null. - c) inode ref is also taken when added to timer->data. Unref the same - after processing timer->data. + Solution: Replaced this->name with apropriate names in few places, + added a null check to avoid dereferencing of volinfo, + and introduced a goto out statement, such that null pointer value is + not passed to the function volgen_xlator_link when xl becomes NULL. - Change-Id: Ie77c78ff4a971e0d9a66178597fb34faf39205fb - updates: bz#1651323 - Signed-off-by: Soumya Koduri - (cherry picked from commit b7aec05aa965202ab73120acf0da4c32fe0cf16c) + Updates: bz#1622665 + + Change-Id: I77616bd23f58328cb6dbe681914a028991d49abb + Signed-off-by: Shwetha Acharya -commit 5bfb65ef69ef2e1095bc1d5ba71396c7dd167adc -Author: Soumya Koduri -Date: Sat Nov 10 05:55:29 2018 -0500 +commit 62faf7d37bd8b6be6657b1e3b61f92eac5b84653 +Author: Krishnan Parthasarathi +Date: Thu Oct 11 15:16:41 2018 +0530 - gfapi: Send fop_attr dict as part of syncop_open + socket: use accept4/paccept for nonblocking socket - Leaseid (stored in thread locals) is sent to server via xdata. - This dict variable is set but not passed as argument in glfs_h_open(). - Fixed the same. + This reduces the no. of syscalls on Linux systems from 2, accept(2) and + fcntl(2) for setting O_NONBLOCK, to a single accept4(2). On NetBSD, we + have paccept(2) that does the same, if we leave signal masking aside. - Change-Id: Idd2f8a0ec184b4b6b1ad1e6e5d75df551c36a96d - updates: bz#1651323 - Signed-off-by: Soumya Koduri - (cherry picked from commit 04be5463b20ababc29942fa967017e763d0ae2af) + Added sys_accept which accepts an extra flags argument than accept(2). + This would opportunistically use accept4/paccept as available. It would + fallback to accept(2) and fcntl(2) otherwise. + + While at this, the patch sets FD_CLOEXEC flag on the accepted socket fd. + + BUG: 1236272 + Change-Id: I41e43fd3e36d6dabb07e578a1cea7f45b7b4e37f + fixes: bz#1236272 + Signed-off-by: Krishnan Parthasarathi -commit c309e41f7750a1730c381f2c0a513507ba08dae4 -Author: Soumya Koduri -Date: Fri Nov 9 02:29:52 2018 -0500 +commit 807ec72d740a4548c250cc660c89fc59d2f191d6 +Author: Shwetha Acharya +Date: Thu Oct 11 11:27:44 2018 +0530 + + performance/write-behind: NULL pointer passed to a nonnull parameter + + Problem: wb_directory_inode->lock can be null. + + Solution: added a condition, if(!wb_directory_inode->lock.spinlock) + to address the issue (checked one of the attributes of union lock + to ensure that union is not null). + + Updates: bz#1622665 + Change-Id: I0749ee16aa2c23f51d4b4c7b0979d494bcd4d90e + Signed-off-by: Shwetha Acharya + +commit 23e96fd93c021d4647b940a47df2250fe9159a3b +Author: Krishnan Parthasarathi +Date: Tue Oct 9 15:17:57 2018 +0530 + + socket: set FD_CLOEXEC on all sockets + + For more information, see http://udrepper.livejournal.com/20407.html + + BUG: 1236272 + Change-Id: I25a645c10bdbe733a81d53cb714eb036251f8129 + fixes: bz#1236272 + Signed-off-by: Krishnan Parthasarathi + +commit 4511435fd353b98551be17d02e1d91e8896164ed +Author: Amar Tumballi +Date: Mon Sep 24 10:31:23 2018 +0530 + + README: add a section for giving hints on testing + + Change-Id: I1529494504c38172f56759c0f06231864e32df24 + updates: bz#1193929 + Signed-off-by: Amar Tumballi + +commit 46b970f64a797aa67b9cdb3704e24b8392398191 +Author: Ashish Pandey +Date: Wed Oct 10 13:46:22 2018 +0530 + + cluster/dht : Fix coverity issue + + To check if the gfid is null or not + we should use function gf_uuid_is_null + + CID: 1382364 + https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=86243257&defectInstanceId=26374360&mergedDefectId=1382364 + + Change-Id: I81944b823c9ee6e6dcc9695f64f7e5966e0d7030 + updates: bz#789278 + Signed-off-by: Ashish Pandey + +commit 27d3d481bd66c30aaa9e30040aadee7325e9995e +Author: Kinglong Mee +Date: Wed Sep 19 03:35:38 2018 -0400 + + gfapi: fix crash of using uninitialized fs->ctx + + 0 0x00007fb3db3a2ee4 in pub_glfs_fini (fs=0x7f8977d63f00) at glfs.c:1236 + 1 0x00007fb3db3a2065 in pub_glfs_new (volname=0x7f80de4d4d40 "openfs1") + at glfs.c:784 + 2 0x00007fb3db5cf089 in glusterfs_get_fs (params=..., + up_ops=up_ops@entry=0x7fb3ca643130) + at /usr/src/debug/nfs-ganesha/src/FSAL/FSAL_GLUSTER/export.c:889 + 3 0x00007fb3db5cf99a in glusterfs_create_export ( + fsal_hdl=0x7fb3db7e2490 , parse_node=0x7fb3ca6387d0, + err_type=, up_ops=0x7fb3ca643130) + at /usr/src/debug/nfs-ganesha/src/FSAL/FSAL_GLUSTER/export.c:1011 + 4 0x00007fb3e11c485f in mdcache_fsal_create_export ( + sub_fsal=0x7fb3db7e2490 , + parse_node=parse_node@entry=0x7fb3ca6387d0, + err_type=err_type@entry=0x7fb3c0bef140, super_up_ops=) + at /usr/src/debug/nfs-ganesha/src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_main.c:281 + + (gdb) p errno + $1 = 12 + + Change-Id: I3dd5b84b52962ceb0b5d4f9b4f475bf4aa724292 + updates: bz#1626313 + Signed-off-by: Kinglong Mee + +commit 196b32423af9a5088056fe10ea22d01494670931 +Author: Ravishankar N +Date: Wed Oct 10 12:18:55 2018 +0530 + + afr: prevent winding inodelks twice for arbiter volumes + + Problem: + In an arbiter volume, if there is a pending data heal of a file only on + arbiter brick, self-heal takes inodelks twice due to a code-bug but unlocks + it only once, leaving behind a stale lock on the brick. This causes + the next write to the file to hang. + + Fix: + Fix the code-bug to take lock only once. This bug was introduced master + with commit eb472d82a083883335bc494b87ea175ac43471ff + + Thanks to Pranith Kumar K for finding the RCA. + + fixes: bz#1637802 + Change-Id: I15ad969e10a6a3c4bd255e2948b6be6dcddc61e1 + Signed-off-by: Ravishankar N + +commit 4da0d93f8703c7247fece9d9fb471742e6fd7c33 +Author: Iraj Jamali +Date: Thu Oct 4 14:22:23 2018 +0530 + + libglusterfs: NULL pointer dereferencing clang fix + + Avoided NULL pointer dereferencing by doing GF_VALIDATE_OR_GOTO for rvec + + Updates: bz#1622665 + + Change-Id: I650e0203796dd705d79060f9506fc6c559b30f56 + Signed-off-by: Iraj Jamali + +commit 6472b43cfdb7454f1c1f1faf57ff13643d62fad7 +Author: Sunny Kumar +Date: Tue Oct 9 19:40:31 2018 +0530 + + locks : fix coverity issue + + This patch fixes CID 1356544 and 1356539. + Both are of type NULL_RETURNS. + + Change-Id: I2ef7c3ff9929c4d85b79fff00e835ebee3ff3ce0 + updates: bz#789278 + Signed-off-by: Sunny Kumar + +commit 0f2113cb0c3f9dff028fb45a62ec2d1d82b4cb66 +Author: Kinglong Mee +Date: Tue Sep 25 03:40:44 2018 -0400 + + socket: clear return value if error is going to be handled in event thread + + Change-Id: Ibce94f282b0aafaa1ca60ab927a469b70595e81f + updates: bz#1626313 + Signed-off-by: Zhang Huan + +commit 2d96ce8faa277809c0c94aca54320483889f577d +Author: Xavi Hernandez +Date: Tue Sep 25 13:22:47 2018 +0200 + + all: fix warnings on non 64-bits architectures + + When compiling in other architectures there appear many warnings. Some + of them are actual problems that prevent gluster to work correctly on + those architectures. + + Change-Id: Icdc7107a2bc2da662903c51910beddb84bdf03c0 + fixes: bz#1632717 + Signed-off-by: Xavi Hernandez + +commit 0cda00f08d3d620be89830bad9d0e252648388e9 +Author: Kinglong Mee +Date: Tue Sep 25 03:42:47 2018 -0400 + + logging: fix file handle leak when calls glfs_set_logging more times + + Closes the log file and reopens it to prevent leakage of file handles. + + Change-Id: Idfaa479961bb0088004d0d5558bdb0eb32cff632 + updates: bz#1626313 + Signed-off-by: Kinglong Mee + +commit 21c6b3e5ab47b615f0b18a27ce74285490f43a7a +Author: Yaniv Kaul +Date: Sun Oct 7 20:39:22 2018 +0300 + + libglusterfs/src/logging.c: reduce the use of strings + + I did not see a good reason to copy the temp strings str1 and str2 + into msg string, and just used str1 (sprintf'ed str2 into it first). + Hope it makes logging somewhat faster, but I also hope there's more + room for improvement for faster logging. + + Renamed str1 to logline and str2 to msg for better readability. + + Also, remove dead assignment in _gf_msg() (clang complained). + + Compile-tested only! + + updates: bz#1193929 + Signed-off-by: Yaniv Kaul + + Change-Id: I19457d705c0b043937d96a4db35d087bb8e9b35a + +commit eb5382f9475900ec95cfd52278f46553dbde18a6 +Author: Raghavendra Bhat +Date: Wed Sep 5 15:30:25 2018 -0400 + + features/snapview-client: replace gf_log with gf_msg + + Change-Id: I87f01d86f50eb2fca21febb0ea3e77fbd152eb93 + updates: bz#1626610 + Signed-off-by: Raghavendra Bhat + +commit 07072898bec59189e1cec991fb179d04ac485a7a +Author: Susant Palai +Date: Thu Oct 4 19:17:56 2018 +0530 + + cloudsync: coverity fix + + CID: 1394649 1394657 + Issue: Explicit null dereferenced + + Change-Id: Ic1040ffa5548e1ecd49cfdc9a8716be445cbdf0f + Updates: bz#789278 + Signed-off-by: Susant Palai + +commit 3fa73bfdb5183cb8077d43c3c219c3fd9e9a1b65 +Author: Amar Tumballi +Date: Mon Oct 8 13:21:38 2018 +0530 + + cli: memory leak issues reported by asan + + With this fix, a run on 'rpc-coverage.t' passes properly. + This should help to get started with other fixes soon! + + Change-Id: I257ae4e28b9974998a451d3b490cc18c02650ba2 + updates: bz#1633930 + Signed-off-by: Amar Tumballi + +commit 8d4c5e022bba1b99786ce13f407c27024beccc23 +Author: Sunny Kumar +Date: Tue Oct 9 12:43:32 2018 +0530 + + cliutils : python2 to python3 compat + + This patch fixes import issue in cliutils. + + Provided solution is to use relative import. + + Change-Id: I14c9a0b528ef52e7c91f6b17b569c68c2ced8912 + updates: #411 + Signed-off-by: Sunny Kumar + +commit 73bb13e7bc45f5f5ce73302312f2094de1fee9a3 +Author: Pranith Kumar K +Date: Fri Sep 28 11:10:46 2018 +0530 + + extras: Script to collect system-stats + + For debugging performance issues we found that this script is very + useful. Script collects the stats of vmstat/iostat/top/sar to get + metrics about memory/disk/cpu/network respectively at the configured + interval. It is very important to collect all these metrics at the + same time so that they can be correlated easily, so made this into a + script + + fixes bz#1633926 + Change-Id: Iea52e55179b21c505953722c8898293fe92cb8de + Signed-off-by: Pranith Kumar K + +commit 667026f506d71bc5e5e740477bdc546f08c413ee +Author: Kinglong Mee +Date: Wed Sep 26 05:39:47 2018 -0400 + + syncop: check syncenv status before pthread_cond_timedwait() to avoid 600s timeout + + If a syncenv_task starts after syncenv_destroy, the syncenv_task enters + a 600s timeout cond timedwait, and syncenv_destroy must waits it timeout. + + Change-Id: I972a2b231e50cbebd3c71707800e58033e40c29d + updates: bz#1626313 + Signed-off-by: Kinglong Mee + +commit 3108fb24e72ab3f60ef0aa9cf3ffd8a3a33ce424 +Author: Milind Changire +Date: Mon Oct 8 21:35:04 2018 +0530 + + rpc: coverity fixes + + CID: [1] 1394646 Unchecked return value from library + CID: [2] 1394633 Unused value + CID: 1382443 Sleeping while holding a lock [This is intentional] + + [1] https://scan6.coverity.com/reports.htm#v40014/p10714/fileInstanceId=86159112&defectInstanceId=26360786&mergedDefectId=1394646 + [2] https://scan6.coverity.com/reports.htm#v40014/p10714/fileInstanceId=86159365&defectInstanceId=26360919&mergedDefectId=1394633 + + Change-Id: I03086f7a9672c9f50a2bc44cdbce0006c887357b + updates: bz#789278 + Signed-off-by: Milind Changire + +commit b5f75e337c19d4fed85d4dcf15cf47f02fea5f6a +Author: Kotresh HR +Date: Sat Oct 6 09:20:24 2018 +0530 + + events: python2 to python3 compat + + 1. Fix imports + 2. Use universal_newlines flag in Popen + 3. encode msg used in 'sendto' + + Updates: #411 + Change-Id: Ieacdc2ba86953ff3a2e9d9b9a97157e8e0e36836 + Signed-off-by: Kotresh HR + +commit fb6e8d0d0ca21b16d331fa69da9b9dadf6c5c35d +Author: Kotresh HR +Date: Wed Oct 3 00:45:09 2018 -0400 + + georep: python2 to python3 compat - syscalls + + 1. ctypes/syscalls + A) arguments is expected to be encoded + B) Raw conversion of return value from bytearray into string + 2. struct pack/unpack - Raw converstion of string to bytearray + 3. basestring -> str + + Updates: #411 + Change-Id: I80f939adcdec0ed0022c87c0b76d057ad5559e5a + Signed-off-by: Kotresh HR + +commit 860a990811c5364bc2de04ca07096cde312ff209 +Author: Kaleb S. KEITHLEY +Date: Fri Oct 5 13:28:03 2018 -0400 + + packaging: remove RHEL5-isms from glusterfs.spec(.in) + + CentOS5 too + + It's been a couple of years since we stopped doing anything with + RHEL/CentOS 5 + + Change-Id: I83e78fa84b93fa5baddaf3fab92736d692a9bbca + updates: bz#1193929 + Signed-off-by: Kaleb S. KEITHLEY + +commit 5bc4594dabc08fd4de1940c044946e33037f2ac7 +Author: Mohit Agrawal +Date: Tue Oct 2 08:54:28 2018 +0530 + + core: glusterfsd keeping fd open in index xlator + + Problem: Current resource cleanup sequence is not + perfect while brick mux is enabled + + Solution: 1) Destroying xprt after cleanup all fd associated + with a client + 2) Before call fini for brick xlators ensure no stub + should be running on a brick + + Change-Id: I86195785e428f57d3ef0da3e4061021fafacd435 + fixes: bz#1631357 + Signed-off-by: Mohit Agrawal + +commit 31b6308c646a84c5064d2fb31dc45363a71b131a +Author: Sanju Rakonde +Date: Sun Oct 7 14:22:06 2018 +0530 - afr: open_ftruncate_cbk should read fd from local->cont.open struct + cli: Resource leak coverity fix - afr_open stores the fd as part of its local->cont.open struct - but when it calls ftruncate (if open flags contain O_TRUNC), the - corresponding cbk function (afr_ open_ftruncate_cbk) is - incorrectly referencing uninitialized local->fd. This patch fixes - the same. + This patch fixes CID 1175017. - Change-Id: Icbdedbd1b8cfea11d8f41b6e5c4cb4b44d989aba - updates: bz#1651322 - Signed-off-by: Soumya Koduri - (cherry picked from commit fda594875c4cdb2a22e27aa13f5c66bee032ccb5) + Change-Id: I4968c35489aeb5bfa0461b2edf2a0d73b7f03c14 + updates: bz#789278 + Signed-off-by: Sanju Rakonde -commit e504e9f97053b7b755aea49dc13a1e886c896b85 -Author: karthik-us -Date: Wed May 30 15:27:52 2018 +0530 +commit 82b7f8d77974bd2133705cce0d9188756dab3563 +Author: Sunny Kumar +Date: Fri Oct 5 01:38:15 2018 +0530 - cluster/afr: Use 2 domain locking in SHD for thin-arbiter - - With this change when SHD starts the index crawl it requests - all the clients to release the AFR_TA_DOM_NOTIFY lock so that - clients will know the in memory state is no more valid and - any new operations needs to query the thin-arbiter if required. + changetimerecorder : fix coverity issue - When SHD completes healing all the files without any failure, it - will again take the AFR_TA_DOM_NOTIFY lock and gets the xattrs on - TA to see whether there are any new failures happened by that time. - If there are new failures marked on TA, SHD will start the crawl - immediately to heal those failures as well. If there are no new - failures, then SHD will take the AFR_TA_DOM_MODIFY lock and unsets - the xattrs on TA, so that both the data bricks will be considered - as good there after. + This patch fixes CID : 1124725 + Issue : Resource leak - >Change-Id: I037b89a0823648f314580ba0716d877bd5ddb1f1 - >fixes: bz#1579788 - >Signed-off-by: karthik-us - (cherry picked from commit 5784a00f997212d34bd52b2303e20c097240d91c) + updates: bz#789278 - Change-Id: I037b89a0823648f314580ba0716d877bd5ddb1f1 - fixes: bz#1648205 + Change-Id: I2afe65875fa393fd2d2f90b6f7cf7f6782dabf89 + Signed-off-by: Sunny Kumar -commit 73f586a007dcffc9692f5f6be3a512a31c4a31ce -Author: Xavi Hernandez -Date: Wed Oct 31 12:26:43 2018 +0100 +commit 1d392e2970fb5b1d2f8cf2904e7b7e5d32a21882 +Author: Sheetal Pamecha +Date: Mon Oct 1 17:02:09 2018 +0530 - cluster/ec: prevent infinite loop in self-heal full + features/bit-rot: NULL pointer deferencing clang fix - There was a problem in commit 7f81067 that caused infinite loop when - full heal was triggered. + Problem: local could be NULL - The previous commit was made to prevent self-heal to go idle after a - replace brick operation. One of the changes consisted on setting a - flag to force an immediate scan of the dirty directory if a heal on - a directory succeeded (assuming it could have generated newer entries). + Added condition checks to address this issue - However that change was causing an issue with a full self-heal, since - every time an already healed directory was checked and it returned - suceessfully, it was also setting the flag, forcing self-heal to start - over again. + Updates: bz#1622665 - This patch fixes this issue by only setting the flag if the heal is not - full. It's assumed that a full self-heal will already traverse all - entries automatically, so there's no need to force a new scan later. + Change-Id: I7be7dacc5386a77441385240b43f22d85074b69d + Signed-off-by: Sheetal Pamecha + +commit 6a6709489525e2c438a3ec1974771247bc2e07d4 +Author: Sanju Rakonde +Date: Sun Oct 7 15:47:13 2018 +0530 + + tests: add get-state command to test - >Change-Id: Id12dbfc04e622b18183e796cc6cc87ccc30a6d55 - >fixes: bz#1636631 - >Signed-off-by: Xavi Hernandez - (cherry picked from commit 7150c51ad75ccba22045a35fc31e5037612d1ad4) + When geo-replication session is running, run + "gluster get-state" command to test. - Change-Id: Id12dbfc04e622b18183e796cc6cc87ccc30a6d55 - fixes: bz#1651525 - Signed-off-by: Xavi Hernandez + https://review.gluster.org/#/c/glusterfs/+/20461/ + patch fixes glusterd crash, when we run get-state + command with geo-rep session configured. + Adding the test now. + + Fixes: bz#1598345 + Change-Id: I56283fba2c782f83669923ddfa4af3400255fed6 + Signed-off-by: Sanju Rakonde -commit 2436286634e069639975f7b5c973f859a87de233 -Author: Ravishankar N -Date: Fri Oct 26 17:51:38 2018 +0530 +commit 76bd93c7b889deafd4d5e1e9387714a6c1918ac7 +Author: Amar Tumballi +Date: Mon Sep 17 17:17:54 2018 +0530 - glfsheal: add a '--nolog' flag + xlators/experimental: move template files to '.c.in' type - ....and if set, change the log level to GF_LOG_NONE. This is useful for - monitoring applications which invoke the heal info set of commands once - every minute, leading to un-necessary glfsheal* logs in - /var/log/glusterfs/. For example, we can now run + This is critical because we shouldn't be applying the automated + coding standard (clang-format) tool on these files. - `gluster volume heal info --nolog` - `gluster volume heal info split-brain --nolog` etc. + This patchset is done by below steps: - The default log level is still retained at GF_LOG_INFO. + * clang-format -i ${filename} - The patch also changes glfsheal internally to accept '--xml' instead of 'xml'. - Note: The --nolog flag is *not* displayed in the help anywhere, for the - sake of consistency in how the other flags are not displayed anywhere in - the help. + This creates syntax errors. Fix them using below two commands: + * sed -i -e 's/ @/@/g' ${filename} + * sed -i -e 's/,@/, @/g' ${filename} - fixes: bz#1654236 - Change-Id: Ia08b6aa6e4a0548379db7e313dd4411ebc66f206 - Signed-off-by: Ravishankar N - (cherry picked from commit fc9889d0373c323aab0d93f8ca31d2d8151bd041) - -commit c12ded9ebf41c1f3bacda98a20b165a413740b2e -Author: ShyamsundarR -Date: Wed Nov 14 11:03:08 2018 -0500 - - doc: Release notes for 5.1 release of GlusterFS + With this, these files are having minimum changes requried to + compile, and is as close to the coding standard as possible. - Change-Id: I526bf9bfd889dd7aea19f71059042cd9a993e1d0 - Signed-off-by: ShyamsundarR - Fixes: bz#1640685 + * git rename ${filename} ${filename}.in + + Updates: bz#1564149 + Change-Id: Icf90f7f81d6fa4400be4826e094fdff8e64508d0 + Signed-off-by: Amar Tumballi -commit 26a40f8b5c7f46b0390fd7b15a6bd5a77d0176cd -Author: Ashish Pandey -Date: Wed Oct 17 15:18:34 2018 +0530 +commit c1f04098227c17bbebe286871c75524c80eb8b3a +Author: Sunny Kumar +Date: Thu Oct 4 19:20:30 2018 +0530 - cluster/ec: Change log level to DEBUG for lookup combine - - As lookup is not a locked fop, we can not trust the - data received in this to be same. + cli : coverity fix in cli-rl.c - Changing the log level to DEBUG in case lookup finds any - difference. + This patch fixes CID 1395248. + Issue : Resource leak - (cherry picked from commit 9be6bf3d90e3783b3ba559c93d41b933f8d53f03) + updates: bz#789278 - Change-Id: I39499c44688a2455c7c6c69a798762d045d21b39 - updates: bz#1644622 - Signed-off-by: Ashish Pandey + Change-Id: I2fd4e36ac2c2a034e56883436abfc5199b095026 + Signed-off-by: Sunny Kumar -commit 636ff6e2171d6288fe3f47cbcb971bb1e40458be -Author: Kinglong Mee -Date: Mon Nov 12 17:07:21 2018 +0800 +commit 07cb6a486502fa0f7ea141e7600ec67015383546 +Author: Susant Palai +Date: Wed Oct 3 20:40:12 2018 +0530 - gfapi: fix bad dict setting of lease-id + dht: coverity fixes - lease_id is a 16 bits opaque data, copying it by gf_strdup is wrong. + CID: 1356541 Issue: Dereference null return value + CID: 1382411 Issue: Dereference after null check + CID: 1391409 Issue: Unchecked return value - Invalid read of size 2 - at 0x483FA2F: memmove (vg_replace_strmem.c:1270) - by 0xE2EF6FB: ??? (in /usr/lib64/libtirpc.so.3.0.0) - by 0xE2EE047: xdr_opaque (in /usr/lib64/libtirpc.so.3.0.0) - by 0x107A97DC: xdr_gfx_value (glusterfs4-xdr.c:207) - by 0x107A98C0: xdr_gfx_dict_pair (glusterfs4-xdr.c:321) - by 0xE2EF35E: xdr_array (in /usr/lib64/libtirpc.so.3.0.0) - by 0x107A9A89: xdr_gfx_dict (glusterfs4-xdr.c:335) - by 0x107AA97B: xdr_gfx_write_req (glusterfs4-xdr.c:897) - by 0x107A181E: xdr_serialize_generic (xdr-generic.c:25) - by 0x231044A2: client_submit_request (client.c:205) - by 0x2314D3C1: client4_0_writev (client-rpc-fops_v2.c:3863) - by 0x230FD5FA: client_writev (client.c:956) - Address 0xad659e18 is 72 bytes inside a block of size 73 alloc'd - at 0x483880B: malloc (vg_replace_malloc.c:299) - by 0x106BA7EC: __gf_malloc (mem-pool.c:136) - by 0x1064521E: gf_strndup (mem-pool.h:166) - by 0x1064521E: gf_strdup (mem-pool.h:183) - by 0x1064521E: get_fop_attr_thrd_key (glfs.c:627) - by 0x1064D8E9: glfs_pwritev@@GFAPI_3.4.0 (glfs-fops.c:1154) - by 0x10610C0C: glusterfs_write2 (handle.c:2092) - by 0x54D30C: mdcache_write2 (mdcache_file.c:647) - by 0x48A3FC: nfs4_write (nfs4_op_write.c:459) - by 0x48A44D: nfs4_op_write (nfs4_op_write.c:487) - by 0x4634F5: nfs4_Compound (nfs4_Compound.c:947) - by 0x460155: nfs_rpc_process_request (nfs_worker_thread.c:1329) - by 0x4608A3: nfs_rpc_valid_NFS (nfs_worker_thread.c:1539) - by 0x488F12F: svc_vc_decode (svc_vc.c:825) + Change-Id: Id3d4feb4e88df424003cc8e8a1540e77bbe030e3 + Updates: bz#789278 + Signed-off-by: Susant Palai + +commit f87d1a1e3374596bc5ee9dad2aee8d12db657da5 +Author: Sunny Kumar +Date: Fri Oct 5 01:14:34 2018 +0530 + + libglusterfs : fix coverity issue in stack.c - Backport of: + This patch fixes CID : 1395323. + Issue : Uninitialized scalar variable (UNINIT) - > Patch: https://review.gluster.org/21586/ - > BUG: bz#1647651 - > Change-Id: Ib9fff55c897bc43c15036a869888e763df133757 - > Signed-off-by: Kinglong Mee - (cherry picked from commit 6d4cd8ce6c0d88d331ffed97c51d3061a3900561) + updates: bz#789278 - Updates bz#1648923 - Change-Id: Ib9fff55c897bc43c15036a869888e763df133757 - Signed-off-by: Kinglong Mee + Change-Id: Id9567ca2ff9b5a36b9014afa70cc5795fe67161d + Signed-off-by: Sunny Kumar -commit dbfdd52f50ab76a7e6c5a92856a88f8db0a5c351 -Author: Kotresh HR -Date: Fri Oct 26 03:45:46 2018 -0400 +commit 3be7116d39ff767a24e5206de584a3c5f3afe8ef +Author: Harpreet Lalwani +Date: Mon Sep 24 14:53:18 2018 +0530 - geo-rep: Add more intelligence to automatic error handling - - Geo-rep's automatic error handling does gfid conflict - resolution. But if there are ENOENT errors because the - parent is not synced to slave, it doesn' handle them. - This patch adds the intelligence to create missing - parent directories on slave. It can create the missing - directories upto the depth of 10. + features/compress: NULL pointer dereferencing clang fix - Backport of: + Added a Label "err" to avoid NULL pointer dereferencing - > Patch: https://review.gluster.org/21498/ - > fixes: bz#1643402 - > Change-Id: Ic97ed1fa5899c087e404d559e04f7963ed7bb54c - > Signed-off-by: Kotresh HR - (cherry picked from commit 19775e0445411cca9ddd9d294fd54d0b6fbe6a03) + Updates: bz#1622665 - fixes: bz#1646896 - Change-Id: Ic97ed1fa5899c087e404d559e04f7963ed7bb54c - Signed-off-by: Kotresh HR + Change-Id: I7ec02a9cbbc482c2cf77f66e5692e86cd251cd53 + Signed-off-by: Harpreet Lalwani -commit 3782c90a617dfefc9bc8a92d0facb3927659dede -Author: Sanju Rakonde -Date: Wed Oct 3 23:58:37 2018 +0530 +commit 2066466dadf658dcf7226267ada50faaa103b7f3 +Author: Susant Palai +Date: Thu Oct 4 16:40:08 2018 +0530 - glusterd: ensure volinfo->caps is set to correct value. + cloudsync: coverity fix - With the commit febf5ed4848, during the volume create op, - we are setting volinfo->caps to 0, only if any of the bricks - belong to the same node and brickinfo->vg[0] is null. - Previously, we used to set volinfo->caps to 0, when - either brick doesn't belong to the same node or brickinfo->vg[0] - is null. + CID: 1394631 1394634 1394643 1394645 1394652 1394655 1394661 1394666 + 1394669 1394670 1394671 - With this patch, we set volinfo->caps to 0, when either brick - doesn't belong to the same node or brickinfo->vg[0] is null. - (as we do earlier without commit febf5ed4848). + Issue: Argument cannot be negative - > BUG: bz#1635820 - > Change-Id: I00a97415786b775fb088ac45566ad52b402f1a49 - > Signed-off-by: Sanju Rakonde - (cherry picked from commit aae1c402b74fd02ed2f6473b896f108d82aef8e3) + Change-Id: Id4a9b1adcc271374971e788f161d91e8c9ac442f + Updates: bz#789278 + Signed-off-by: Susant Palai + +commit a6128d64ec4c25eba002941ae68a9e9a72805704 +Author: Susant Palai +Date: Wed Oct 3 21:09:15 2018 +0530 + + libglusterfs: coverity fix - fixes: bz#1647968 - Change-Id: I00a97415786b775fb088ac45566ad52b402f1a49 - Signed-off-by: Sanju Rakonde + CID: 1395829 Issue: Uninitialized pointer read + + Change-Id: I2e03d7b2a2f28f4a46408402ae03beba0f4c8308 + Updates: bz#789278 + Signed-off-by: Susant Palai -commit 83304fedb464fe3f97db662ce3e07bd948b7b7d9 -Author: Amar Tumballi -Date: Tue Nov 6 22:47:41 2018 +0530 +commit 4f7729748ee7d79e41dec9682a4fbbb2378ed5ac +Author: Kaleb S. KEITHLEY +Date: Mon Oct 1 14:09:03 2018 -0400 - all: fix the format string exceptions + dht: volume_options 'options' collision with nfs-ganesha's 'options' - Currently, there are possibilities in few places, where a user-controlled - (like filename, program parameter etc) string can be passed as 'fmt' for - printf(), which can lead to segfault, if the user's string contains '%s', - '%d' in it. + When dht was converted to xlator_api, the variable 'options' was not + changed to dht_options, the same as was done to all the other xlators + that were converted to xlator_api. - While fixing it, makes sense to make the explicit check for such issues - across the codebase, by making the format call properly. + Thus the reference to 'options' in dht.c is not resolved until runtime, + and the RTlinker's search path starts with symbols in the executable, + i.e. ganesha.nfsd's 'options'. (Which is obviously not the right one.) - Fixes: CVE-2018-14661 + The unused extern references to 'options' (now dht_options) in nufa.c + and switch.c is curious. - Fixes: bz#1647666 - Change-Id: Ib547293f2d9eb618594cbff0df3b9c800e88bde4 - Signed-off-by: Amar Tumballi + Change-Id: Idf4a5d5fbd39aadfa5a4b529bceea65a3cbdf8f3 + updates: bz#1193929 + Signed-off-by: Kaleb S. KEITHLEY -commit 7136414bcc0426270f1df8720018af1b53fd228a -Author: Vijay Bellur -Date: Tue Nov 6 10:12:10 2018 -0800 +commit dbafe63ea5602db3ad65a3e4fba15b6ee97776ce +Author: Xavi Hernandez +Date: Thu Oct 4 10:31:45 2018 +0200 - features/locks:Use pthread_mutex_unlock() instead of pthread_mutex_lock() + Reduce execution time of bug-1559004-EMLINK-handling.t - Fixes CID 1396581 + This patch reduces the execution time of bug-1559004-EMLINK-handling.t + from ~14 minutes to ~90 seconds. To do so, it creates some fake hard + links directly on the brick instead of creating them through the + volume. - Change-Id: Ic04091b5783a75d8e1e605a9c1c28b77fea048d3 - updates: bz#1647962 - Signed-off-by: Vijay Bellur - Signed-off-by: Susant Palai + Change-Id: I9715ff1a4eba47574c733d4f28e68f42f56a7d3f + updates: bz#1193929 + Signed-off-by: Xavi Hernandez -commit c87a458998717e951094744a56247a8ec6c48b4b -Author: Susant Palai -Date: Fri Nov 2 09:23:42 2018 +0530 +commit 83a89296a3d12a3fc2a643c0630be5ce659204ea +Author: Raghavendra Bhat +Date: Mon Oct 1 17:30:19 2018 -0400 - lock: Do not allow meta-lock count to be more than one + mgmt/glusterd: use proper path to the volfile - In the current scheme of glusterfs where lock migration is - experimental, (ideally) the rebalance process which is migrating - the file should request for a metalock. Hence, the metalock count - should not be more than one for an inode. In future, if there is a - need for meta-lock from other clients, this patch can be reverted. + Till now, glusterd was generating the volfile path for the snapshot + volume's bricks like this. - Since pl_metalk is called as part of setxattr operation, any client - process(non-rebalance) residing outside trusted network can exhaust - memory of the server node by issuing setxattr repetitively on the - metalock key. The current patch makes sure that more than - one metalock cannot be granted on an inode. + /snaps// - Fixes CVE-2018-14660 + But in reality, the path to the brick volfile for a snapshot volume is - updates: bz#1647962 - Change-Id: Ie1e697766388718804a9551bc58351808fe71069 - Signed-off-by: Susant Palai - -commit d0b3b63519dac97ad2c4bc24821565e9aea02ba2 -Author: Amar Tumballi -Date: Thu Nov 1 07:02:11 2018 +0530 - - server: don't allow '/' in basename + /snaps/// - Server stack needs to have all the sort of validation, assuming - clients can be compromized. It is possible for a compromized - client to send basenames with paths with '/', and with that - create files without permission on server. By sanitizing the basename, - and not allowing anything other than actual directory as the parent - for any entry creation, we can mitigate the effects of clients - not able to exploit the server. + The above workaround was used to distinguish between a mount command used + to mount the snapshot volume, and a brick of the snapshot volume, so that + based on what is actually happening, glusterd can return the proper volfile + (client volfile for the former and the brick volfile for the latter). But, + this was causing problems for snapshot restore when brick multiplexing is + enabled. Because, with brick multiplexing, it tries to find the volfile + and sends GETSPEC rpc call to glusterd using the 2nd style of path i.e. - Fixes: CVE-2018-14651 + /snaps/// - Fixes: bz#1647663 - Change-Id: I5dc0da0da2713452ff2b65ac2ddbccf1a267dc20 - Signed-off-by: Amar Tumballi + So, when the snapshot brick (which is multiplexed) sends a GETSPEC rpc + request to glusterd for obtaining the brick volume file, glusterd was + returning the client volume file of the snapshot volume instead of the + brick volume file. + + Change-Id: I28b2dfa5d9b379fe943db92c2fdfea879a6a594e + fixes: bz#1635050 + Signed-off-by: Raghavendra Bhat -commit d1b0de23c1fdc44a4ef661a8bb03c27228045634 -Author: Ashish Pandey -Date: Thu Oct 18 17:15:58 2018 +0530 +commit 6b58e8426a36bc544c06a599311999bf89ad04f2 +Author: Atin Mukherjee +Date: Wed Oct 3 16:34:54 2018 +0530 - cluster/afr : Check for UP bricks before starting heal - - Problem: - Currently for replica volume, even if only one brick is UP - SHD will keep crawling index entries even if it can not - heal anything. + glusterd: ignore RPC events when glusterd is shutting down - In thin-arbiter volume which is also a replica 2 volume, - this causes inode lock contention which in turn sends - upcall to all the clients to release notify locks, even - if it can not do anything for healing. + When glusterd receives a SIGTERM while it receives RPC + connect/disconnect/destroy events, the thread might lead to a crash + while accessing rcu_read_lock () as the clean up thread might have + already freed up the resources. This is more observable when glusterd + comes up with upgrade mode = on during upgrade process. - This will slow down the client performance and kills the - purpose of keeping in memory information about bad brick. + The solution is to ignore these events if glusterd is already in the + middle of cleanup_and_exit (). - Solution: Before starting heal or even crawling, check if - sufficient number of children are UP and available to check - and heal entries. + Fixes: bz#1635593 + Change-Id: I12831d31c2f689d4deb038b83b9421bd5cce26d9 + Signed-off-by: Atin Mukherjee + +commit 0153fcfcbd0e442824ec9bc19122a253512e98ea +Author: Iraj Jamali +Date: Mon Sep 24 16:44:45 2018 +0530 + + mgmt/glusterd: NULL pointer dereferencing clang fix - (cherry picked from commit f73b4476b15f9d6d3dc3c8e20c9742aacd857f9f) + Added checks to avoid NULL pointer dereferencing - Change-Id: I011c9da3b37cae275f791affd56b8f1c1ac9255d - updates: bz#1644645 - Signed-off-by: Ashish Pandey + Updates: bz#1622665 + + Change-Id: I745c1f3ba4df0e486ce99301843f9f13d01c00e0 + Signed-off-by: Iraj Jamali -commit b651cb3e612214c8fdb434af2b95ca0c018b5c36 -Author: Sanju Rakonde -Date: Tue Nov 6 19:44:16 2018 +0530 +commit 04a98cd88e9e9eb9f7bc6c174671d82ece666fbf +Author: shujun10086 +Date: Tue Oct 2 08:37:17 2018 +0000 - glusterd: allow shared-storage to use bricks under glusterd working directory + cli: fix glusterd memory leak cause by "gluster v status volume_name" - With commit 44e4db, we are not allowing user to create a volume - using glusterd's working directory as a brick or any sub directory - under glusterd's working directory as a brick.This has broken - shared-storage since the volume "gluster-shared-storage" is - created using the bricks under glusterd's working directory. + If use this command every some seconds for example 15s to check gluster brick + status, the glusterd will use about 1G memory in a year. free the value of rsp + in gf_cli_status_cbk. glusterd allocate the value of rsp and send it to cli, but + cli do not free the value, that cause glusterd memory leak. - With this patch, we let the "gluster-shared-storage" volume - to use bricks under glusterd's working directory. + fixes: bz#1635480 + Change-Id: I3f19cd0d4b791ae1b35f9664b3a668b1579f1178 + Signed-off-by: shujun10086 + +commit fa091f07841dac48fff1fa505b88f7b7edea9edc +Author: Iraj Jamali +Date: Tue Sep 25 16:45:48 2018 +0530 + + mgmt/glusterd: NULL pointer deferencing clang fix - > BUG: bz#1647029 - > Change-Id: Ifcbcf4576eea12cf46f199dea287b29bd3ec3bfd - > Signed-off-by: Sanju Rakonde - (cherry picked from commit bdb4ca184913c82ccf9552298f5d5b597794f2aa) + Changed this->name to "glusterd" - fixes: bz#1647801 - Change-Id: Ifcbcf4576eea12cf46f199dea287b29bd3ec3bfd - Signed-off-by: Sanju Rakonde + Updates: bz#1622665 + + Change-Id: Ic8ce428cefd6a5cecf5547769d8b13f530065c56 + Signed-off-by: Iraj Jamali -commit 7462a4dd92ea97b399d2321973ecdff0791ce3bd -Author: Amar Tumballi -Date: Tue Nov 6 22:38:17 2018 +0530 +commit 8a4b6f079b516e939fd55c4014dfcbd20142462f +Author: Niels de Vos +Date: Sun Sep 30 16:54:03 2018 +0200 - io-stats: prevent taking file dump on server side + python: remove shebangs of non-main scripts and make others executable - By allowing clients taking dump in a file on brick process, we are - allowing compromised clients to create io-stats dumps on server, - which can exhaust all the available inodes. + Some of the scripts that have a #!/usr/bin/python3 shebang do not have a + main() like function. These scripts will not get executed but only + imported. They do not need the shebang. - Fixes: CVE-2018-14659 + A few others are not installed with 'make install', but do have a main() + like function. These scripts are expected to be used by developers for + different tasks (mostly code generation). Marking these scripts + executable to make it easier to identify them. - Fixes: bz#1647665 - Change-Id: I32bfde9d4fe646d819a45e627805b928cae2e1ca - Signed-off-by: Amar Tumballi + Change-Id: I73541471deb7e0830766b804786244e73dfe4221 + Updates: #411 + Signed-off-by: Niels de Vos -commit 2308c6368cc08b38021acd228f461ce45a2a15c6 +commit c96778b354ea82943442aab158adbb854ca43a52 Author: Amar Tumballi -Date: Thu Nov 1 07:08:29 2018 +0530 +Date: Sun Sep 23 23:53:39 2018 +0530 - glusterd-handshake: prevent a buffer overflow + rpc: make binding to port 0 as the default if no option is provided - as key size in xdr can be anything, it can be bigger than the - 'NAME_MAX' allowed in the structure, which can allow for service denial - attacks. + Right now, if no option is provided, the default port is assumed, + which is 24007. Ideally, for 'glusterfsd' processes, it is better + to not assume there are any ports given, so it can start listening + on any port which is available. - Fixes: CVE-2018-14653 + This helps us to cleanup the dependencies on glusterd from glusterfsd + at the moment. No changes would be done to glusterd code, but making + the right defaults helps to make glusterfsd more independent process + later. - Fixes: bz#1647664 - Change-Id: I2dc5e99af27ddf44c12c94b07e51adb8674cce80 + NOTE: This patch is a reduced version of below set of patches: + * https://review.gluster.org/14613/ & + * https://review.gluster.org/14670/ & + * https://review.gluster.org/14671/ + + Credits: Prasanna Kumar Kalever + + updates: bz#1343926 + Change-Id: Ib874e10505e7366dc56ba754458252b67052e653 Signed-off-by: Amar Tumballi -commit da9e2a4861558ba036787458ecc4e68b3c84f056 -Author: Amar Tumballi -Date: Thu Nov 1 07:16:32 2018 +0530 +commit ff00ce1d55e34ec77e93e742533928edf653e2d2 +Author: Kotresh HR +Date: Fri Sep 28 06:11:52 2018 -0400 - protocol: remove the option 'verify-volfile-checksum' + georep: python2 to python3 compat - pickle - 'getspec' operation is not used between 'client' and 'server' ever since - we have off-loaded volfile management to glusterd, ie, at least 7 years. + Handle py2 and py3 compatibility for pickling and unpickling. + Geo-rep pickles and unpickles reading sys.stdin and sys.stdout streams. + py2 and py3 compatibility expects the streams to be opened in binary + mode but the sys.stdout objects are different in python2 + and python3 - No reason to keep the dead code! The removed option had no meaning, - as glusterd didn't provide a way to set (or unset) this option. So, - no regression should be observed from any of the existing glusterfs - deployment, supported or unsupported. + python2: + >>> type(sys.stdout) + - Updates: CVE-2018-14653 + python3: + >>> type(sys.stdout) + - Updates: bz#1647664 - Change-Id: I4a2e0f673c5bcd4644976a61dbd2d37003a428eb - Signed-off-by: Amar Tumballi + So in order to access binary stream, using sys.stdin.buffer in python3 + + Updates: #411 + Change-Id: I1a633ccdddff5baf0cf05a8b493add39ddf75bd7 + Signed-off-by: Kotresh HR -commit 2b1d28aa809fc364ca383866ad4d905016d6ef57 -Author: Sanju Rakonde -Date: Mon Oct 8 19:33:58 2018 +0530 +commit d06bbb617ee9449759cd069141a085c313524298 +Author: Kotresh HR +Date: Fri Sep 28 05:52:36 2018 -0400 - tests: correction in tests/bugs/glusterd/optimized-basic-testcases-in-cluster.t + georep: python2 and python3 compat - bytes-str - Patch https://review.gluster.org/#/c/glusterfs/+/19135/ has - optimised glusterd test cases by clubbing the similar test - cases into a single test case. + 1. Fix fdopen used for pid file + 2. Fix sha256 checksum calculation - https://review.gluster.org/#/c/glusterfs/+/19135/15/tests/bugs/glusterd/bug-1293414-import-brickinfo-uuid.t - test case has been deleted and added as a part of - tests/bugs/glusterd/optimized-basic-testcases-in-cluster.t + Updates: #411 + Change-Id: Ic173d104a73822c29aca260ba6de872cd8d23f86 + Signed-off-by: Kotresh HR + +commit f7a81f4be38bd3e1859268d09306918fa303a82c +Author: Kotresh HR +Date: Fri Sep 28 07:48:13 2018 -0400 + + georep: python2 to python3 compatibility-mount write - In the original test case, we create a volume with two bricks, - each on a separate node(N1 & N2). From another node in cluster(N3), - we try to detach a node which is hosting bricks. It fails. + python3 expects byte string for os.write. This works + for both py2 and py3. Fixed the same for geo-rep + mount testing code path. - In the new test, we created volume with single brick on N1. - and from another node in cluster, we tried to detach N1. we - expect peer detach to fail, but peer detach was success as - the node is hosting all the bricks of volume. + Updates: #411 + Change-Id: I2dfedcb0869457707bcca4d2847ef0d52bff1987 + Signed-off-by: Kotresh HR + +commit bf27b8257dba9a0826a3732bc1c763b6f6122a8c +Author: Raghavendra Manjunath +Date: Wed Sep 12 10:24:23 2018 -0400 + + MAINTAINERS: Add Sunny Kumar as a peer for snapshots - Now, changing the new test case to cover the original test case scenario. + Change-Id: I691a56125143fb60735073595d8c5e43273c9bc1 + fixes: bz#1634102 + Signed-off-by: Raghavendra Bhat + +commit f054b511057ada37790bfb518c70d6631ed11d93 +Author: Sanju Rakonde +Date: Sun Sep 23 16:42:54 2018 +0530 + + cli: handle negative scenarios - Please refer https://bugzilla.redhat.com/show_bug.cgi?id=1642597#c1 to - understand why the new test case is not failing in centos-regression. + When control flow reaches negative case code block, we added + "goto out" statement without assigning ret to -1. - > BUG: bz#1642597 + This patch assigns return value to -1, before going to the lable "out". - > Change-Id: Ifda12b5677143095f263fbb97a6808573f513234 - > Signed-off-by: Sanju Rakonde - (cherry picked from commit 0ca6773eaf5aeb507ebc72d2c2f61902eeff414c) + Change-Id: I6db651a3c9ca285ade9ee1ca23d0abe6b36fda3a + updates: bz#1193929 + Signed-off-by: Sanju Rakonde + +commit 1c0facf59a85b1256a52e7a99b30743283a4c9cf +Author: Sunny Kumar +Date: Wed Sep 26 02:58:10 2018 +0530 + + index : fix coverity issues in index.c - fixes: bz#1643078 + This patch fixes CID 1356508 and 1356577. - Change-Id: Ifda12b5677143095f263fbb97a6808573f513234 - Signed-off-by: Sanju Rakonde + Change-Id: I09bc5398fbf6ee49fc066b42aaedf1170df39df8 + updates: bz#789278 + Signed-off-by: Sunny Kumar -commit 888de139580c82347d962f398124e6c6e3ace5f0 -Author: Kotresh HR -Date: Mon Oct 29 18:23:17 2018 +0530 +commit 1f2aa9acb78f6d004c0ea36f9827087484871344 +Author: Niels de Vos +Date: Fri Sep 28 10:46:46 2018 +0200 + + fuse: prevent error message "can't shift that many" + + On systems where /bin/sh is not Bash, running plain mount.glusterfs + gives the unhelpful error "can't shift that many". + + The argument parsing can be a little improved. Adding a check for the + number of arguments, minimal two (Gluster ip:/volume, and mountpoint), + but possibly more (-o, -v etc.). + + With the additional check, running 'mount.glusterfs -h' now shows the + following messags: + + Usage: /sbin/mount.glusterfs : -o + Options: + man 8 mount.glusterfs + To display the version number of the mount helper: /sbin/mount.glusterfs -V + + Change-Id: I50e3ade0c6217fab4155f35ad8cb35d99d52e133 + Fixes: bz#1564890 + Reported-by: Alexander Zimmermann + Signed-off-by: Niels de Vos - geo-rep/scripts: Fix traceback in gluster-mountbroker +commit baeb5fb5cad8ec7158cd7afb36aa7476f081aee7 +Author: Sanju Rakonde +Date: Thu Sep 20 18:45:14 2018 +0530 + + glusterd: fix coverity issues - When 'gluster-mountbroker status' was issued, it - crashes in a corner case with 'str object has not - attribute get'. Fixed the same. + This patch fixes CID 1274175, 1175018. - Backport of: - > BUG: 1643929 - > Signed-off-by: Kotresh HR - > Change-Id: Iaf1a937ed0136b3b2058230c75fa89a215d8a5eb - (cherry picked from commit 5987b3388126a3c5e77481913cbaa4142117d19a) + 1274175: Buffer size warning + 1175018: Resource leak - fixes: bz#1644515 - Signed-off-by: Kotresh HR - Change-Id: Iaf1a937ed0136b3b2058230c75fa89a215d8a5eb + Change-Id: Id18960c249447b8dae35de3ad92bc570e62ddb09 + updates: bz#789278 + Signed-off-by: Sanju Rakonde -commit a2e5f1dbdfff7d1b09b383f5f916d6ae0bc6cb73 -Author: Kotresh HR -Date: Tue Oct 30 10:56:52 2018 +0530 +commit d00a2a1b398346bbdc5ac9b3ba4b09fb1ce1e699 +Author: ShyamsundarR +Date: Fri Sep 28 13:47:33 2018 -0400 - posix/ctime: Avoid log flood in posix_update_utime_in_mdata + mdcache: Fix asan reported potential heap buffer overflow - posix_update_utime_in_mdata() unconditionally logs an error if - consistent time attributes features is not enabled. This log - does not add any value, prints an incorrect errno & floods - the log file. Hence nuking this log message in this patch. + The char pointer mdc_xattr_str in function mdc_xattr_list_populate + is malloc'd and doing a strcat into a malloc'd region can + overflow content allocated based on prior contents of the + memory region. - Backport of: + Added a NULL terimation to the malloc'd region to prevent + the overflow, and treat it as an empty string. - > Patch: https://review.gluster.org/21520/ - > BUG: 1644129 - > Change-Id: I9a1f9e7ada3366d2830f18d81f16a1461040092e - > Signed-off-by: Kotresh HR + Change-Id: If0decab669551581230a8ede4c44c319ff04bac9 + Updates: bz#1633930 + Signed-off-by: ShyamsundarR + +commit 7cf6688e9bb8384b383745751758d747a940ca3f +Author: Sunny Kumar +Date: Wed Sep 26 21:54:06 2018 +0530 + + libglusterfs : fix coverity issue in store.c - fixes: bz#1644526 - Change-Id: I9a1f9e7ada3366d2830f18d81f16a1461040092e - Signed-off-by: Kotresh HR + This patch fixes CID 1395102 and 1395103. + + Change-Id: Ia6093dc6a04dce3f523e015cf1d6d4c6bfccc1f6 + updates: bz#789278 + Signed-off-by: Sunny Kumar -commit 1212fb7330ffe0996c5501de3158e222ab3038b7 -Author: Kotresh HR -Date: Mon Oct 29 17:55:28 2018 +0530 +commit 5b91555a583da1ad7918c3fb16a2d92be1a19e9c +Author: Kaleb S. KEITHLEY +Date: Mon Sep 24 14:12:45 2018 -0400 - georep: python2 to python3 compat - scheduler + python3: assume python3 unless building _packages_ on sys without py3 - 1. scheduler - Popen - 2. syncdutils - corner case on failure + The jenkins release-new job runs on a CentOS 7 box, which does not + have python3. As a result it runs (autogen.sh and) configure before + producing the dist tar file, converting all the python3 shebangs to + python2 shebangs in the dist tar file. - Backport of: - > Patch: https://review.gluster.org/21505 - > BUG: 1643932 - > Change-Id: I65af97a244a8790e976acedc2728db6ebbf2ae10 - > Signed-off-by: Kotresh HR - (cherry picked from commit 33e96100e17e9a293db6d63d9d5449d6c2d69376) + Then when that tar file is "carried" to, e.g. Fedora koji build + system to build packages, the shebangs are incorrect, despite having + originally been correct in the git repo. - fixes: bz#1644514 - Change-Id: I65af97a244a8790e976acedc2728db6ebbf2ae10 - Signed-off-by: Kotresh HR + Change-Id: I5154baba3f6d29d3c4823bafc2b57abecbf90e5b + updates: #411 + Signed-off-by: Kaleb S. KEITHLEY -commit 4a1d413b78440b954eedd0cfae1b76656ed49841 -Author: Kaleb S. KEITHLEY -Date: Fri Oct 26 09:28:59 2018 -0400 +commit 4756e27bbcd8ccc11180843ad23b833e8a5cf22c +Author: Kinglong Mee +Date: Tue Sep 18 07:58:58 2018 -0400 + + rpc: failed requests immediately if rpc connection is down + + In the case glfs_fini is ongoing, some cache xlators like readdir-ahead, + continues to submit requests. Current rpc submit code ignores + connection status and queues these internally generated requests. These + requests then got cleaned up after inode table has been destroyed, + causing crash. + + Change-Id: Ife6b17d8592a054f7a7f310c79d07af005087017 + updates: bz#1626313 + Signed-off-by: Zhang Huan - build/packaging: el-X (x > 7) isms +commit 406aa9809cf7e841f3f5e32fbab0097d4779dca3 +Author: Amar Tumballi +Date: Mon Sep 10 19:28:12 2018 +0530 + + monitoring: create dump dir if it doesn't exist - lvm2(-devel) 2.03.00 no longer has liblvm2app.so. (I expect a - similar change in fedora-30 before too much longer, but for - now fedora-30 still has lvm2 and lvm2-devel 2.02.181 + Fixes: bz#1624006 - rpcgen has been removed from glibc-common and unbundled rpcgen - is now required. + Change-Id: Ie78be72e2492cd02c1376852bb90f1e6661d9bea + Signed-off-by: Amar Tumballi + +commit f1e9b878ce2067db83a0baa5f384eda87287719d +Author: Sanju Rakonde +Date: Tue Sep 25 23:36:48 2018 +0530 + + glusterd: make sure that brickinfo->uuid is not null - And I guess nobody has ever built rpms with '--without bd' or we - would have discovered the attempted inclusion of .../storage/bd.so - in the rpm when it hadn't actually been built. + Problem: After an upgrade from the version where shared-brick-count + option is not present to a version which introduced this option + causes issue at the mount point i.e, size of the volume at mount + point will be reduced by shared-brick-count value times. - Change-Id: I71e26c3d06af5d329ae89cc249a4ad88664ddf53 - updates: bz#1644314 - Signed-off-by: Kaleb S. KEITHLEY + Cause: shared-brick-count is equal to the number of bricks that + are sharing the file system. gd_set_shared_brick_count() calculates + the shared-brick-count value based on uuid of the node and fsid of + the brick. https://review.gluster.org/#/c/glusterfs/+/19484 handles + setting of fsid properly during an upgrade path. This patch assumed + that when the code path is reached, brickinfo->uuid is non-null. + But brickinfo->uuid is null for all the bricks, as the uuid is null + https://review.gluster.org/#/c/glusterfs/+/19484 couldn't reached the + code path to set the fsid for bricks. So, we had fsid as 0 for all + bricks, which resulted in gd_set_shared_brick_count() to calculate + shared-brick-count in a wrong way. i.e, the logic written in + gd_set_shared_brick_count() didn't work as expected since fsid is 0. + + Solution: Before control reaches the code path written by + https://review.gluster.org/#/c/glusterfs/+/19484, + adding a check for whether brickinfo->uuid is null and + if brickinfo->uuid is having null value, calling + glusterd_resolve_brick will set the brickinfo->uuid to a + proper value. When we have proper uuid, fsid for the bricks + will be set properly and shared-brick-count value will be + caluculated correctly. + + Please take a look at the bug https://bugzilla.redhat.com/show_bug.cgi?id=1632889 + for complete RCA + + Steps followed to test the fix: + 1. Created a 2 node cluster, the cluster is running with binary + which doesn't have shared-brick-count option + 2. Created a 2x(2+1) volume and started it + 3. Mouted the volume, checked size of volume using df + 4. Upgrade to a version where shared-brick-count is introduced + (upgraded the nodes one by one i.e, stop the glusterd, upgrade the node + and start the glusterd). + 5. after upgrading both the nodes, bumped up the cluster.op-version + 6. At mount point, df shows the correct size for volume. + + fixes: bz#1632889 + Change-Id: Ib9f078aafb15e899a01086eae113270657ea916b + Signed-off-by: Sanju Rakonde -commit 22c312fc7d456a11b03835edd594f654f20ed10a -Author: Kotresh HR -Date: Thu Oct 25 03:23:56 2018 -0400 +commit 6b273c1644595472d17f08c891aab62cebecbcbe +Author: Kinglong Mee +Date: Tue Sep 18 07:38:48 2018 -0400 - geo-rep: Fix issue in gfid-conflict-resolution + libgfapi: fix use after freed of clnt when dispatching events - Problem: - During gfid-conflict-resolution, geo-rep crashes - with 'ValueError: list.remove(x): x not in list' + Avoid dispatching events to mgmt after freed, + unreference mgmt after the event_dispatch_destroy. - Cause and Analysis: - During gfid-conflict-resolution, the entry blob is - passed back to master along with additional - information to verify it's integrity. If everything - looks fine, the entry creation is ignored and is - deleted from the original list. But it is crashing - during removal of entry from the list saying entry - not in list. The reason is that the stat information - in the entry blob was modified and sent back to - master if present. + Change-Id: I5b762b37901de70a955661df0aff95bf055ba4ea + updates: bz#1626313 + Signed-off-by: Kinglong Mee + +commit 341ba81448e869ae388b4b37556e47f6bf7413a5 +Author: Yaniv Kaul +Date: Sun Sep 23 11:04:22 2018 +0300 + + Quota related files: use dict_{setn|getn|deln|get_int32n|set_int32n|set_strn} - Fix: - Send back the correct stat information for - gfid-conflict-resolution. + In a previous patch (https://review.gluster.org/20769) we've + added the key length to be passed to dict_* funcs, to remove the need + to strlen() it. This patch moves some code to use it. + Please review carefully. + Compile-tested only! - Backport of: - > BUG: bz#1642865 - > Change-Id: I47a6aa60b2a495465aa9314eebcb4085f0b1c4fd - > Signed-off-by: Kotresh HR - (cherry picked from commit ff18121945bff394f3234e9f1a9d61ac97d4d493) + updates: bz#1193929 + Signed-off-by: Yaniv Kaul - fixes: bz#1644158 - Change-Id: I47a6aa60b2a495465aa9314eebcb4085f0b1c4fd - Signed-off-by: Kotresh HR + Change-Id: If4f425a9827be7c36ccfbb9761006ae824a818c6 -commit c10803f9712a8bc2ac18b71189dca4b7fc80d25e -Author: Kotresh HR -Date: Mon Oct 29 18:08:28 2018 +0530 +commit 064b24900e1f5e3ba3087f7c6a0249613ebed61f +Author: Sheetal Pamecha +Date: Mon Sep 24 16:37:51 2018 +0530 - cliutils: python2 to python3 compat + cluster/ec: variable-length array (VLA) declaration clang fix - Make Popen py2 and py3 compatiable + Problem: variable-length array size becomes zero - Backport of: + Modified array size to size+1 while declaring - > BUG: 1643935 - > Change-Id: Ife34cb38024dcdc0420436e7d76fd208223f9d86 - > Signed-off-by: Kotresh HR - (cherry picked from commit bae584148761ad98cd3d5c380f8cea1ff83aa8c3) + Updates: bz#1622665 - fixes: bz#1644161 - Change-Id: Ife34cb38024dcdc0420436e7d76fd208223f9d86 - Signed-off-by: Kotresh HR + Change-Id: I98ee8447c87f37c36c49f50058292e8c1757a1f9 + Signed-off-by: Sheetal Pamecha -commit 7072841fbd82fc14c48ced8eba18ee6626632660 -Author: root -Date: Thu Oct 25 05:47:23 2018 -0400 +commit 5ad31b5b17fa220c9b26b6df730e127c76448ac5 +Author: Iraj Jamali +Date: Mon Sep 24 15:12:25 2018 +0530 - afr/lease: Read child nodes from lease structure + features/locks: NULL pointer deferencing clang fix - For lease operation, we allocate and store child nodes - data in lease structure. Use the same in afr_lease_cbk() - while checking for the quorum. + Added checks to avoid NULL pointer dereferencing - Change-Id: If1fdd5a0798888afd39ad3df57d96487baf9d1e6 - updates: #350 - Signed-off-by: Soumya Koduri + Updates: bz#1622665 + + Change-Id: I8e441c2931f406a6012e418127550bdf454a599a + Signed-off-by: Iraj Jamali -commit dc775c4ae052d1e9d0f61ace3be999f73f0ffa23 -Author: Ravishankar N -Date: Thu Nov 1 21:31:41 2018 +0530 +commit 65aed1070cc2e44959cf3a0fbfde635de7e03103 +Author: Kotresh HR +Date: Mon Sep 24 21:18:30 2018 +0530 - index: prevent arbitrary file creation outside entry-changes folder + georep: python3 compatibility (Popen) - Patch in master: https://review.gluster.org/#/c/glusterfs/+/21534/ + The file objects for python3 by default is opened + in binary mode where as in python2 it's opened + as text by default. - Problem: - A compromised client can set arbitrary values for the GF_XATTROP_ENTRY_IN_KEY - and GF_XATTROP_ENTRY_OUT_KEY during xattrop fop. These values are - consumed by index as a filename to be created/deleted according to the key. - Thus it is possible to create/delete random files even outside the gluster - volume boundary. + The geo-rep code parses the output of Popen assuming + it as text, hence used the 'universal_newlines' flag + which provides backward compatibility for the same. - Fix: - Index expects the filename to be a basename, i.e. it must not contain any - pathname components like "/" or "../". Enforce this. + Change-Id: I371a03b6348af9666164cb2e8b93d47475431ad9 + Updates: #411 + Signed-off-by: Kotresh HR + +commit 89636be4c73b12de2e11c75d8e59527bb243f147 +Author: Kotresh HR +Date: Mon Sep 3 09:07:58 2018 -0400 + + ctime: Provide noatime option - Fixes: CVE-2018-14654 + Most of the applications are {c|m}time dependant + and very few are atime dependant. So provide noatime + option to not update atime when ctime feature is + enabled. - Fixes: bz#1646204 - Change-Id: I35f2a39257b5917d17283d0a4f575b92f783f143 - Signed-off-by: Ravishankar N + Also this option has to be enabled with ctime + feature to avoid unnecessary self heal. Since + AFR/EC reads data from single subvolume, atime + is only updated in one subvolume triggering self + heal. + + updates: bz#1593538 + Change-Id: I085fb33c882296545345f5df194cde7b6cbc337e + Signed-off-by: Kotresh HR -commit 58d9fa81d75eda84423d0c0ef45fd20b07582a93 -Author: Soumya Koduri -Date: Mon Oct 22 21:16:53 2018 +0530 +commit c006434c4f6d5762e826bd2ecc414b6d332d66c9 +Author: Sunny Kumar +Date: Mon Aug 20 17:54:32 2018 +0530 - leases:Mark the fop conflicting if lease_id not set - - Glusterfs leases expects lease_id to be set and sent - for each fop to determine conflict resolution with the - existing lease. - Incase if not set (most likely if there is an older - client in a mixed cluster), it makes sense to consider - it as conflicitng fop and recall the lease. + nfs : fix coverity issues - Also fixed the return status check for __remove_lease(), - wherein non-negative value is considered as success case. + Fixes 1388608 and 1274073. - Change-Id: I5bcfba4f7c71a5af7cdedeb03436d0b818e85783 - updates: #350 - Signed-off-by: Soumya Koduri - (cherry picked from commit cf5b13896d65b6916634976a3a5f61ddeefbc19c) + updates: bz#789278 + Change-Id: Ibe2b948ae3b02feb938caffe81b2e484b4c7b221 + Signed-off-by: Sunny Kumar -commit 686849beb424b8b0ebd17b21a9cc201f252f3547 -Author: Ravishankar N -Date: Sun Oct 21 17:32:52 2018 +0530 +commit 62164ac0d242a271f19b0e0bb352af5f7df082ce +Author: Kotresh HR +Date: Mon Sep 24 20:43:54 2018 +0530 - tests: check for shd up status in bug-1637802-arbiter-stale-data-heal-lock.t + georep: Fix python3 compatibility (configparser) - Problem: - https://review.gluster.org/#/c/glusterfs/+/21427/ seems to be failing - this .t spuriously. On checking one of the failure logs, I see: + '%' needs special handling in config and also removed + duplicate misspelled 'changelog-archive-format' config. - 22:05:44 Launching heal operation to perform index self heal on volume patchy has been unsuccessful: - 22:05:44 Self-heal daemon is not running. Check self-heal daemon log file. - 22:05:44 not ok 20 , LINENUM:38 + Updates: #411 + Change-Id: I33621a62bdf5f781ee62e6cedec0c2df3f5d70cf + Signed-off-by: Kotresh HR + +commit 173e89a6506bc8c727ce6d8e5ac84b59ad2e21de +Author: Kotresh HR +Date: Mon Sep 24 20:56:21 2018 +0530 + + georep: Fix python3 compatibility (os.pipe) - In glusterd log: - [2018-10-18 22:05:44.298832] E [MSGID: 106301] [glusterd-syncop.c:1352:gd_stage_op_phase] 0-management: Staging of operation 'Volume Heal' failed on localhost : Self-heal daemon is not running. Check self-heal daemon log file + 'os.pipe' returns pair of file descriptors + which are non-inheritable by child processes. + But geo-rep uses te inheritable nature of + pipe fds to communicate between parent and + child processes. Hence wrote a compatiable + pipe routine which works well both with python2 + and python3 with inheritable nature. - But the tests which preceed this check whether via a statedump if the shd is - conected to the bricks, and they have succeeded and even started - healing. From glustershd.log: + Updates: #411 + Change-Id: I869d7a52eeecdecf3851d44ed400e69b32a612d9 + Signed-off-by: Kotresh HR + +commit 8f207feb260bc6112d5085859b43efc8378a4c5f +Author: Vijay Bellur +Date: Mon Sep 24 13:21:58 2018 -0700 + + features/marker: Avoid passing structures as parameters to functions - [2018-10-18 22:05:40.975268] I [MSGID: 108026] [afr-self-heal-common.c:1732:afr_log_selfheal] 0-patchy-replicate-0: Completed data selfheal on 3b83d2dd-4cf2-4ea3-a33e-4275be40f440. sources=[0] 1 sinks=2 + Fixes CIDs: 1388779,1390242,1390057 - So the only reason I can see launching heal via cli failing is a race where - shd has been spawned but glusterd has not yet updated in-memory that it is up, - and hence failing the CLI. + The patch does the following: - Fix: - Check for shd up status before launching heal via CLI + 1. Changes the prototype of mq_inspect_file_xattr() and mq_xattr_state() + to have a parameter of struct iatt * instead of struct iatt. + 2. Remove unneeded struct iatt parameter from + mq_inspect_directory_xattr() - Change-Id: Ic88abf14ad3d51c89cb438db601fae4df179e8f4 - fixes: bz#1641872 - Signed-off-by: Ravishankar N - (cherry picked from commit 3dea105556130abd4da0fd3f8f2c523ac52398d1) + Change-Id: I1f6eabda042f0fe56d8c9bca010302f5e518dbe4 + updates: bz#789278 + Signed-off-by: Vijay Bellur -commit 02a05da6989f5cd4283e2e5d62a9cfa6493d65dc -Author: Krutika Dhananjay -Date: Fri Oct 5 11:32:21 2018 +0530 +commit f1b2455b9d01bae8c4652fc3583a60ff7000410e +Author: Sanju Rakonde +Date: Fri Sep 21 16:03:22 2018 +0530 - features/shard: Hold a ref on base inode when adding a shard to lru list + glusterd: fix coverity issues - Backport of: - > Change-Id: Ic15ca41444dd04684a9458bd4a526b1d3e160499 - > Signed-off-by: Krutika Dhananjay - > (cherry picked from commit e627977) - > BUG: 1605056 - - In __shard_update_shards_inode_list(), previously shard translator - was not holding a ref on the base inode whenever a shard was added to - the lru list. But if the base shard is forgotten and destroyed either - by fuse due to memory pressure or due to the file being deleted at some - point by a different client with this client still containing stale - shards in its lru list, the client would crash at the time of locking - lru_base_inode->lock owing to illegal memory access. + This patch addreeses CID 1124812, 11248123, 1124833, + and 1351706 - So now the base shard is ref'd into the inode ctx of every shard that - is added to lru list until it gets lru'd out. + 1. We have a null check after GF_ASSERT. GF_ASSERT does + a null check and fails if it is null. So removing the + redundant null checks. - The patch also handles the case where none of the shards associated - with a file that is about to be deleted are part of the LRU list and - where an unlink at the beginning of the operation destroys the base - inode (because there are no refkeepers) and hence all of the shards - that are about to be deleted will be resolved without the existence - of a base shard in-memory. This, if not handled properly, could lead - to a crash. + 2. Added a log message to avoid unused value coverity issue - Change-Id: Ic15ca41444dd04684a9458bd4a526b1d3e160499 - updates: bz#1641440 - Signed-off-by: Krutika Dhananjay + Change-Id: Ib0d6dad8f40474afc8e5e60a531d37247cc8a081 + updates: bz#789278 + Signed-off-by: Sanju Rakonde -commit ecdc33ada79f155f2bde2860b29872526939e22b -Author: Krutika Dhananjay -Date: Wed Oct 17 14:26:14 2018 +0530 +commit 31dcbb61487ac82b5ae61435add98b0fd1d5e8cc +Author: Shwetha Acharya +Date: Mon Sep 24 15:03:18 2018 +0530 - storage/posix: Do not fail entry creation fops if gfid handle already exists + mgmt/glusterd: NULL pointer dereferencing clang fix - Backport of: - > Change-Id: I84a5e54d214b6c47ed85671a880bb1c767a29f4d - > Signed-off-by: Krutika Dhananjay - > (cherry picked from commit 15c9976) - > BUG: 1638453 + Added a condition check to resolve the issue - PROBLEM: - tests/bugs/shard/bug-1251824.t fails occasionally with EIO due to gfid - mismatch across replicas on the same shard when dd is executed. + Change-Id: I1954e91f7487c052caf5cf98c954d204242f0af9 + Updates: bz#1622665 + Signed-off-by: Shwetha Acharya + +commit 5a3d87fd1239500873c31d38838706b64dbb1b91 +Author: Ashish Pandey +Date: Mon Sep 24 14:50:24 2018 +0530 + + cluster/ec: Fix failure of tests/basic/ec/ec-1468261.t - CAUSE: - Turns out this is due to a race between posix_mknod() and posix_lookup(). + Problem: + In this test we are relying on eager-lock time + duration of 1 second to delay the post op + unlock phase + of an entry fop so that in this 1 second we can kill 2 + bricks and dirty on directory could be set. - posix mknod does 3 operations, among other things: - 1. creation of the entry itself under its parent directory - 2. setting the gfid xattr on the file, and - 3. creating the gfid link under .glusterfs. + Solution: + To fix this issue, we should set the others.eager-lock + option to "ON" explicitly in the beginning of this test. - Consider a case where the thread doing posix_mknod() (initiated by shard) - has executed steps 1 and 2 and is on its way to executing 3. And a - parallel LOOKUP from another thread on noting that loc->inode->gfid is NULL, - tries to perform gfid_heal where it attempts to create the gfid link - under .glusterfs and succeeds. As a result, posix_gfid_set() through - MKNOD (step 3) fails with EEXIST. + Change-Id: I19bbb9c15d7bdf96a96b20587c618192d0b740ef + fixes bz#1632161 + Signed-off-by: Ashish Pandey + +commit b64d08b56f5e76a6d337d6f6c81baec8a0ed7500 +Author: Kaleb S. KEITHLEY +Date: Fri Sep 14 13:42:20 2018 -0400 + + api: old and new versioned symbols must appear in each section of gfapi.map - In the older code, MKNOD under such conditions was NOT being treated - as a failure. But commit e37ee6d changes this behavior by failing MKNOD, - causing the entry creation to be undone in posix_mknod() (it's another - matter that the stale gfid handle gets left behind if lookup has gone - ahead and gfid-healed it). - All of this happens on only one replica while on the other MKNOD succeeds. + It's probably not clear in .../doc/developer-guide/gfapi-symbol-versions.md + that this is necessary, but it is. - Now if a parallel write causes shard translator to send another MKNOD - of the same shard (shortly after AFR releases entrylk from the first - MKNOD), the file is created on the other replica too, although with a - new gfid (since "gfid-req" that is passed now is a new UUID. This leads - to a gfid-mismatch across the replicas. + Change-Id: I0a8a74e3ecf474c93583f5ebc97507c4277542b0 + updates: bz#1193929 + Signed-off-by: Kaleb S. KEITHLEY + +commit 607b91747574bb912477df5dd11c4e31cde4c0bf +Author: Susant Palai +Date: Mon Sep 17 12:18:13 2018 +0530 + + dht: Coverity fixes - FIX: - The solution is to not fail MKNOD (or any other entry fop for that matter - that does posix_gfid_set()) if the .glusterfs link creation fails with EEXIST. + CID: 1274236 Issue: Logically dead code (op_errno will never be -1) + CID: 1351652 Issue: Dereference after null check. + (local->fd is dereferenced anyway and it should not be NULL ever for + dht_readdirp_cbk.) - Change-Id: I84a5e54d214b6c47ed85671a880bb1c767a29f4d - fixes: bz#1641429 - Signed-off-by: Krutika Dhananjay + Change-Id: Ied9c5f5b72536be1ca944237165acdc62b792e58 + updates: bz#789278 + Signed-off-by: Susant Palai -commit ab12861f40a767b9b87c98a7b9ccee3afcc30185 -Author: ShyamsundarR -Date: Mon Oct 15 13:59:16 2018 -0400 +commit 48a06e0eaff8b613c3e05d8168e8faff838b727f +Author: Milind Changire +Date: Mon Sep 24 17:53:35 2018 +0530 - doc: Update release 5.0 release notes + glusterfind: add logs to identify parsing phases - - Added missing options - - Added bugs fixed + Add logs to idenitfy start and finish of changelog parsing phases. - Change-Id: I3b788a093bc00fb977f792ce535ed50cc0cd9c9e - Updates: bz#1628620 - Signed-off-by: ShyamsundarR + Change-Id: Id250231f2af7829f887401d30ac98875ae1ae793 + fixes: bz#1632236 + Signed-off-by: Milind Changire -commit 2f2872b335018a7fa4b61193f2e6404bef8864ed -Author: Soumya Koduri -Date: Wed Oct 10 21:37:07 2018 +0530 +commit 81ea27c82c30282dd1fb7d67458aa874b33f6797 +Author: Xavi Hernandez +Date: Fri Sep 21 21:51:46 2018 +0200 - gfapi: Bug fixes in leases processing code-path + Update database profile group - This patch fixes below issues in gfapi lease code-path - * 'glfs_setfsleasid' should allow NULL input to be - able to reset leaseid - * Applications should be allowed to (un)register for - upcall notifications of type GLFS_EVENT_LEASE_RECALL - * APIs added to read contents of GLFS_EVENT_LEASE_RECALL - argument which is of type "struct glfs_upcall_lease" + Some performance testing has revealed that pgbench performs 3x better + when these options are set: - This is backport of the below mainline patch - - https://review.gluster.org/#/c/glusterfs/+/21391 + performance.client-io-threads=on + performance.open-behind=on + performance.read-after-open=yes + server.event-threads=4 + client.event-threads=4 - Change-Id: I3320ddf235cc82fad561e13b9457ebd64db6c76b - updates: #350 - Signed-off-by: Soumya Koduri + Change-Id: I36ce389f893a8af13aac5f8285104d749b73d098 + fixes: bz#1631886 + Signed-off-by: Xavi Hernandez -commit fadf0c8dc600c57142b012fea5becf016fa1929e -Author: Kaleb S. KEITHLEY -Date: Mon Oct 15 08:26:32 2018 -0400 +commit 257f71ea0ca30ddac2a202bb250df6bfa652751b +Author: Sunny Kumar +Date: Mon Sep 24 15:26:01 2018 +0530 - core: libuuid-devel breakage + geo-rep : fix log message in master.py - The #include "uuid.h" left over from using .../contrib/uuid is debatably - incorrect now that we use the "system header" file /usr/include/uuid/uuid.h - from libuuid-devel. + This patch fixes spell mistake in log message. - Unfortunately this is complicated by things like FreeBSD having its own - /usr/include/uuid.h, and the e2fsprogs-libuuid uuid.h in installed - as - most third-party packages in FreeBSD are - in /usr/local as - /usr/local/include/uuid/uuid.h + Change-Id: I84779c64aef6698cbc1a60ae1a82533e8a6a6e3d + updates: bz#1193929 + Signed-off-by: Sunny Kumar + +commit 8297b909ab88e5ddb591cfb5aff0f06d14bd90cc +Author: Nigel Babu +Date: Fri Sep 14 19:06:41 2018 +0530 + + python3: Fix python3 compatibility - With a system header file it should at least be #include , and - even better as #include , much like the way - and are included. Using #include guarantees - not getting the /usr/include/uuid.h on FreeBSD, but clang/cc knows to - find "system" header files like this in /usr/local/include; with or - without the -I/... from uuid.pc. Also using #include "uuid.h" leaves - the compiler free to find a uuid.h from any -I option it might be passed. - (Fortunately we don't have any at this time.) + Updates: #411 + Change-Id: I7c1eaa92cd4ac05c3667b760e0db2cddcfbbaed8 + Signed-off-by: Nigel Babu + +commit b7732b9c069179aaa71a3463400fa438d1769f6c +Author: Sanju Rakonde +Date: Fri Sep 21 12:45:12 2018 +0530 + + glusterd: reduce length allocated to name - As we now require libuuid-devel or e2fsprogs-libuuid and configure will - exit with an error if the uuid.pc file doesn't exist, the HAVE_LIBUUID - (including the #elif FreeBSD) tests in compat-uuid.h are redundant. We - are guaranteed to have it, so testing for it is a bit silly IMO. It may - also break building third party configure scripts if they omit defining - it. (Just how hard do we want to make things for third party developers?) + In glusterd_proc_ and glusterd_svc_ structures name is having + length of PATH_MAX, allocating NAME_MAX will be sufficient. - Change-Id: I7317f63c806281a5d27de7d3b2208d86965545e1 - updates: bz#1639688 - Signed-off-by: Kaleb S. KEITHLEY + Change-Id: I637ba00e1a80ca6a1ecc0c2dbf180c4633c1ca5b + updates: bz#1193929 + Signed-off-by: Sanju Rakonde -commit 7e918e9a0724fd50a672fa5a9c844af7f903e9fc -Author: N Balachandran -Date: Wed Oct 17 18:48:19 2018 +0530 +commit 28bc9e4bf74fd31a9620478b0a0ed482798b5915 +Author: Sanju Rakonde +Date: Fri Sep 21 11:55:12 2018 +0530 - debug/io-stats: io stats filenames contain garbage + glusterd: fix resource leak coverity issues - As dict_unserialize does not null terminate the value, - using snprintf adds garbage characters to the buffer - used to create the filename. - The code also used this->name in the filename which - will be the same for all bricks for a volume. The - files were thus overwritten if a node contained - multiple bricks for a volume. The code now uses - the conf->unique instead if available. + This patch addresses CID 1288098,1370948 and 1382454 - Change-Id: I2c72534b32634b87961d3b3f7d53c5f2ca2c068c - fixes: bz#1640392 - Signed-off-by: N Balachandran - (cherry picked from commit 219cd649fdbd7bfd6c2268a0a4f66bcc15918e31) + key_fixed is allocated with memory but missed to free it. + + updates: bz#789278 + Change-Id: Iea805c668ba89759313f9e21b328757e570be97b + Signed-off-by: Sanju Rakonde -commit 5bc2fd4fc6a8aa65d8d2b2c22ffb6c5b70ef9dac -Author: Raghavendra Gowdappa -Date: Fri Oct 12 10:31:04 2018 +0530 +commit 27402fcb27a7e9ea32a6a04fdc21b59af6320bb4 +Author: Sanju Rakonde +Date: Thu Sep 20 11:37:36 2018 +0530 - api: fill out attribute information if not valid + glusterd: fix coverity issues in glusterd-locks.c - translators like readdir-ahead selectively retain entry information of - iatt (gfid and type) when rest of the iatt is invalidated (for write - invalidating ia_size, (m)(c)times etc). Fuse-bridge uses this - information and sends only entry information in readdirplus - response. However such option doesn't exist in gfapi. This patch - modifies gfapi to populate the stat by forcing an extra lookup. + This patch addresses CID 1395254, CID 1382436. - Thanks to Shyamsundar Ranganathan and Prashanth - Pai for tests. + We are allocating memory to mgmt_lock_timer and key_dup. while doing + GF_VALIDATE_OR_GOTO for mgmt_lock_timer_xl or mgmt_lock_timer_ctx, + if it is null going to out without freeing the memory. This patch + will fix the issues. - Change-Id: Ieb5f8fc76359c327627b7d8420aaf20810e53000 - Fixes: bz#1630804 - Signed-off-by: Raghavendra Gowdappa - Signed-off-by: Soumya Koduri - (cherry picked from commit 6257276d9de3f15643f159b2ec627a67c84fc23d) + updates: bz#789278 + Change-Id: Ic6bfb2052982b16373f90cbbc53d2b2da052c01f + Signed-off-by: Sanju Rakonde + +commit f72f18b3bf7f9535827a059a5090476b3141723f +Author: Atin Mukherjee +Date: Fri Sep 21 12:11:40 2018 +0530 + + glusterd: don't wait for blockers flag for stop volume + + With commit 4f6ae8 even though the overall transaction time for gluster + volume stop can be reduced, but based on testing it can't be guaranteed + that the transaction can finish in 3 minutes before the unlock timer + gets kicked in. The ground problem to this is the command serialization + which atomic field 'blockers' does for volume stop operation. + + This patch removes that dependency for volume stop not to wait for + blockers. + + Change-Id: Ifaf120115dc7ed21cf21e65e25c4ec7c61ab8258 + Fixes: bz#1631128 + Signed-off-by: Atin Mukherjee -commit 34e8058b7c8e906c889d6d0e155ea63037148eea +commit 9d8f5a34c1ff4ae512f80fe9651508ae201c273e Author: Ravishankar N -Date: Thu Oct 11 07:22:09 2018 +0530 +Date: Thu Sep 20 10:14:26 2018 +0530 afr: fix incorrect reporting of directory split-brain - Backport of https://review.gluster.org/#/c/glusterfs/+/21135/ - Problem: When a directory has dirty xattrs due to failed post-ops or when replace/reset brick is performed, AFR does a conservative merge as @@ -1936,115 +10109,62 @@ split-brains. For directories, if spit-brain flag is not set,just show them as needing heal and not being in split-brain. + Fixes: bz#1626994 Change-Id: I09ef821f6887c87d315ae99e6b1de05103cd9383 - fixes: bz#1638163 Signed-off-by: Ravishankar N -commit c7b933bc460bf47a8d4404055bf1a52225a138cb -Author: Ravishankar N -Date: Thu Oct 11 06:31:40 2018 +0530 +commit d901308a06c38fa53a3b07ed1641522a3248378d +Author: Ashish Pandey +Date: Tue Sep 18 14:51:10 2018 +0530 - afr: prevent winding inodelks twice for arbiter volumes - - Backport of https://review.gluster.org/#/c/glusterfs/+/21380/ - - Problem: - In an arbiter volume, if there is a pending data heal of a file only on - arbiter brick, self-heal takes inodelks twice due to a code-bug but unlocks - it only once, leaving behind a stale lock on the brick. This causes - the next write to the file to hang. + glusterfsd/mgmt : Check for NULL after creating frame - Fix: - Fix the code-bug to take lock only once. This bug was introduced master - with commit eb472d82a083883335bc494b87ea175ac43471ff + CID: 1382390 - Thanks to Pranith Kumar K for finding the RCA. + https://scan6.coverity.com/reports.htm#v42607/p10714fileInstanceId=85472585&defectInstanceId=26074725&mergedDefectId=1382390 - fixes: bz#1638159 - Change-Id: I15ad969e10a6a3c4bd255e2948b6be6dcddc61e1 - Signed-off-by: Ravishankar N + Change-Id: Iade073a5e72f29ad5e8f372955869bc287eb9793 + updates: bz#789278 + Signed-off-by: Ashish Pandey -commit ba12c00f6d5b1e79796c1cb03f87035ebafd7f19 -Author: Sunny Kumar -Date: Tue Oct 9 12:43:32 2018 +0530 +commit 30bfd1eb411fd762c36b77693da7ea6d73ea31c1 +Author: Sheetal Pamecha +Date: Tue Sep 18 16:34:07 2018 +0530 - cliutils : python2 to python3 compat - - This patch fixes import issue in cliutils. - - Provided solution is to use relative import. + ctr: NULL pointer dereferencing clang fix - Change-Id: I14c9a0b528ef52e7c91f6b17b569c68c2ced8912 - updates: #411 - Signed-off-by: Sunny Kumar - (cherry picked from commit 8d4c5e022bba1b99786ce13f407c27024beccc23) - -commit 84a3d43079cfe8cf6a374defa86a345124d5901c -Author: Kotresh HR -Date: Wed Oct 3 00:45:09 2018 -0400 - - georep: python2 to python3 compat - syscalls + Replaced this->name with "ctr" - 1. ctypes/syscalls - A) arguments is expected to be encoded - B) Raw conversion of return value from bytearray into string - 2. struct pack/unpack - Raw converstion of string to bytearray - 3. basestring -> str + Updates: bz#1622665 - Updates: #411 - Change-Id: I80f939adcdec0ed0022c87c0b76d057ad5559e5a - Signed-off-by: Kotresh HR - (cherry picked from commit fb6e8d0d0ca21b16d331fa69da9b9dadf6c5c35d) + Change-Id: I49af42a5d77c98ffb34224c8800757b8986012ea + Signed-off-by: Sheetal Pamecha -commit 324384ca48944662fecdffe72faa5d2c5872eb5f -Author: Kotresh HR -Date: Sat Oct 6 09:20:24 2018 +0530 +commit bbcec1a1caf95aad581083e7131feda04295f299 +Author: Shwetha Acharya +Date: Tue Sep 18 15:40:29 2018 +0530 - events: python2 to python3 compat - - 1. Fix imports - 2. Use universal_newlines flag in Popen - 3. encode msg used in 'sendto' + nfs/server: NULL pointer dereferencing clang fix - Updates: #411 - Change-Id: Ieacdc2ba86953ff3a2e9d9b9a97157e8e0e36836 - Signed-off-by: Kotresh HR - (cherry picked from commit b5f75e337c19d4fed85d4dcf15cf47f02fea5f6a) + Added some condition checks in nfs3.c and nlm4.c + Updates: bz#1622665 + Change-Id: Ia10b8fff14f651df1360c9bb79d4476b282f54b5 + Signed-off-by: Shwetha Acharya -commit 3a962b17ad82a7a80da804550cfdf84ec4ec82fd -Author: Aravinda VK -Date: Mon Sep 17 14:16:09 2018 +0530 +commit 2fd9d62691056b9f0601dbc2bf6f42626b015d07 +Author: Sunny Kumar +Date: Fri Sep 21 00:40:46 2018 +0530 - posix: Fix exporting default value for `export-statfs-size` - - No default value was specified for `export-statfs-size` in posix - option table. Glusterd2 sets default value as `off` since the - option type is `bool`. Posix treats `export-statfs-size=on` if - not specified in volfile(That means default value is `on`) - - This patch sets default value as `on` - - > Change-Id: I5c6341183be9b62a78fdbc94621220f9284e1382 - > updates: #302 - > Signed-off-by: Aravinda VK - - (cherry picked from commit 07088d95e450f847722e5decbfa5da18a0dbd9de) + block : fix coverity in bd.c - Change-Id: Ib6b3accdb9921376c16040bd2312b99b0226a26f - Fixes: bz#1636842 - Signed-off-by: Aravinda VK - -commit a94a67efde4e5095a60f4368739192e0ad116070 -Author: ShyamsundarR -Date: Fri Sep 28 14:54:54 2018 -0400 - - doc: Initial release notes for 5.0 + This patch fixes CID 1288097, 1128921, and 1128918 + all of type RESOURCE_LEAK. - Change-Id: Id2ed7e04fc7fe708a144ac09c69b837956aedb94 - Updates: bz#1628620 - Signed-off-by: ShyamsundarR + Change-Id: If39be19c6310eab9880de6f0bebb4f38604a40b2 + updates: bz#789278 + Signed-off-by: Sunny Kumar -commit 45b5b48bc1e21099ab04cf0b1d432c6cb015cc05 +commit ece878fac815db5a1ea4d0078a48a05dbcc0c276 Author: Pranith Kumar K Date: Tue Sep 18 12:15:57 2018 +0530 @@ -2089,11 +10209,203 @@ postgresql benchmark performance changed from ~1130 TPS to ~2300TPS randio fio job inside Ovirt based VM went from ~600IOPs to ~2000IOPS - fixes bz#1635972 + fixes bz#1630368 Change-Id: If7f7388d2f08cf7f17ca517a4ea222560661dc36 Signed-off-by: Pranith Kumar K -commit 320901d1dc9e1d4b2985e7277ca22816e7936f2f +commit 3de6ba0cd369d1be957d25f96a0e460c9dd004a2 +Author: Krutika Dhananjay +Date: Wed Sep 19 15:49:27 2018 +0530 + + extras: Add new options to group "virt" + + In some of the recent performance tests on gluster-as-vm-image-store + use-case, it has been observed that sometimes the lone fuse thread can + hit near-100% CPU utilization and become a performance bottleneck. + Enabling client-io-threads (in addition to bumping up epoll threads on + server and client side) has shown to be helpful in getting around this + bottleneck and pushing more IOPs. + + Change-Id: I231db309de0e37c79cd44f5666da4cd776fefa04 + fixes: bz#1630798 + Signed-off-by: Krutika Dhananjay + +commit b139bc58eb504adf5ef81658896c9283ae21f390 +Author: Susant Palai +Date: Mon Sep 3 15:49:02 2018 +0530 + + dht: Operate internal fops with negative pid + + With root-squash on, all root credentials are converted to a + random uid, gid(65535). And ideally this does not carry the necessary + permission bits to carry out the operation. But posix-acl will allow + operations from this inode as long as its ctx has the ngroup information + and ngroup has the owner group information. + + The problem we ran into recently was somehow posix-acl xlator did not + cache the ngroup info and some of the dht internal fops(layout setxattr) + failed with root-squash enabled. + + DHT internal fops now use a negative pid to pretend that the operation + is from an internal client so posix-acl allows them to pass + + Change-Id: I5bb8d068389bf4c94629d668a16015a95ccb53ab + fixes: bz#1624796 + Signed-off-by: Susant Palai + +commit 5e8fd8b465761e6ab09187abd56ce9930652866b +Author: Sanju Rakonde +Date: Wed Sep 19 18:38:01 2018 +0530 + + tests: fix test case failure + + tests/bugs/glusterd/bug-1595320.t is failing in downstream. + In downstream repo, enabling the brick multiplexing made + interactive, so it will throw an prompt for the user input. + As no input is provided during the test case execution, the + test is failing. + + Using macro CLI instead of using gluster command, will + bypass the interacive commands. so replacing the gluster + command with CLI macro will address the issue. + + Change-Id: I6b39052d8e415a8ed08de7c80a91dadce155146a + updates: bz#1193929 + Signed-off-by: Sanju Rakonde + +commit 649e4378ad8e3a08f24322ea7c44a3903a6a6ce4 +Author: Harpreet Lalwani +Date: Tue Sep 18 12:31:02 2018 +0530 + + Quota: NULL pointer dereferencing clang Fix + + Added ternary operator to avoid NULL pointer dereferencing + + Updates: bz#1622665 + + Change-Id: I903ec1973fd4bb6473d16e2680bd86ac3a20e093 + Signed-off-by: Harpreet Lalwani + +commit 65bd1e2f94781bea5ad6eeb5b4d9f9f614660085 +Author: Ashish Pandey +Date: Tue Sep 18 17:09:28 2018 +0530 + + storage/posix: Check if fd->inode is NULL before using it + + CID: 1395473, 1395472 + + https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=85588219&defectInstanceId=26115956&mergedDefectId=1395472 + https://scan6.coverity.com/reports.htm#v42607/p10714/fileInstanceId=85588219&defectInstanceId=26115961&mergedDefectId=1395473 + + Change-Id: I2c3cc350e0ac156616df6f568ba28dbfa68064bf + updates: bz#789278 + Signed-off-by: Ashish Pandey + +commit 5784a00f997212d34bd52b2303e20c097240d91c +Author: karthik-us +Date: Wed May 30 15:27:52 2018 +0530 + + cluster/afr: Use 2 domain locking in SHD for thin-arbiter + + With this change when SHD starts the index crawl it requests + all the clients to release the AFR_TA_DOM_NOTIFY lock so that + clients will know the in memory state is no more valid and + any new operations needs to query the thin-arbiter if required. + + When SHD completes healing all the files without any failure, it + will again take the AFR_TA_DOM_NOTIFY lock and gets the xattrs on + TA to see whether there are any new failures happened by that time. + If there are new failures marked on TA, SHD will start the crawl + immediately to heal those failures as well. If there are no new + failures, then SHD will take the AFR_TA_DOM_MODIFY lock and unsets + the xattrs on TA, so that both the data bricks will be considered + as good there after. + + Change-Id: I037b89a0823648f314580ba0716d877bd5ddb1f1 + fixes: bz#1579788 + Signed-off-by: karthik-us + +commit 4f6ae853ffa9d06446407f389aaef61ac0b3b424 +Author: Mohit Agrawal +Date: Wed Sep 19 14:32:22 2018 +0530 + + glusterd: Use GF_ATOMIC to update 'blockers' counter at glusterd_conf + + Problem: + Currently in glusterd code uses sync_lock/sync_unlock to update blockers + counter which could add delays to the overall transaction phase + escpecially when there's a batch of volume stop operations processed by + glusterd in brick multiplexing mode. + + Solution: Use GF_ATOMIC to update blocker counter to ensure unnecessary + context switching can be avoided. + + Change-Id: Ie13177dfee2af66687ae7cf5c67405c152853990 + Fixes: bz#1631128 + Signed-off-by: Mohit Agrawal + +commit 6a49bce014ac546582cf2409fd9933115406c808 +Author: Sanju Rakonde +Date: Wed Sep 19 19:49:51 2018 +0530 + + glusterd: fix crash + + When huge number of volumes are created, glusterd crash is seen. + With the core dump, got to know that mgmt_lock_timer became NULL. + Adding a null check for the same, need to explore about the root + cause. + + updates: bz#1630922 + Change-Id: I0770063fcbbbf4b24bef29e94b857b20bdfb5b85 + Signed-off-by: Sanju Rakonde + +commit b4eedcb4e432d2c2a5411e6cba1dedafba8e3c50 +Author: Sunny Kumar +Date: Mon Sep 17 16:56:48 2018 +0530 + + geo-rep : fix coverity issues in glusterd-geo-rep.c + + This patch fixes CID 1210979, 1214614, 1292650, 1357874, 1382404. + + 1. overflowed or a truncated value : call to sys_read has been reduced + to 'sizeof(buf) -1' and after operation buf is properly terminated. + + 2. tainted_data_argument : truncation due to cast operation on operand : + resulted form call to strtol: chaged data type from pid_t to long. + + 3. tainted_data_argument : call to fgets is reduced by 2 to make space + for the '\n' and '\0'. + + updates: bz#789278 + Change-Id: Ib883501205c85007771213071c8e182286eb0bc0 + Signed-off-by: Sunny Kumar + +commit 0a92d5be1c783d6ff0acaab016d8a1d9477b7cbf +Author: Atin Mukherjee +Date: Tue Sep 18 12:07:29 2018 +0530 + + glusterd: Improve logging in gd_mgmt_v3_unlock_timer_cbk + + Change-Id: I3335e7df3256d97c2211b64cfcaac9a016723471 + Updates: bz#1193929 + Signed-off-by: Atin Mukherjee + +commit ed071577e426744c08600f50e52cbf766c27868c +Author: Iraj Jamali +Date: Tue Sep 18 15:40:45 2018 +0530 + + libglusterfs: NULL pointer dereferencing clang fix + + Problem: trav could be NULL. + + Solution: Adding a check to avoid clang error. + + Updates: bz#1622665 + + Change-Id: If26be82edea5e33c2356cea3769496f1cbd3774c + Signed-off-by: Iraj Jamali + +commit dc2c632d525cd23914bdc468ef6cf4335559867f Author: Pranith Kumar K Date: Thu Sep 6 15:09:42 2018 +0530 @@ -2115,217 +10427,153 @@ Please note that this problem can still happen if eager-lock is disabled as the writes will not be bundled in the same lock. - fixes bz#1635975 + fixes bz#1625961 Change-Id: I8fd1cf229aed54ce5abd4e6226351a039924dd91 Signed-off-by: Pranith Kumar K -commit 5254a4b0c15ff75502806cc61a9eb9d21b55d411 -Author: Raghavendra Bhat -Date: Mon Oct 1 17:30:19 2018 -0400 - - mgmt/glusterd: use proper path to the volfile - - Till now, glusterd was generating the volfile path for the snapshot - volume's bricks like this. - - /snaps// - - But in reality, the path to the brick volfile for a snapshot volume is - - /snaps/// - - The above workaround was used to distinguish between a mount command used - to mount the snapshot volume, and a brick of the snapshot volume, so that - based on what is actually happening, glusterd can return the proper volfile - (client volfile for the former and the brick volfile for the latter). But, - this was causing problems for snapshot restore when brick multiplexing is - enabled. Because, with brick multiplexing, it tries to find the volfile - and sends GETSPEC rpc call to glusterd using the 2nd style of path i.e. - - /snaps/// - - So, when the snapshot brick (which is multiplexed) sends a GETSPEC rpc - request to glusterd for obtaining the brick volume file, glusterd was - returning the client volume file of the snapshot volume instead of the - brick volume file. - - Change-Id: I28b2dfa5d9b379fe943db92c2fdfea879a6a594e - fixes: bz#1636162 - Signed-off-by: Raghavendra Bhat - (cherry picked from commit 83a89296a3d12a3fc2a643c0630be5ce659204ea) - -commit 307c5aff55605d480d0d5889d6d010eee457377b -Author: Kotresh HR -Date: Mon Sep 24 20:43:54 2018 +0530 - - georep: Fix python3 compatibility (configparser) - - '%' needs special handling in config and also removed - duplicate misspelled 'changelog-archive-format' config. - - Updates: #411 - Change-Id: I33621a62bdf5f781ee62e6cedec0c2df3f5d70cf - Signed-off-by: Kotresh HR - (cherry picked from commit 62164ac0d242a271f19b0e0bb352af5f7df082ce) - -commit 1330456911f4e0606d9ebd103151917a160e2623 -Author: Kotresh HR -Date: Mon Sep 24 21:18:30 2018 +0530 +commit d4770602e044424ff5a4a7ac666bf5a90490ec9b +Author: Amar Tumballi +Date: Mon Sep 17 14:25:16 2018 +0530 - georep: python3 compatibility (Popen) + dht: utilize the framework to pass-through xlator tasks - The file objects for python3 by default is opened - in binary mode where as in python2 it's opened - as text by default. + Also fixes the issue caused due to not converting back the fn function + to after getting its address. We wanted the value of the field, not + the address of the pt_fop field. - The geo-rep code parses the output of Popen assuming - it as text, hence used the 'universal_newlines' flag - which provides backward compatibility for the same. + With this patch, DHT will always be started in pass-through + mode if the number of subvols is just 1. - Change-Id: I371a03b6348af9666164cb2e8b93d47475431ad9 - Updates: #411 - Signed-off-by: Kotresh HR - (cherry picked from commit 65aed1070cc2e44959cf3a0fbfde635de7e03103) + Fixes some tests to make sure DHT is in full config (ie, subvols > 1). + - increased timeout of brick-mux test as it was bordering on 300 seconds. + - Also change the volume type to supported 'replica 3' from 'replica 2'. + - also no DHT tests should assume presence of DHT when there is + just 1 brick in volume + + Credits: Nithya B + + fixes: #405 + Change-Id: I8e55239ce58d6ac6ae1901e2e384be1ecbd33d6e + Signed-off-by: Amar Tumballi -commit 3acb6955594402835dea8e309f202a9fc9e38ae0 -Author: Kotresh HR -Date: Mon Sep 24 20:56:21 2018 +0530 +commit 1e02ab9eb3af7b6ce49b154e6b9070d01a8bbb67 +Author: Milind Changire +Date: Thu Mar 9 14:29:37 2017 +0530 - georep: Fix python3 compatibility (os.pipe) + extras/devel-tools: script to strace processes - 'os.pipe' returns pair of file descriptors - which are non-inheritable by child processes. - But geo-rep uses te inheritable nature of - pipe fds to communicate between parent and - child processes. Hence wrote a compatiable - pipe routine which works well both with python2 - and python3 with inheritable nature. + Script to strace processes at high priority. + Script should be run at high priority, like nice value of -19, to help + get a trace of a run-away process consuming high CPU. - Updates: #411 - Change-Id: I869d7a52eeecdecf3851d44ed400e69b32a612d9 - Signed-off-by: Kotresh HR - (cherry picked from commit 173e89a6506bc8c727ce6d8e5ac84b59ad2e21de) + eg. + $ nice -n -19 ./strace-brick.sh glusterfsd 50 + + will strace glusterfsd processes for 60 seconds which are consuming a + minimum of 50% CPU. + + Change-Id: I6374054c7342b19122a3588d982388199f955930 + BUG: 1427397 + Signed-off-by: Milind Changire -commit e2b4e4e1ac8e3d419f7431ec9dad644e0f0fb75a -Author: Kotresh HR -Date: Fri Sep 28 05:52:36 2018 -0400 +commit a7a7d3bd1c4e5f4cd88a57a183229e185a07c730 +Author: Amar Tumballi +Date: Mon Sep 17 11:57:22 2018 +0530 - georep: python2 and python3 compat - bytes-str + logrotate: utilize the new 'maxsize' option - 1. Fix fdopen used for pid file - 2. Fix sha256 checksum calculation + Since logrotate 3.8.x version, a new option 'maxsize' is supported, + which helps in rotating the logs before the specified time if the + size exceeds maxsize limit. This should help in reducing the + overflow of gluster logs. - Updates: #411 - Change-Id: Ic173d104a73822c29aca260ba6de872cd8d23f86 - Signed-off-by: Kotresh HR + Updates: bz#1193929 + Change-Id: Id33c34d72f1931e7996893de9338db667e1e900d + Signed-off-by: Amar Tumballi -commit 76976d106d183fa275285066df2ced4902037f5a -Author: Kotresh HR -Date: Fri Sep 28 07:48:13 2018 -0400 +commit 86f1aa94c15c6c2a95a96155e8d6e4ab953b3a50 +Author: Milind Changire +Date: Wed Aug 30 09:29:49 2017 +0530 - georep: python2 to python3 compatibility-mount write + extras/devel-tools: script to resolve backtraces - python3 expects byte string for os.write. This works - for both py2 and py3. Fixed the same for geo-rep - mount testing code path. + print-backtrace.sh + script to resolve backtraces - Updates: #411 - Change-Id: I2dfedcb0869457707bcca4d2847ef0d52bff1987 - Signed-off-by: Kotresh HR + Change-Id: I24688ae5160cc706d9f4794521d17290bef6765b + BUG: 1486532 + Signed-off-by: Milind Changire -commit 78abb99e6aa9e7abbb364dabfd38c6df2fdd5b88 -Author: Kotresh HR -Date: Fri Sep 28 06:11:52 2018 -0400 +commit d2b42668e779c31eb421f8b93be695d5eab65e6f +Author: N Balachandran +Date: Tue Sep 18 14:19:11 2018 +0530 - georep: python2 to python3 compat - pickle - - Handle py2 and py3 compatibility for pickling and unpickling. - Geo-rep pickles and unpickles reading sys.stdin and sys.stdout streams. - py2 and py3 compatibility expects the streams to be opened in binary - mode but the sys.stdout objects are different in python2 - and python3 + tests/dht: Uncomment cleanup steps - python2: - >>> type(sys.stdout) - + I had forgotten to uncomment the cleanup + steps for file-create.t. Fixed. - python3: - >>> type(sys.stdout) - + Change-Id: Id702b99b8e09f56b7333491a477828b4a37b2687 + updates: bz#1628194 + Signed-off-by: N Balachandran + +commit 02f2ac094819447f40a6762035406a7c7dad000e +Author: Ravishankar N +Date: Thu Sep 6 10:46:43 2018 +0530 + + tests: fixes to bug-1015990-rep.t - So in order to access binary stream, using sys.stdin.buffer in python3 + - check that the shd is connected to brick before running statistics command + - remove sleep statements + - remove unneeded ($count-$value==0) test when it is known that both values will + be same - Updates: #411 - Change-Id: I1a633ccdddff5baf0cf05a8b493add39ddf75bd7 - Signed-off-by: Kotresh HR + Fixes: bz#1625850 + Change-Id: Ifcd4887f0238031e5bca803cd9bfdb75a6e6c01b + Signed-off-by: Ravishankar N -commit 9eeca96885560ee555826ca0eb4294d226928728 -Author: ShyamsundarR -Date: Fri Sep 28 13:47:33 2018 -0400 +commit 07088d95e450f847722e5decbfa5da18a0dbd9de +Author: Aravinda VK +Date: Mon Sep 17 14:16:09 2018 +0530 - mdcache: Fix asan reported potential heap buffer overflow + posix: Fix exporting default value for `export-statfs-size` - The char pointer mdc_xattr_str in function mdc_xattr_list_populate - is malloc'd and doing a strcat into a malloc'd region can - overflow content allocated based on prior contents of the - memory region. + No default value was specified for `export-statfs-size` in posix + option table. Glusterd2 sets default value as `off` since the + option type is `bool`. Posix treats `export-statfs-size=on` if + not specified in volfile(That means default value is `on`) - Added a NULL terimation to the malloc'd region to prevent - the overflow, and treat it as an empty string. + This patch sets default value as `on` - Change-Id: If0decab669551581230a8ede4c44c319ff04bac9 - Updates: bz#1635373 - Signed-off-by: ShyamsundarR - (cherry picked from commit d00a2a1b398346bbdc5ac9b3ba4b09fb1ce1e699) + Change-Id: I5c6341183be9b62a78fdbc94621220f9284e1382 + updates: #302 + Signed-off-by: Aravinda VK -commit 315b45f85ecba15d7fc8f2342468b89ee4747c48 +commit b977b44dd0adfcd7a3b432844260de4b8d1c4adf Author: Kotresh HR -Date: Mon Sep 3 09:07:58 2018 -0400 +Date: Fri Sep 14 03:42:26 2018 -0400 - ctime: Provide noatime option + geo-rep: Fix issues related config set - Most of the applications are {c|m}time dependant - and very few are atime dependant. So provide noatime - option to not update atime when ctime feature is - enabled. + 1. '--ignore-mising-args' option for rsync is not + being used even though the rsync version is + greater than 3.1.0. Fixed the same. - Also this option has to be enabled with ctime - feature to avoid unnecessary self heal. Since - AFR/EC reads data from single subvolume, atime - is only updated in one subvolume triggering self - heal. + 2. '--existing' option for rsync is also not being + used. Fixed the same. - Backport of: - > Patch: https://review.gluster.org/21073 - > BUG: 1593538 - > Change-Id: I085fb33c882296545345f5df194cde7b6cbc337e - > Signed-off-by: Kotresh HR - (cherry picked from commit 89636be4c73b12de2e11c75d8e59527bb243f147) + 3. geo-rep config fails to set rsync-options as the + value contains '--'. Interestingly, python argsparse + treats the value with '--' (e.g., --ignore-missing-args) + as option. But when passed with something like + --value=--ignore-missing-args, it succeeds. Fixed the + same. - updates: bz#1633015 - Change-Id: I085fb33c882296545345f5df194cde7b6cbc337e + Change-Id: Iaeb838acaff1c2920fee9c7f920c99edce13a0a1 Signed-off-by: Kotresh HR + fixes: bz#1629561 -commit f7af62ecd893bd977cebc4e6586f1e524b36561b -Author: Kaleb S. KEITHLEY -Date: Mon Sep 24 14:12:45 2018 -0400 - - python3: assume python3 unless building _packages_ on sys without py3 - - The jenkins release-new job runs on a CentOS 7 box, which does not - have python3. As a result it runs (autogen.sh and) configure before - producing the dist tar file, converting all the python3 shebangs to - python2 shebangs in the dist tar file. - - Then when that tar file is "carried" to, e.g. Fedora koji build - system to build packages, the shebangs are incorrect, despite having - originally been correct in the git repo. - - Change-Id: I5154baba3f6d29d3c4823bafc2b57abecbf90e5b - updates: #411 - Signed-off-by: Kaleb S. KEITHLEY - -commit a39d7273eb8efecf88613a7ba284a9a3cd970be9 +commit 484f417da945cf83afdbf136bb4817311862a8d2 Author: Sanju Rakonde Date: Tue Sep 11 14:19:42 2018 +0530 @@ -2342,105 +10590,120 @@ store_volinfo_lock, and release the lock only when the thread completed its critical section part. - > BUG: bz#1627610 - > Signed-off-by: Sanju Rakonde - - > Change-Id: I545e4e2368e3285d8f7aa28081ff4448abb72f5d - (cherry picked from commit 484f417da945cf83afdbf136bb4817311862a8d2) - - fixes: bz#1633552 + Fixes: bz#1627610 + Signed-off-by: Sanju Rakonde Change-Id: I545e4e2368e3285d8f7aa28081ff4448abb72f5d - Signed-off-by: Sanju Rakonde -commit 7ab0f691f0bd08585d06a26f23dc24f62ddd6251 -Author: Sanju Rakonde -Date: Tue Sep 25 23:36:48 2018 +0530 +commit d345ac09548dbb486c1619a27cb70149b3ca962a +Author: Kinglong Mee +Date: Thu Sep 6 18:17:14 2018 +0800 + + event: get time by clock_gettime as pthread_cond_timedwait using + + Debug information shows time() has a delay between seconds increase, + get the right time by clock_gettime as pthread_cond_timedwait using. + + ret = pthread_cond_timedwait (&event_pool->cond, + &event_pool->mutex, + &sleep_till); + + gf_msg ("epoll", GF_LOG_INFO, 0, + + LG_MSG_EXITED_EPOLL_THREAD, + + "pthread_cond_timedwait %lu %p return %d (active %d:%d)", + + sleep_till.tv_sec, event_pool, ret, + + event_pool->activethreadcount, threadcount); + } + } + pthread_mutex_unlock (&event_pool->mutex); + + [2018-09-06 18:33:57.000879] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) + [2018-09-06 18:33:57.000916] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) + [2018-09-06 18:33:57.000931] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) + [2018-09-06 18:33:57.000945] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) + [2018-09-06 18:33:57.000957] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) + [2018-09-06 18:33:57.000970] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) + [2018-09-06 18:33:57.000983] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) + [2018-09-06 18:33:57.000997] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) + [2018-09-06 18:33:57.001010] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) + [2018-09-06 18:33:57.001022] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) + [2018-09-06 18:33:57.001034] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) + [2018-09-06 18:33:57.001060] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230037 0x1f48e60 return 110 (active 5:4) + [2018-09-06 18:33:57.003085] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230038 0x1f48e60 return 0 (active 4:4) + [2018-09-06 18:33:57.014142] I [event.c:284:event_dispatch_destroy] 0-epoll: pthread_cond_timedwait 1536230038 0x1f48e60 return 0 (active 3:4) + + Change-Id: I735249eee9a6f8284392b69e501479ac163b8409 + fixes: bz#1626313 + Signed-off-by: Kinglong Mee - glusterd: make sure that brickinfo->uuid is not null +commit f2137d4c84c035ed320f959dc39e07c6a1516afb +Author: Shwetha K Acharya +Date: Fri Sep 14 10:27:56 2018 +0530 + + protocol/server: NULL pointer dereferencing clang fix - Problem: After an upgrade from the version where shared-brick-count - option is not present to a version which introduced this option - causes issue at the mount point i.e, size of the volume at mount - point will be reduced by shared-brick-count value times. + Problem: Access to field fop_length results in null pointer dereferencing. - Cause: shared-brick-count is equal to the number of bricks that - are sharing the file system. gd_set_shared_brick_count() calculates - the shared-brick-count value based on uuid of the node and fsid of - the brick. https://review.gluster.org/#/c/glusterfs/+/19484 handles - setting of fsid properly during an upgrade path. This patch assumed - that when the code path is reached, brickinfo->uuid is non-null. - But brickinfo->uuid is null for all the bricks, as the uuid is null - https://review.gluster.org/#/c/glusterfs/+/19484 couldn't reached the - code path to set the fsid for bricks. So, we had fsid as 0 for all - bricks, which resulted in gd_set_shared_brick_count() to calculate - shared-brick-count in a wrong way. i.e, the logic written in - gd_set_shared_brick_count() didn't work as expected since fsid is 0. + Solution: Added condition checks fix the issue. - Solution: Before control reaches the code path written by - https://review.gluster.org/#/c/glusterfs/+/19484, - adding a check for whether brickinfo->uuid is null and - if brickinfo->uuid is having null value, calling - glusterd_resolve_brick will set the brickinfo->uuid to a - proper value. When we have proper uuid, fsid for the bricks - will be set properly and shared-brick-count value will be - caluculated correctly. + Change-Id: Id408e3ac62ea9574f0cd9aecce5434add09eb7d0 + Updates: bz#1622665 + Signed-off-by: Shwetha K Acharya + +commit f7f281900b3c87e3626d79bd9599c905faaf11ed +Author: Harpreet Lalwani +Date: Tue Sep 11 23:00:14 2018 +0530 + + glusterd: NULL pointer dereferencing clang Fix - Please take a look at the bug https://bugzilla.redhat.com/show_bug.cgi?id=1632889 - for complete RCA + Added ternary operator to avoid NULL pointer dereferencing - Steps followed to test the fix: - 1. Created a 2 node cluster, the cluster is running with binary - which doesn't have shared-brick-count option - 2. Created a 2x(2+1) volume and started it - 3. Mouted the volume, checked size of volume using df - 4. Upgrade to a version where shared-brick-count is introduced - (upgraded the nodes one by one i.e, stop the glusterd, upgrade the node - and start the glusterd). - 5. after upgrading both the nodes, bumped up the cluster.op-version - 6. At mount point, df shows the correct size for volume. + Updates: bz#1622665 - > backport of https://review.gluster.org/#/c/glusterfs/+/21278/ - > Change-Id: Ib9f078aafb15e899a01086eae113270657ea916b - > Signed-off-by: Sanju Rakonde - (cherry picked from commit f1e9b878ce2067db83a0baa5f384eda87287719d) + Change-Id: I855f6caf720b28af1564898d75c6c965bcc58c5c + Signed-off-by: Harpreet Lalwani + +commit bdfe87d56b21766cf7fe9f73890d1d3336158982 +Author: Sunny Kumar +Date: Tue Sep 11 16:53:29 2018 +0530 + + glusterd : fix coverity issue in glusterd-store.c - fixes: bz#1633242 - Change-Id: Ib9f078aafb15e899a01086eae113270657ea916b - Signed-off-by: Sanju Rakonde + This patch fixes CID 1124356: Unchecked return value (CHECKED_RETURN) + + updates: bz#789278 + Change-Id: I81f4637f19b81f820a2deb70cc7f84b79fe70236 + Signed-off-by: Sunny Kumar -commit 112b50070861101be2d6cc8d8e96af75359a8ca3 -Author: Kotresh HR -Date: Fri Sep 14 03:42:26 2018 -0400 +commit fb836edec5f0bd805c302497d78fa85937d9d4dc +Author: N Balachandran +Date: Wed Sep 12 18:19:09 2018 +0530 - geo-rep: Fix issues related config set + tests/dht: Add tests for file create - 1. '--ignore-mising-args' option for rsync is not - being used even though the rsync version is - greater than 3.1.0. Fixed the same. + Test dht file creates - 2. '--existing' option for rsync is also not being - used. Fixed the same. + Change-Id: I7aba710f4911432bd3b86834efecae8f01e4052f + updates: bz#1628194 + Signed-off-by: N Balachandran + +commit 2b157eb97117511c5a47f2227aab81bff90cf32f +Author: Kaleb S. KEITHLEY +Date: Mon Sep 10 09:02:33 2018 -0400 + + packaging: glusterfs.spec(.in) cleanup - 3. geo-rep config fails to set rsync-options as the - value contains '--'. Interestingly, python argsparse - treats the value with '--' (e.g., --ignore-missing-args) - as option. But when passed with something like - --value=--ignore-missing-args, it succeeds. Fixed the - same. + Someone (not me) once alphabetized all the %package, %files, and etc. + sections, with a comment to keep them alphabetized. Move cloudsync + sections to their correct locations in the spec. - Backport of: - > Patch: https://review.gluster.org/21191 - > Change-Id: Iaeb838acaff1c2920fee9c7f920c99edce13a0a1 - > Signed-off-by: Kotresh HR - > BUG: 1629561 - (cherry picked from commit b977b44dd0adfcd7a3b432844260de4b8d1c4adf) + Also reorder testing and playground within %files section, keep testing + %dirs together. - Change-Id: Iaeb838acaff1c2920fee9c7f920c99edce13a0a1 - Signed-off-by: Kotresh HR - fixes: bz#1630673 + Change-Id: I79e2e7a82d20275fd61d018880bcb5913c8f75f3 + updates: bz#1193929 + Signed-off-by: Kaleb S. KEITHLEY -commit f4594a3c88cb0a76e260010d57632dc1c718fd5f +commit b4504eadd839dc93dda46f3a5284858ae4c83bfc Author: ShyamsundarR Date: Fri Sep 14 12:06:28 2018 -0400 @@ -2450,95 +10713,79 @@ this is cleaned up with this patch. Change-Id: I1ab54b9fb6b0d455884fbbfd89820c60bb861e6f - Updates: bz#1629877 + Updates: bz#1193929 Signed-off-by: ShyamsundarR -commit c1314445cf008cf78a2157cb425bee836de5594c -Author: ShyamsundarR -Date: Thu Sep 13 14:05:02 2018 -0400 +commit 956b4ad214b46b1a1c89e5c120754081561aa930 +Author: Yaniv Kaul +Date: Tue Sep 11 11:42:19 2018 +0300 - core: remove experimental xlators and associated tests + libglusterfs/src/dict.c : use xxhash64 for hashing. - experimental xlators removed from 5.0 + As part of a larger effort to consolidate hash functions + and use a faster, with less collissions, I've moved to use + xxhash as the hashing function for the dictionary. - Change-Id: I47219d8b95efc3d5875ec9224d1e79f8371e9f76 - Updates: bz#1628620 - Signed-off-by: ShyamsundarR - -commit afc9f3b8716e88410ba50a6ce8abbfa186ee7c46 -Author: ShyamsundarR -Date: Thu Sep 13 12:50:30 2018 -0400 - - glusterd: Update op-version from 4.2 to 5.0 + Note: I'm using only 32 bits of the hashes, as the hash field + is currently a 32 bit variable. There's room (since the struct + is not packed) to move to use a 64bit variable. Donno how it'll + affect performance. - Post changing the max op-version to 4.2, after release - 4.1 branching, the decision was to go with increasing - release numbers. Thus this needs to change to 5.0. + Only compile-tested! - This commit addresses the above change. + updates: bz#1193929 + Signed-off-by: Yaniv Kaul - Fixes: bz#1628668 - Change-Id: Ifcc0c6da90fdd51e4eceea40749511110a432cce - Signed-off-by: ShyamsundarR + Change-Id: Ie244efd1368234e54dd5957ee1ae5bebd7d9409a -commit cee40c3e3c26ebfb3b98109d154501a5cce61c0d -Author: ShyamsundarR -Date: Thu Sep 13 22:15:20 2018 -0400 +commit 76cb1e761d18482512d907679d279d7f61902dde +Author: Anoop C S +Date: Sun Sep 9 11:39:47 2018 +0530 - gfapi: revert several patchs that introduced pre/post attrs + extras/hooks: General improvements to S30samba-start.sh - Reverted the following: - - 248152767b0599986bbb6bb35fc27197f6be6964 - - 09943beb499617212f2985ca8ea9ecd1ed1b470e - - d01f7244e9d9f7e3ef84e0ba7b48ef1b1b09d809 + Based on https://review.gluster.org/c/glusterfs/+/19204 from + Milan Zink - The reverts are redone by hand, due to clang format changes - that made using git to revert the changes more tedious. - - Change-Id: I96489638a2b641fb2206a110298543225783f7be - Updates: bz#1628620 - Signed-off-by: ShyamsundarR + Change-Id: I61f62407a62475a74a6cc046c24748a31c66e6cd + Updates: bz#1193929 + Signed-off-by: Anoop C S -commit 5cd9c22a4fd041a27275a465d0117af39cf4e616 -Author: ShyamsundarR -Date: Thu Sep 13 17:20:02 2018 -0400 +commit 9f49f0b5901e29b8f0761c0e2631cd1c1d969a51 +Author: Xavi Hernandez +Date: Thu Sep 13 15:44:15 2018 +0200 - gfapi: revert "gfapi: return pre/post attributes at callback for glfs api" + socket: set 42 as default tpc-user-timeout - This reverts commit 384562b294e9a7847403961e878a4daa0fff33eb. + The 'tcp-user-timeout' option is define in the 'socket' module, but it's + configured in 'protocol/server' and 'protocol/client', which are the + parents of the 'socket' module. - The revert is done manually owing to the clang format changes, - and the 4.1 patch that reverts this fix is used as the source - for the revert. + However, current options management logic only takes into consideration + default values specified in the 'socket' module itself, ignoring values + defined in the owner xlator. - The 4.1 patch has the commit ID: 98376e0c0a + This patch simply sets the default value of tcp-user-timeout in the + 'socket' module so that server and client use the expected value. - Change-Id: Ib2cbce9940f6a2a2755eb47bf332832147835e4d - Updates: bz#1628620 - Signed-off-by: ShyamsundarR + Change-Id: Ib8ad7c4ac6aac725b01a78f8c3d10cf4063d2ee6 + fixes: bz#1628605 + Signed-off-by: Xavi Hernandez -commit 822dd79db99e0aa221ed90fdf8bb91fbcdfcd66f +commit 0b3f08cd50f76af537aa4bce2f09602a4834b0fc Author: ShyamsundarR -Date: Thu Sep 13 13:12:47 2018 -0400 +Date: Thu Sep 13 12:50:30 2018 -0400 - core: move logs which are only developer relevant to DEBUG level - - For each release, we move certain logs on master that are meant - as an indicator to contributors to correct or adapt to core - infrastructure changes in libglusterfs and other places. + glusterd: Update op-version from 4.2 to 5.0 - This commit achieves the above. + Post changing the max op-version to 4.2, after release + 4.1 branching, the decision was to go with increasing + release numbers. Thus this needs to change to 5.0. - Change-Id: I4157a7ec7d5ec9c2948b2bbc1e4cb8317f28d6b8 - Updates: bz#1628620 - Signed-off-by: ShyamsundarR - -commit 41388f15fc0ff4891b292efd509c8887c06143d8 -Author: ShyamsundarR -Date: Thu Sep 13 10:39:22 2018 -0400 - - Update rfc.sh for release-5 + This commit addresses the above change. + Fixes: bz#1628664 + Change-Id: Ifcc0c6da90fdd51e4eceea40749511110a432cce Signed-off-by: ShyamsundarR commit f15e948da3881b61a8b546af7c64340db87d3cf7 diff -Nru glusterfs-5.5/cli/Makefile.in glusterfs-6.3/cli/Makefile.in --- glusterfs-5.5/cli/Makefile.in 2019-03-15 13:23:46.214479282 +0000 +++ glusterfs-6.3/cli/Makefile.in 2019-06-11 13:15:02.029129411 +0000 @@ -182,6 +182,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_GNFS = @BUILD_GNFS@ BUILD_PYTHON_SITE_PACKAGES = @BUILD_PYTHON_SITE_PACKAGES@ BUILD_PYTHON_SITE_PACKAGES_EXPANDED = @BUILD_PYTHON_SITE_PACKAGES_EXPANDED@ CC = @CC@ @@ -222,9 +223,6 @@ GF_NO_UNDEFINED = @GF_NO_UNDEFINED@ GF_XLATOR_DEFAULT_LDFLAGS = @GF_XLATOR_DEFAULT_LDFLAGS@ GF_XLATOR_LDFLAGS = @GF_XLATOR_LDFLAGS@ -GLUPY_SUBDIR = @GLUPY_SUBDIR@ -GLUPY_SUBDIR_MAKEFILE = @GLUPY_SUBDIR_MAKEFILE@ -GLUPY_SUBDIR_SRC_MAKEFILE = @GLUPY_SUBDIR_SRC_MAKEFILE@ GLUSTERD_VOLFILE = @GLUSTERD_VOLFILE@ GLUSTERD_WORKDIR = @GLUSTERD_WORKDIR@ GLUSTERFSD_MISCDIR = @GLUSTERFSD_MISCDIR@ @@ -251,7 +249,6 @@ LIBAIO = @LIBAIO@ LIBGFCHANGELOG_LT_VERSION = @LIBGFCHANGELOG_LT_VERSION@ LIBGFCHANGELOG_VERSION = @LIBGFCHANGELOG_VERSION@ -LIBGFDB_VERSION = @LIBGFDB_VERSION@ LIBGFRPC_LT_VERSION = @LIBGFRPC_LT_VERSION@ LIBGFXDR_LT_VERSION = @LIBGFXDR_LT_VERSION@ LIBGLUSTERFS_LT_VERSION = @LIBGLUSTERFS_LT_VERSION@ @@ -305,8 +302,6 @@ SIZEOF_LONG = @SIZEOF_LONG@ SIZEOF_LONG_LONG = @SIZEOF_LONG_LONG@ SIZEOF_SHORT = @SIZEOF_SHORT@ -SQLITE_CFLAGS = @SQLITE_CFLAGS@ -SQLITE_LIBS = @SQLITE_LIBS@ STRIP = @STRIP@ SYNCDAEMON_COMPILE = @SYNCDAEMON_COMPILE@ SYNCDAEMON_SUBDIR = @SYNCDAEMON_SUBDIR@ diff -Nru glusterfs-5.5/cli/src/cli.c glusterfs-6.3/cli/src/cli.c --- glusterfs-5.5/cli/src/cli.c 2019-03-15 13:23:38.376461690 +0000 +++ glusterfs-6.3/cli/src/cli.c 2019-06-11 13:14:55.565110087 +0000 @@ -44,19 +44,19 @@ #include "cli-cmd.h" #include "cli-mem-types.h" -#include "xlator.h" -#include "glusterfs.h" -#include "compat.h" -#include "logging.h" -#include "dict.h" -#include "list.h" -#include "timer.h" -#include "stack.h" -#include "revision.h" -#include "common-utils.h" -#include "gf-event.h" -#include "syscall.h" -#include "call-stub.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include "xdr-generic.h" @@ -94,60 +94,91 @@ call_pool_t *pool = NULL; int ret = -1; + if (!ctx) + return ret; + ret = xlator_mem_acct_init(THIS, cli_mt_end); if (ret != 0) { + gf_log("cli", GF_LOG_ERROR, "Memory accounting init failed."); return ret; } + /* Resetting ret to -1 to so in case of failure + * we can relese allocated resource. + */ + ret = -1; + ctx->process_uuid = generate_glusterfs_ctx_id(); - if (!ctx->process_uuid) - return -1; + if (!ctx->process_uuid) { + gf_log("cli", GF_LOG_ERROR, "Failed to generate uuid."); + goto out; + } ctx->page_size = 128 * GF_UNIT_KB; ctx->iobuf_pool = iobuf_pool_new(); - if (!ctx->iobuf_pool) - return -1; + if (!ctx->iobuf_pool) { + gf_log("cli", GF_LOG_ERROR, "Failed to create iobuf pool."); + goto out; + } ctx->event_pool = event_pool_new(DEFAULT_EVENT_POOL_SIZE, STARTING_EVENT_THREADS); - if (!ctx->event_pool) - return -1; + if (!ctx->event_pool) { + gf_log("cli", GF_LOG_ERROR, "Failed to create event pool."); + goto out; + } pool = GF_CALLOC(1, sizeof(call_pool_t), cli_mt_call_pool_t); - if (!pool) - return -1; + if (!pool) { + gf_log("cli", GF_LOG_ERROR, "Failed to create call pool."); + goto out; + } /* frame_mem_pool size 112 * 64 */ pool->frame_mem_pool = mem_pool_new(call_frame_t, 32); - if (!pool->frame_mem_pool) - return -1; + if (!pool->frame_mem_pool) { + gf_log("cli", GF_LOG_ERROR, "Failed to create frame mem pool."); + goto out; + } /* stack_mem_pool size 256 * 128 */ pool->stack_mem_pool = mem_pool_new(call_stack_t, 16); - if (!pool->stack_mem_pool) - return -1; + if (!pool->stack_mem_pool) { + gf_log("cli", GF_LOG_ERROR, "Failed to create stack mem pool."); + goto out; + } ctx->stub_mem_pool = mem_pool_new(call_stub_t, 16); - if (!ctx->stub_mem_pool) - return -1; + if (!ctx->stub_mem_pool) { + gf_log("cli", GF_LOG_ERROR, "Failed to stub mem pool."); + goto out; + } ctx->dict_pool = mem_pool_new(dict_t, 32); - if (!ctx->dict_pool) - return -1; + if (!ctx->dict_pool) { + gf_log("cli", GF_LOG_ERROR, "Failed to create dict pool."); + goto out; + } ctx->dict_pair_pool = mem_pool_new(data_pair_t, 512); - if (!ctx->dict_pair_pool) - return -1; + if (!ctx->dict_pair_pool) { + gf_log("cli", GF_LOG_ERROR, "Failed to create dict pair pool."); + goto out; + } ctx->dict_data_pool = mem_pool_new(data_t, 512); - if (!ctx->dict_data_pool) - return -1; + if (!ctx->dict_data_pool) { + gf_log("cli", GF_LOG_ERROR, "Failed to create dict data pool."); + goto out; + } ctx->logbuf_pool = mem_pool_new(log_buf_t, 256); - if (!ctx->logbuf_pool) - return -1; + if (!ctx->logbuf_pool) { + gf_log("cli", GF_LOG_ERROR, "Failed to create logbuf pool."); + goto out; + } INIT_LIST_HEAD(&pool->all_frames); LOCK_INIT(&pool->lock); @@ -161,7 +192,25 @@ lim.rlim_max = RLIM_INFINITY; setrlimit(RLIMIT_CORE, &lim); - return 0; + ret = 0; + +out: + if (ret != 0) { + if (pool) { + mem_pool_destroy(pool->frame_mem_pool); + mem_pool_destroy(pool->stack_mem_pool); + } + GF_FREE(pool); + pool = NULL; + GF_FREE(ctx->process_uuid); + mem_pool_destroy(ctx->stub_mem_pool); + mem_pool_destroy(ctx->dict_pool); + mem_pool_destroy(ctx->dict_pair_pool); + mem_pool_destroy(ctx->dict_data_pool); + mem_pool_destroy(ctx->logbuf_pool); + } + + return ret; } static int @@ -320,6 +369,20 @@ if (strcmp(opt, "") == 0) return 1; + if (strcmp(opt, "help") == 0) { + cli_out( + " peer help - display help for peer commands\n" + " volume help - display help for volume commands\n" + " volume bitrot help - display help for volume" + " bitrot commands\n" + " volume quota help - display help for volume" + " quota commands\n" + " volume tier help - display help for volume" + " tier commands\n" + " snapshot help - display help for snapshot commands\n" + " global help - list global commands\n"); + exit(0); + } if (strcmp(opt, "version") == 0) { cli_out("%s", argp_program_version); @@ -379,6 +442,12 @@ return 0; } + oarg = strtail(opt, "inet6"); + if (oarg) { + state->address_family = "inet6"; + return 0; + } + oarg = strtail(opt, "log-file="); if (oarg) { state->log_file = oarg; @@ -433,7 +502,6 @@ int i = 0; int j = 0; char *opt = NULL; - gf_boolean_t geo_rep_config = _gf_false; state->argc = argc - 1; state->argv = &argv[1]; @@ -447,31 +515,33 @@ if (state->argc > GEO_REP_CMD_CONFIG_INDEX && strtail(state->argv[GEO_REP_CMD_INDEX], "geo") && strtail(state->argv[GEO_REP_CMD_CONFIG_INDEX], "co")) - geo_rep_config = _gf_true; + goto done; for (i = 0; i < state->argc; i++) { opt = strtail(state->argv[i], "--"); - if (opt && !geo_rep_config) { - ret = cli_opt_parse(opt, state); - if (ret == -1) { - cli_out("unrecognized option --%s", opt); - return ret; - } else if (ret == -2) { - return ret; - } - for (j = i; j < state->argc - 1; j++) - state->argv[j] = state->argv[j + 1]; - state->argc--; - /* argv shifted, next check should be at i again */ - i--; - if (ret == 1) { - /* end of cli options */ - ret = 0; - break; - } + if (!opt) + continue; + ret = cli_opt_parse(opt, state); + if (ret == -1) { + cli_out("unrecognized option --%s\n", opt); + usage(); + return ret; + } else if (ret == -2) { + return ret; + } + for (j = i; j < state->argc - 1; j++) + state->argv[j] = state->argv[j + 1]; + state->argc--; + /* argv shifted, next check should be at i again */ + i--; + if (ret == 1) { + /* end of cli options */ + ret = 0; + break; } } +done: state->argv[state->argc] = NULL; return ret; @@ -623,9 +693,11 @@ this = THIS; cli_rpc_prog = &cli_prog; - options = dict_new(); - if (!options) - goto out; + + /* If address family specified in CLI */ + if (state->address_family) { + addr_family = state->address_family; + } /* Connect to glusterd using the specified method, giving preference * to a unix socket connection. If nothing is specified, connect to @@ -645,6 +717,11 @@ "Connecting to remote glusterd at " "%s", state->remote_host); + + options = dict_new(); + if (!options) + goto out; + ret = dict_set_str(options, "remote-host", state->remote_host); if (ret) goto out; @@ -657,7 +734,6 @@ goto out; ret = dict_set_str(options, "transport.address-family", addr_family); - if (ret) goto out; } else { diff -Nru glusterfs-5.5/cli/src/cli-cmd.c glusterfs-6.3/cli/src/cli-cmd.c --- glusterfs-5.5/cli/src/cli-cmd.c 2019-03-15 13:23:38.370461677 +0000 +++ glusterfs-6.3/cli/src/cli-cmd.c 2019-06-11 13:14:55.557110063 +0000 @@ -108,12 +108,14 @@ } if (!word) { - cli_out("unrecognized word: %s (position %d)", argv[i], i); + cli_out("unrecognized word: %s (position %d)\n", argv[i], i); + usage(); return -1; } if (!word->cbkfn) { - cli_out("unrecognized command"); + cli_out("unrecognized command\n"); + usage(); return -1; } diff -Nru glusterfs-5.5/cli/src/cli-cmd-global.c glusterfs-6.3/cli/src/cli-cmd-global.c --- glusterfs-5.5/cli/src/cli-cmd-global.c 2019-03-15 13:23:38.367461670 +0000 +++ glusterfs-6.3/cli/src/cli-cmd-global.c 2019-06-11 13:14:55.553110051 +0000 @@ -23,9 +23,9 @@ #include "cli-cmd.h" #include "cli-mem-types.h" #include "cli1-xdr.h" -#include "run.h" -#include "syscall.h" -#include "common-utils.h" +#include +#include +#include extern rpc_clnt_prog_t *cli_rpc_prog; diff -Nru glusterfs-5.5/cli/src/cli-cmd.h glusterfs-6.3/cli/src/cli-cmd.h --- glusterfs-5.5/cli/src/cli-cmd.h 2019-03-15 13:23:38.370461677 +0000 +++ glusterfs-6.3/cli/src/cli-cmd.h 2019-06-11 13:14:55.557110063 +0000 @@ -13,7 +13,7 @@ #include #include "cli.h" -#include "list.h" +#include #define GLUSTER_SHARED_STORAGE "gluster_shared_storage" diff -Nru glusterfs-5.5/cli/src/cli-cmd-parser.c glusterfs-6.3/cli/src/cli-cmd-parser.c --- glusterfs-5.5/cli/src/cli-cmd-parser.c 2019-03-15 13:23:38.369461674 +0000 +++ glusterfs-6.3/cli/src/cli-cmd-parser.c 2019-06-11 13:14:55.555110057 +0000 @@ -18,8 +18,8 @@ #include "cli.h" #include "cli-cmd.h" #include "cli-mem-types.h" -#include "dict.h" -#include "list.h" +#include +#include #include "protocol-common.h" #include "cli1-xdr.h" @@ -144,7 +144,7 @@ GF_FREE(tmp_host); goto out; } - if (!valid_internet_address(host_name, _gf_false)) { + if (!valid_internet_address(host_name, _gf_false, _gf_false)) { cli_err( "internet address '%s' does not conform to " "standards", @@ -310,10 +310,10 @@ tmp = *disperse - *redundancy; } - if (*redundancy > (*disperse - 1) / 2) { + if ((*redundancy < 1) || (*redundancy > (*disperse - 1) / 2)) { cli_err( - "redundancy must be less than %d for a " - "disperse %d volume", + "redundancy must be greater than or equal to 1 and " + "less than %d for a disperse %d volume", (*disperse + 1) / 2, *disperse); return -1; @@ -392,21 +392,11 @@ ret = 2; } break; - case GF_CLUSTER_TYPE_STRIPE_REPLICATE: - cli_err( - "striped-replicated-dispersed volume " - "is not supported"); - goto out; case GF_CLUSTER_TYPE_TIER: cli_err( "tier-dispersed volume is not " "supported"); goto out; - case GF_CLUSTER_TYPE_STRIPE: - cli_err( - "striped-dispersed volume is not " - "supported"); - goto out; case GF_CLUSTER_TYPE_REPLICATE: cli_err( "replicated-dispersed volume is not " @@ -550,8 +540,8 @@ type = GF_CLUSTER_TYPE_REPLICATE; break; case GF_CLUSTER_TYPE_STRIPE: - type = GF_CLUSTER_TYPE_STRIPE_REPLICATE; - break; + cli_err("stripe option not supported"); + goto out; case GF_CLUSTER_TYPE_TIER: cli_err( "replicated-tiered volume is not " @@ -637,49 +627,8 @@ goto out; } else if ((strcmp(w, "stripe")) == 0) { - switch (type) { - case GF_CLUSTER_TYPE_STRIPE_REPLICATE: - case GF_CLUSTER_TYPE_STRIPE: - cli_err("stripe option given twice"); - goto out; - case GF_CLUSTER_TYPE_NONE: - type = GF_CLUSTER_TYPE_STRIPE; - break; - case GF_CLUSTER_TYPE_REPLICATE: - type = GF_CLUSTER_TYPE_STRIPE_REPLICATE; - break; - case GF_CLUSTER_TYPE_DISPERSE: - cli_err( - "striped-dispersed volume is not " - "supported"); - goto out; - case GF_CLUSTER_TYPE_TIER: - cli_err( - "striped-tier volume is not " - "supported"); - goto out; - default: - cli_err("Invalid type given"); - goto out; - } - if (wordcount < (index + 2)) { - ret = -1; - goto out; - } - stripe_count = strtol(words[index + 1], NULL, 0); - if (stripe_count < 2) { - cli_err( - "stripe count should be greater" - " than 1"); - ret = -1; - goto out; - } - ret = dict_set_int32(dict, "stripe-count", stripe_count); - if (ret) - goto out; - - index += 2; - + cli_err("stripe option not supported"); + goto out; } else if ((strcmp(w, "transport")) == 0) { if (trans_type) { cli_err( @@ -813,6 +762,7 @@ *brick_list = bricks; out: if (ret) { + GF_FREE(bricks); gf_log("cli", GF_LOG_ERROR, "Unable to parse create volume CLI"); if (dict) dict_unref(dict); @@ -1483,6 +1433,8 @@ } data = gf_strdup(value); if (data == NULL) { + gf_log(THIS->name, GF_LOG_ERROR, "Failed to allocate memory for data"); + ret = -1; goto out; } @@ -1864,17 +1816,8 @@ } } } else if ((strcmp(w, "stripe")) == 0) { - type = GF_CLUSTER_TYPE_STRIPE; - count = strtol(words[4], NULL, 0); - if (!count || (count < 2)) { - cli_err("stripe count should be greater than 1"); - ret = -1; - goto out; - } - ret = dict_set_int32(dict, "stripe-count", count); - if (ret) - goto out; - index = 5; + cli_err("stripe option not supported"); + goto out; } else { GF_ASSERT(!"opword mismatch"); ret = -1; @@ -2743,7 +2686,10 @@ /* trailing strcat will add two bytes, make space for that */ append_len++; - append_str = GF_MALLOC(append_len, cli_mt_append_str); + /* strcat is used on this allocation and hence expected to be + * initiatlized to 0. So GF_CALLOC is used. + */ + append_str = GF_CALLOC(1, append_len, cli_mt_append_str); if (!append_str) { ret = -1; goto out; @@ -2778,7 +2724,7 @@ ret_chkpt = strptime(append_str, "%Y-%m-%d %H:%M:%S", &checkpoint_time); - if (ret_chkpt == NULL) { + if (ret_chkpt == NULL || *ret_chkpt != '\0') { ret = -1; cli_err( "Invalid Checkpoint label. Use format " @@ -2879,7 +2825,7 @@ ret = -1; goto out; } - ret = dict_set_uint32(dict, "force", _gf_true); + ret = dict_set_int32n(dict, "force", SLEN("force"), 1); if (ret) goto out; (*cmdi)++; @@ -3080,8 +3026,10 @@ cmdi++; } - if (type != GF_GSYNC_OPTION_TYPE_CONFIG && (cmdi < wordcount - 1 || glob)) + if (type != GF_GSYNC_OPTION_TYPE_CONFIG && (cmdi < wordcount - 1 || glob)) { + ret = -1; goto out; + } /* If got so far, input is valid, assemble the message */ @@ -3162,11 +3110,15 @@ goto out; } - if ((strcmp(w, "start") == 0 || strcmp(w, "stop") == 0) && wordcount > 5) + if ((strcmp(w, "start") == 0 || strcmp(w, "stop") == 0) && wordcount > 5) { + ret = -1; goto out; + } - if (strcmp(w, "info") == 0 && wordcount > 7) + if (strcmp(w, "info") == 0 && wordcount > 7) { + ret = -1; goto out; + } if (strcmp(w, "start") == 0) { op = GF_CLI_STATS_START; @@ -3663,7 +3615,7 @@ } ip_addr = strtok(tmp, ":"); pid = strtok(NULL, ":"); - if (valid_internet_address(ip_addr, _gf_true) && pid && + if (valid_internet_address(ip_addr, _gf_true, _gf_false) && pid && gf_valid_pid(pid, strlen(pid))) { ret = gf_asprintf(&option_str, "%s %s %s", words[3], ip_addr, pid); if (ret < 0) { @@ -3857,7 +3809,7 @@ ret = -1; goto out; } - if (!valid_internet_address(host_name, _gf_false)) { + if (!valid_internet_address(host_name, _gf_false, _gf_false)) { cli_err( "internet address '%s' does not conform to " "standards", @@ -3965,8 +3917,11 @@ gf_xl_afr_op_t op = GF_SHD_OP_INVALID; dict = dict_new(); - if (!dict) + if (!dict) { + gf_log(THIS->name, GF_LOG_ERROR, "Failed to create the dict"); + ret = -1; goto out; + } ret = dict_set_str(dict, "volname", (char *)words[2]); if (ret) { @@ -4509,7 +4464,7 @@ } if (strcmp(words[i], "no-timestamp") == 0) { - ret = dict_set_str(dict, "no-timestamp", "true"); + ret = dict_set_int32n(dict, "no-timestamp", SLEN("no-timestamp"), 1); if (ret) { gf_log("cli", GF_LOG_ERROR, "Could not save " @@ -5591,6 +5546,7 @@ break; default: + ret = -1; gf_log("", GF_LOG_ERROR, "Opword Mismatch"); goto out; } diff -Nru glusterfs-5.5/cli/src/cli-cmd-peer.c glusterfs-6.3/cli/src/cli-cmd-peer.c --- glusterfs-5.5/cli/src/cli-cmd-peer.c 2019-03-15 13:23:38.369461674 +0000 +++ glusterfs-6.3/cli/src/cli-cmd-peer.c 2019-06-11 13:14:55.555110057 +0000 @@ -18,7 +18,7 @@ #include "cli-mem-types.h" #include "cli1-xdr.h" #include "protocol-common.h" -#include "events.h" +#include extern struct rpc_clnt *global_rpc; @@ -60,7 +60,7 @@ if (ret) goto out; - ret = valid_internet_address((char *)words[2], _gf_false); + ret = valid_internet_address((char *)words[2], _gf_false, _gf_false); if (ret == 1) { ret = 0; } else { @@ -111,13 +111,20 @@ int sent = 0; int parse_error = 0; cli_local_t *local = NULL; + gf_answer_t answer = GF_ANSWER_NO; + const char *question = NULL; if ((wordcount < 3) || (wordcount > 4)) { cli_usage_out(word->pattern); parse_error = 1; goto out; } - + question = + "All clients mounted through the peer which is getting detached need " + "to be remounted using one of the other active peers in the trusted " + "storage pool to ensure client gets notification on any changes done " + "on the gluster configuration and if the same has been done do you " + "want to proceed?"; proc = &cli_rpc_prog->proctable[GLUSTER_CLI_DEPROBE]; frame = create_frame(THIS, THIS->ctx->pool); @@ -149,6 +156,11 @@ ret = dict_set_int32(dict, "flags", flags); if (ret) goto out; + answer = cli_cmd_get_confirmation(state, question); + if (GF_ANSWER_NO == answer) { + ret = 0; + goto out; + } CLI_LOCAL_INIT(local, words, frame, dict); diff -Nru glusterfs-5.5/cli/src/cli-cmd-system.c glusterfs-6.3/cli/src/cli-cmd-system.c --- glusterfs-5.5/cli/src/cli-cmd-system.c 2019-03-15 13:23:38.369461674 +0000 +++ glusterfs-6.3/cli/src/cli-cmd-system.c 2019-06-11 13:14:55.555110057 +0000 @@ -67,12 +67,13 @@ out: if (!proc && ret) { - if (dict) - dict_unref(dict); if (wordcount > 1) cli_out("Fetching spec for volume %s failed", (char *)words[2]); } + if (dict) + dict_unref(dict); + return ret; } @@ -109,12 +110,12 @@ out: if (!proc && ret) { - if (dict) - dict_unref(dict); if (wordcount > 1) cli_out("Fetching spec for volume %s failed", (char *)words[3]); } + if (dict) + dict_unref(dict); return ret; } @@ -264,8 +265,11 @@ proc = &cli_rpc_prog->proctable[GLUSTER_CLI_UMOUNT]; if (proc && proc->fn) { frame = create_frame(THIS, THIS->ctx->pool); - if (!frame) + if (!frame) { + gf_log(THIS->name, GF_LOG_ERROR, "failed to create frame"); + ret = -1; goto out; + } ret = proc->fn(frame, THIS, dict); } @@ -319,6 +323,9 @@ cli_out("uuid get failed"); } + if (dict) + dict_unref(dict); + CLI_STACK_DESTROY(frame); return ret; } @@ -380,6 +387,9 @@ cli_out("uuid reset failed"); } + if (dict) + dict_unref(dict); + CLI_STACK_DESTROY(frame); return ret; @@ -501,8 +511,11 @@ proc = &cli_rpc_prog->proctable[GLUSTER_CLI_SYS_EXEC]; if (proc->fn) { frame = create_frame(THIS, THIS->ctx->pool); - if (!frame) + if (!frame) { + gf_log(THIS->name, GF_LOG_ERROR, "failed to create frame"); + ret = -1; goto out; + } CLI_LOCAL_INIT(local, words, frame, dict); ret = proc->fn(frame, THIS, (void *)dict); @@ -559,8 +572,11 @@ proc = &cli_rpc_prog->proctable[GLUSTER_CLI_COPY_FILE]; if (proc && proc->fn) { frame = create_frame(THIS, THIS->ctx->pool); - if (!frame) + if (!frame) { + gf_log(THIS->name, GF_LOG_ERROR, "failed to create frame"); + ret = -1; goto out; + } CLI_LOCAL_INIT(local, words, frame, dict); ret = proc->fn(frame, THIS, (void *)dict); } diff -Nru glusterfs-5.5/cli/src/cli-cmd-volume.c glusterfs-6.3/cli/src/cli-cmd-volume.c --- glusterfs-5.5/cli/src/cli-cmd-volume.c 2019-03-15 13:23:38.370461677 +0000 +++ glusterfs-6.3/cli/src/cli-cmd-volume.c 2019-06-11 13:14:55.557110063 +0000 @@ -23,10 +23,10 @@ #include "cli-cmd.h" #include "cli-mem-types.h" #include "cli1-xdr.h" -#include "run.h" -#include "syscall.h" -#include "common-utils.h" -#include "events.h" +#include +#include +#include +#include extern struct rpc_clnt *global_rpc; extern struct rpc_clnt *global_quotad_rpc; @@ -177,8 +177,11 @@ proc = &cli_rpc_prog->proctable[GLUSTER_CLI_SYNC_VOLUME]; frame = create_frame(THIS, THIS->ctx->pool); - if (!frame) + if (!frame) { + gf_log(THIS->name, GF_LOG_ERROR, "failed to create frame"); + ret = -1; goto out; + } CLI_LOCAL_INIT(local, words, frame, dict); @@ -553,6 +556,8 @@ } CLI_STACK_DESTROY(frame); + if (dict) + dict_unref(dict); if (ret == 0 && GF_ANSWER_YES == answer) { gf_event(EVENT_VOLUME_STOP, "name=%s;force=%d", (char *)words[2], @@ -763,8 +768,11 @@ proc = &cli_rpc_prog->proctable[GLUSTER_CLI_PROFILE_VOLUME]; frame = create_frame(THIS, THIS->ctx->pool); - if (!frame) + if (!frame) { + gf_log(THIS->name, GF_LOG_ERROR, "failed to create frame"); + ret = -1; goto out; + } CLI_LOCAL_INIT(local, words, frame, options); @@ -844,13 +852,21 @@ #if (USE_EVENTS) if (ret == 0 && strcmp(words[2], "help") != 0) { ret1 = dict_get_int32(options, "count", &num_options); - if (ret1) + if (ret1) { num_options = 0; - else + goto end; + } else { num_options = num_options / 2; + } + char *free_list_key[num_options]; + char *free_list_val[num_options]; + for (i = 0; i < num_options; i++) { + free_list_key[i] = NULL; + free_list_val[i] = NULL; + } /* Initialize opts_str */ - opts_str = gf_strdup(""); + opts_str = ""; /* Prepare String in format options=KEY1,VALUE1,KEY2,VALUE2 */ for (i = 1; i <= num_options; i++) { @@ -860,6 +876,7 @@ tmp_opt = ""; gf_asprintf(&opts_str, "%s,%s", opts_str, tmp_opt); + free_list_key[i - 1] = opts_str; sprintf(dict_key, "value%d", i); ret1 = dict_get_str(options, dict_key, &tmp_opt); @@ -867,16 +884,21 @@ tmp_opt = ""; gf_asprintf(&opts_str, "%s,%s", opts_str, tmp_opt); + free_list_val[i - 1] = opts_str; } gf_event(EVENT_VOLUME_SET, "name=%s;options=%s", (char *)words[2], opts_str); /* Allocated by gf_strdup and gf_asprintf */ - GF_FREE(opts_str); + for (i = 0; i < num_options; i++) { + GF_FREE(free_list_key[i]); + GF_FREE(free_list_val[i]); + } } #endif +end: CLI_STACK_DESTROY(frame); return ret; @@ -960,6 +982,10 @@ bricklist = GF_CALLOC(eventstrlen, sizeof(char), gf_common_mt_char); if (!bricklist) { + gf_log(THIS->name, GF_LOG_ERROR, + "memory allocation failed for" + "bricklist"); + ret = -1; goto out; } @@ -1392,8 +1418,11 @@ proc = &cli_rpc_prog->proctable[GLUSTER_CLI_TIER]; frame = create_frame(THIS, THIS->ctx->pool); - if (!frame) + if (!frame) { + gf_log(THIS->name, GF_LOG_ERROR, "failed to create frame"); + ret = -1; goto out; + } CLI_LOCAL_INIT(local, words, frame, options); @@ -1528,7 +1557,7 @@ cli_local_t *local = NULL; call_frame_t *frame = NULL; dict_t *xdata = NULL; - char *gfid_str = NULL; + char gfid_str[UUID_CANONICAL_FORM_LEN + 1]; char *volname = NULL; char *volname_dup = NULL; unsigned char buf[16] = {0}; @@ -1632,12 +1661,6 @@ CLI_LOCAL_INIT(local, words, frame, xdata); proc = &cli_quotad_clnt.proctable[GF_AGGREGATOR_GETLIMIT]; - gfid_str = GF_CALLOC(1, gf_common_mt_char, 64); - if (!gfid_str) { - ret = -1; - goto out; - } - for (count = 0;; count++) { ret = quota_conf_read_gfid(fd, buf, &gfid_type, version); if (ret == 0) { @@ -1736,12 +1759,13 @@ "xml format"); } } + if (xdata) + dict_unref(xdata); if (fd != -1) { sys_close(fd); } - GF_FREE(gfid_str); if (ret) { gf_log("cli", GF_LOG_ERROR, "Could not fetch and display quota" @@ -1768,6 +1792,7 @@ int event_type = -1; char *tmp = NULL; char *events_str = NULL; + char *volname = NULL; #endif ret = cli_cmd_bitrot_parse(words, wordcount, &options); @@ -1813,10 +1838,9 @@ if (ret1) cmd_type = -1; else { - ret1 = dict_get_str(options, "volname", &tmp); + ret1 = dict_get_str(options, "volname", &volname); if (ret1) - tmp = ""; - gf_asprintf(&events_str, "name=%s", tmp); + volname = ""; } switch (cmd_type) { @@ -1834,21 +1858,21 @@ ret1 = dict_get_str(options, "scrub-throttle-value", &tmp); if (ret1) tmp = ""; - gf_asprintf(&events_str, "%s;value=%s", events_str, tmp); + gf_asprintf(&events_str, "name=%s;value=%s", volname, tmp); break; case GF_BITROT_OPTION_TYPE_SCRUB_FREQ: event_type = EVENT_BITROT_SCRUB_FREQ; ret1 = dict_get_str(options, "scrub-frequency-value", &tmp); if (ret1) tmp = ""; - gf_asprintf(&events_str, "%s;value=%s", events_str, tmp); + gf_asprintf(&events_str, "name=%s;value=%s", volname, tmp); break; case GF_BITROT_OPTION_TYPE_SCRUB: event_type = EVENT_BITROT_SCRUB_OPTION; ret1 = dict_get_str(options, "scrub-value", &tmp); if (ret1) tmp = ""; - gf_asprintf(&events_str, "%s;value=%s", events_str, tmp); + gf_asprintf(&events_str, "name=%s;value=%s", volname, tmp); break; default: break; @@ -1957,6 +1981,8 @@ "Quota command failed. Please check the cli " "logs for more details"); } + if (options) + dict_unref(options); /* Events for Quota */ if (ret == 0) { @@ -2133,6 +2159,8 @@ #endif CLI_STACK_DESTROY(frame); + if (options) + dict_unref(options); return ret; } @@ -2289,8 +2317,11 @@ proc = &cli_rpc_prog->proctable[GLUSTER_CLI_TOP_VOLUME]; frame = create_frame(THIS, THIS->ctx->pool); - if (!frame) + if (!frame) { + gf_log(THIS->name, GF_LOG_ERROR, "failed to create frame"); + ret = -1; goto out; + } CLI_LOCAL_INIT(local, words, frame, options); @@ -2338,8 +2369,11 @@ proc = &cli_rpc_prog->proctable[GLUSTER_CLI_LOG_ROTATE]; frame = create_frame(THIS, THIS->ctx->pool); - if (!frame) + if (!frame) { + gf_log(THIS->name, GF_LOG_ERROR, "failed to create frame"); + ret = -1; goto out; + } ret = cli_cmd_log_rotate_parse(words, wordcount, &options); if (ret) @@ -2608,12 +2642,17 @@ proc = &cli_rpc_prog->proctable[GLUSTER_CLI_STATUS_ALL]; } - if (!proc->fn) + if (!proc->fn) { + ret = -1; goto out; + } frame = create_frame(THIS, THIS->ctx->pool); - if (!frame) + if (!frame) { + gf_log(THIS->name, GF_LOG_ERROR, "failed to create frame"); + ret = -1; goto out; + } CLI_LOCAL_INIT(local, words, frame, dict); @@ -2932,6 +2971,9 @@ } } + if (options) + dict_unref(options); + CLI_STACK_DESTROY(frame); return ret; @@ -3361,6 +3403,11 @@ {"volume set ", cli_cmd_volume_set_cbk, "set options for volume "}, + {"volume set group ", cli_cmd_volume_set_cbk, + "This option can be used for setting multiple pre-defined volume options" + "where group_name is a file under /var/lib/glusterd/groups containing one" + "key, value pair per line"}, + {"volume log rotate [BRICK]", cli_cmd_log_rotate_cbk, "rotate the log file for corresponding volume/brick"}, @@ -3375,10 +3422,12 @@ "reset all the reconfigured options"}, #if (SYNCDAEMON_COMPILE) - {"volume " GEOREP " [] [] {create [[ssh-port n] " - "[[no-verify]|[push-pem]]] [force]" - "|start [force]|stop [force]|pause [force]|resume [force]|config|status " - "[detail]|delete [reset-sync-time]} [options...]", + {"volume " GEOREP " [] [] {\\\n create [[ssh-port n] " + "[[no-verify] | [push-pem]]] [force] \\\n" + " | start [force] \\\n | stop [force] \\\n | pause [force] \\\n | resume " + "[force] \\\n" + " | config [[[\\!]