@@ -640,6 +640,7 @@ static int lmv_fid2path(struct obd_export *exp, int len, void *karg,
if (remote_gf) {
struct getinfo_fid2path *ori_gf;
char *ptr;
+ int len;
ori_gf = karg;
if (strlen(ori_gf->gf_path) + 1 +
@@ -650,12 +651,13 @@ static int lmv_fid2path(struct obd_export *exp, int len, void *karg,
ptr = ori_gf->gf_path;
- memmove(ptr + strlen(gf->gf_path) + 1, ptr,
- strlen(ori_gf->gf_path));
-
- strncpy(ptr, gf->gf_path, strlen(gf->gf_path));
- ptr += strlen(gf->gf_path);
- *ptr = '/';
+ len = strlen(gf->gf_path);
+ /* move the current path to the right to release space
+ * for closer-to-root part
+ */
+ memmove(ptr + len + 1, ptr, strlen(ori_gf->gf_path));
+ memcpy(ptr, gf->gf_path, len);
+ ptr[len] = '/';
}
CDEBUG(D_INFO, "%s: get path %s " DFID " rec: %llu ln: %u\n",
@@ -322,7 +322,7 @@ struct obd_device *class_newdev(const char *type_name, const char *name,
newdev->obd_conn_inprogress = 0;
- strncpy(newdev->obd_uuid.uuid, uuid, strlen(uuid));
+ strncpy(newdev->obd_uuid.uuid, uuid, UUID_MAX);
CDEBUG(D_IOCTL, "Allocate new device %s (%p)\n",
newdev->obd_name, newdev);
@@ -1763,7 +1763,7 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
struct kib_tx *tx;
int nob;
int post_credit = IBLND_POSTRX_PEER_CREDIT;
- u64 ibprm_cookie;
+ u64 ibprm_cookie = rxmsg->ibm_u.putreq.ibprm_cookie;
int rc = 0;
LASSERT(iov_iter_count(to) <= rlen);
@@ -1796,7 +1796,6 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
break;
case IBLND_MSG_PUT_REQ: {
- u64 ibprm_cookie = rxmsg->ibm_u.putreq.ibprm_cookie;
struct kib_msg *txmsg;
struct kib_rdma_desc *rd;