From patchwork Mon Sep 30 18:54:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11167107 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91D4D16B1 for ; Mon, 30 Sep 2019 18:59:01 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7881C224D5 for ; Mon, 30 Sep 2019 18:59:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7881C224D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 31E7F5C3E62; Mon, 30 Sep 2019 11:58:06 -0700 (PDT) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 772B45C3165 for ; Mon, 30 Sep 2019 11:57:00 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id 395D4100537C; Mon, 30 Sep 2019 14:56:56 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 32DA7BF; Mon, 30 Sep 2019 14:56:56 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Mon, 30 Sep 2019 14:54:25 -0400 Message-Id: <1569869810-23848-7-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1569869810-23848-1-git-send-email-jsimmons@infradead.org> References: <1569869810-23848-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 006/151] lustre: support for gcc8 X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Alex Zhuravlev Building with gcc8 reports new warnings which are addressed in this patch. WC-bug-id: https://jira.whamcloud.com/browse/LU-11233 Lustre-commit: 6601661f9632 ("LU-11233 build: support for gcc8") Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/34660 Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Signed-off-by: James Simmons --- fs/lustre/lmv/lmv_obd.c | 14 ++++++++------ fs/lustre/obdclass/genops.c | 2 +- net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 3 +-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/fs/lustre/lmv/lmv_obd.c b/fs/lustre/lmv/lmv_obd.c index 1c43022..acef43d 100644 --- a/fs/lustre/lmv/lmv_obd.c +++ b/fs/lustre/lmv/lmv_obd.c @@ -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", diff --git a/fs/lustre/obdclass/genops.c b/fs/lustre/obdclass/genops.c index 9a9de35..4b528a7 100644 --- a/fs/lustre/obdclass/genops.c +++ b/fs/lustre/obdclass/genops.c @@ -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); diff --git a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c index b9585f6..871d4fb 100644 --- a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -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;