diff options
-rw-r--r-- | xlators/features/index/src/index.c | 2 | ||||
-rw-r--r-- | xlators/features/shard/src/shard.c | 4 | ||||
-rw-r--r-- | xlators/features/upcall/src/upcall-internal.c | 4 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-bitrot.c | 8 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-locks.c | 4 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-mountbroker.c | 2 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 20 |
7 files changed, 22 insertions, 22 deletions
diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 86c21e9aa83..3a518248c13 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -1081,7 +1081,7 @@ index_inode_path (xlator_t *this, inode_t *inode, char *dirpath, size_t len) } make_index_dir_path (priv->index_basepath, ENTRY_CHANGES_SUBDIR, dirpath, len); - if (len <= strlen (dirpath) + 1 /*'/'*/ + strlen (UUID0_STR)) { + if (len <= strlen (dirpath) + 1 /*'/'*/ + SLEN (UUID0_STR)) { ret = -EINVAL; goto out; } diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index 39f144e9668..6c075ac5bf7 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -6209,7 +6209,7 @@ shard_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, if ((frame->root->pid != GF_CLIENT_PID_GSYNCD) && (name) && (!strncmp (name, SHARD_XATTR_PREFIX, - strlen (SHARD_XATTR_PREFIX)))) { + SLEN (SHARD_XATTR_PREFIX)))) { op_errno = ENODATA; goto out; } @@ -6249,7 +6249,7 @@ shard_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, if ((frame->root->pid != GF_CLIENT_PID_GSYNCD) && (name) && (!strncmp (name, SHARD_XATTR_PREFIX, - strlen (SHARD_XATTR_PREFIX)))) { + sizeof (SHARD_XATTR_PREFIX) - 1))) { op_errno = ENODATA; goto out; } diff --git a/xlators/features/upcall/src/upcall-internal.c b/xlators/features/upcall/src/upcall-internal.c index 73ade8324b7..7635063c14e 100644 --- a/xlators/features/upcall/src/upcall-internal.c +++ b/xlators/features/upcall/src/upcall-internal.c @@ -442,7 +442,7 @@ up_compare_afr_xattr (dict_t *d, char *k, data_t *v, void *tmp) { dict_t *dict = tmp; - if (!strncmp (k, AFR_XATTR_PREFIX, strlen (AFR_XATTR_PREFIX)) + if (!strncmp (k, AFR_XATTR_PREFIX, SLEN (AFR_XATTR_PREFIX)) && (!is_data_equal (v, dict_get (dict, k)))) return -1; @@ -457,7 +457,7 @@ up_filter_afr_xattr (dict_t *xattrs, char *xattr, data_t *v) * be executed only in case of xattrop and not in set and removexattr, * butset and remove xattr fops do not come with keys AFR_XATTR_PREFIX */ - if (!strncmp (xattr, AFR_XATTR_PREFIX, strlen (AFR_XATTR_PREFIX)) + if (!strncmp (xattr, AFR_XATTR_PREFIX, SLEN (AFR_XATTR_PREFIX)) && (mem_0filled (v->data, v->len) == 0)) { dict_del (xattrs, xattr); } diff --git a/xlators/mgmt/glusterd/src/glusterd-bitrot.c b/xlators/mgmt/glusterd/src/glusterd-bitrot.c index a9e02693bbc..10babdb08fa 100644 --- a/xlators/mgmt/glusterd/src/glusterd-bitrot.c +++ b/xlators/mgmt/glusterd/src/glusterd-bitrot.c @@ -130,7 +130,7 @@ __glusterd_handle_bitrot (rpcsvc_request_t *req) goto out; } - if (!strncmp (scrub, "status", strlen ("status"))) { + if (!strncmp (scrub, "status", SLEN ("status"))) { ret = glusterd_op_begin_synctask (req, GD_OP_SCRUB_STATUS, dict); @@ -158,7 +158,7 @@ __glusterd_handle_bitrot (rpcsvc_request_t *req) goto out; } - if (!strncmp (scrub, "ondemand", strlen ("ondemand"))) { + if (!strncmp (scrub, "ondemand", SLEN ("ondemand"))) { ret = glusterd_op_begin_synctask (req, GD_OP_SCRUB_ONDEMAND, dict); @@ -715,8 +715,8 @@ glusterd_op_stage_bitrot (dict_t *dict, char **op_errstr, dict_t *rsp_dict) * "Active" in the dictionary. */ if (!strcmp (scrub_cmd_from_dict, scrub_cmd) || (!strncmp ("Active", scrub_cmd_from_dict, - strlen("Active")) && !strncmp ("resume", - scrub_cmd, strlen("resume")))) { + SLEN ("Active")) && !strncmp ("resume", + scrub_cmd, SLEN ("resume")))) { snprintf (msg, sizeof (msg), "Scrub is already" " %sd for volume %s", scrub_cmd, volinfo->volname); diff --git a/xlators/mgmt/glusterd/src/glusterd-locks.c b/xlators/mgmt/glusterd/src/glusterd-locks.c index 1e99117b3a1..f9b0409b60d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-locks.c +++ b/xlators/mgmt/glusterd/src/glusterd-locks.c @@ -740,7 +740,7 @@ gd_mgmt_v3_unlock_timer_cbk (void *data) ret = snprintf (bt_key, PATH_MAX, "debug.last-success-bt-%s-%s", name, type + 1); - if (ret != strlen ("debug.last-success-bt-") + strlen (name) + + if (ret != SLEN ("debug.last-success-bt-") + strlen (name) + strlen (type)) { gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_CREATE_KEY_FAIL, "Unable to create backtrace " @@ -875,7 +875,7 @@ glusterd_mgmt_v3_unlock (const char *name, uuid_t uuid, char *type) /* Remove the backtrace key as well */ ret = snprintf (key, sizeof(key), "debug.last-success-bt-%s-%s", name, type); - if (ret != strlen ("debug.last-success-bt-") + strlen (name) + + if (ret != SLEN ("debug.last-success-bt-") + strlen (name) + strlen (type) + 1) { gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_CREATE_KEY_FAIL, "Unable to create backtrace " diff --git a/xlators/mgmt/glusterd/src/glusterd-mountbroker.c b/xlators/mgmt/glusterd/src/glusterd-mountbroker.c index 8554db03173..c205b911d8e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-mountbroker.c +++ b/xlators/mgmt/glusterd/src/glusterd-mountbroker.c @@ -281,7 +281,7 @@ make_georep_mountspec (gf_mount_spec_t *mspec, const char *volnames, if (*p == ',') vc++; } - siz = strlen (volnames) + vc * strlen("volfile-id="); + siz = strlen (volnames) + vc * SLEN ("volfile-id="); meetspec = GF_CALLOC (1, siz + 1, gf_gld_mt_georep_meet_spec); if (!meetspec) goto out; diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index c013f64c2fe..cd2c364464d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -446,16 +446,16 @@ glusterd_check_bitrot_cmd (char *key, char *value, char *errstr, size_t size) { int ret = -1; - if ((!strncmp (key, "bitrot", strlen ("bitrot"))) || - (!strncmp (key, "features.bitrot", strlen ("features.bitrot")))) { + if ((!strncmp (key, "bitrot", SLEN ("bitrot"))) || + (!strncmp (key, "features.bitrot", SLEN ("features.bitrot")))) { snprintf (errstr, size, " 'gluster volume set <VOLNAME> %s' " "is invalid command. Use 'gluster volume bitrot " "<VOLNAME> {enable|disable}' instead.", key); ret = -1; goto out; - } else if ((!strncmp (key, "scrub-freq", strlen ("scrub-freq"))) || + } else if ((!strncmp (key, "scrub-freq", SLEN ("scrub-freq"))) || (!strncmp (key, "features.scrub-freq", - strlen ("features.scrub-freq")))) { + SLEN ("features.scrub-freq")))) { snprintf (errstr, size, " 'gluster volume " "set <VOLNAME> %s' is invalid command. Use 'gluster " "volume bitrot <VOLNAME> scrub-frequency" @@ -463,18 +463,18 @@ glusterd_check_bitrot_cmd (char *key, char *value, char *errstr, size_t size) key); ret = -1; goto out; - } else if ((!strncmp (key, "scrub", strlen ("scrub"))) || + } else if ((!strncmp (key, "scrub", SLEN ("scrub"))) || (!strncmp (key, "features.scrub", - strlen ("features.scrub")))) { + SLEN ("features.scrub")))) { snprintf (errstr, size, " 'gluster volume set <VOLNAME> %s' is " "invalid command. Use 'gluster volume bitrot " "<VOLNAME> scrub {pause|resume}' instead.", key); ret = -1; goto out; } else if ((!strncmp (key, "scrub-throttle", - strlen ("scrub-throttle"))) || + SLEN ("scrub-throttle"))) || (!strncmp (key, "features.scrub-throttle", - strlen ("features.scrub-throttle")))) { + SLEN ("features.scrub-throttle")))) { snprintf (errstr, size, " 'gluster volume set <VOLNAME> %s' is " "invalid command. Use 'gluster volume bitrot " "<VOLNAME> scrub-throttle {lazy|normal|aggressive}' " @@ -841,10 +841,10 @@ glusterd_validate_shared_storage (char *key, char *value, char *errstr) goto out; } - if (!strncmp (value, "disable", strlen ("disable"))) { + if (!strncmp (value, "disable", SLEN ("disable"))) { ret = dict_get_str (conf->opts, GLUSTERD_SHARED_STORAGE_KEY, &op); - if (ret || !strncmp (op, "disable", strlen ("disable"))) { + if (ret || !strncmp (op, "disable", SLEN ("disable"))) { snprintf (errstr, PATH_MAX, "Shared storage volume " "does not exist. Please enable shared storage" " for creating shared storage volume."); |