Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp802868yba; Thu, 16 May 2019 09:08:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5rSLyuWqQF9Vdi7P9526Q0FixtrxUDjTDJ58c0ANvNvKJTj2z4EK2iNnGFaXEQeOCZdfU X-Received: by 2002:a65:4283:: with SMTP id j3mr3302638pgp.88.1558022920925; Thu, 16 May 2019 09:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558022920; cv=none; d=google.com; s=arc-20160816; b=vfkNknC5EAA1WPpOgoZGZ2Vsg4reM+GhJP7bFRwyu4lftQn6WAKV4zJAkIz01uU4OR E5iN+0RdoKzK99Hm5Q8Q/xefE+Zz6sVuvsqSm34fYBXLoexur46Hk/9CG1EVaMoLFZkq kLeir5qJ8TY7mMLuE9/TXbzitMIVHdZiufZunzddQ7ECurYaYLRZiIiaHTAdiB/pqVro ZmTlWT00N5+2ApqQdL3nGB2hCx34nbRcMQX/cSOtNAVHJtyMwIENRs92/qS6qSkNqBUO 1aKcE6OSRVIpXrMGv779AV9VT9/r3eFiBHtPmtsr9gA8kMPofzRR0bu4U8S1xGG+QBEV +2tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CHWyz1LU+xHA4Q1ska4TffuV2AfB2TvrKTO3gR0GbGE=; b=ij2Uu3CBqa9s3zWgaP/Uiat630dQhEaawMRnWzHJ1i59wVTQPEI44IrPMMDYzgzwVv lvqXNYTa4brZMwzpQBfLvDp5tyvKSMAhYTSEiJdemqAtFa5lDMQMh4kFifRWsYJVuoce n/HImCPoHQyV54lqHT+bdjz7ApqmmsufKATKa1PXgjvdWaQsZDKjr22vT21nqT+T1hWy xV8Wf9GvJVDfna5qjLVX0tlM3YHnywXksC3hSXOioPBTEL5AvZbks44OSihW6K3Kg2Xg 9rIOLvYfFLKcbUK46NOwf7bbdk9Nx+x4q5zNPM3F1tFKbvOgkBShU5/yrN9pIbVW6p3P B5Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@omnibond-com.20150623.gappssmtp.com header.s=20150623 header.b=Y0mXezBZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 92si545351plw.163.2019.05.16.09.08.02; Thu, 16 May 2019 09:08:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@omnibond-com.20150623.gappssmtp.com header.s=20150623 header.b=Y0mXezBZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbfEPQGn (ORCPT + 99 others); Thu, 16 May 2019 12:06:43 -0400 Received: from mail-yb1-f194.google.com ([209.85.219.194]:40965 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726529AbfEPQGm (ORCPT ); Thu, 16 May 2019 12:06:42 -0400 Received: by mail-yb1-f194.google.com with SMTP id a13so1450825ybl.8 for ; Thu, 16 May 2019 09:06:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omnibond-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CHWyz1LU+xHA4Q1ska4TffuV2AfB2TvrKTO3gR0GbGE=; b=Y0mXezBZVxIxseokZsbxqalDY+MaBWbgOOboidAQf5Pma6GdOx6ZZxVHR30++t/Y7q P4kua8WZMlbWVIE1t/ywUPS4L/qmMs+NyeEkbC5QIECT0cXdsBYd+UxeuKIbXXG6cx+1 GY+oD0njrg6/P9nBGOCHBvBWGQRZfp5OOeFqsacn0cJDfuCyPZFJ3UECh54jrCIETv2A ebwlOHH7So5wen48Z0j33UczjRMSJT+kNffsRx55e6kC/3la9syO+SwhKOvdhx2DrBqo x1GWHEYxpzdmhD2PZmvHYLIkmozTXQny5F7/UQOE1XrIru48Nw44/P9PWTS4gBKhljp5 3dsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CHWyz1LU+xHA4Q1ska4TffuV2AfB2TvrKTO3gR0GbGE=; b=cXQOmoeXCuAgTpawe2lim+jWXV+SpPALdaYs2wUO8khTYr232OdGimUuMEHSjkWeiD zwAa3NAFg7CCOcRQzIX5hOzj//+SXiNonkiPpUrW/VsKcDcJFIYbhSgD1Ga0LO8ExGR2 nC/KxiV3WWaRdrvpFyJv4goXROabiw54xbU9x9g1CXu1tvgIC1WY++0/o2pNifOV2Mub tP0BPejqc9paNiOymi7cTB9zgcrvOdPkd4vy34rgZ5nRHmI6Z2+ok0/V+G9ACMoh738h r9EsI5kcCzoBQz5vi8sNpkZ5GkZ/qNdNE2IV825iOSoCtoFjDRjGjwtXJ0+Esplx5hzV TCDA== X-Gm-Message-State: APjAAAUj8AtgS0Pa2ycUzR0CqXkI1VbTvzhHyn6BFT6szhcQ+nYEUA/h KOtlXqqezGeANmu1hFGTT9rX8jH9szSieK0Twy0ddQ== X-Received: by 2002:a25:26c7:: with SMTP id m190mr22880219ybm.486.1558022802021; Thu, 16 May 2019 09:06:42 -0700 (PDT) MIME-Version: 1.0 References: <20190511132700.4862-1-colin.king@canonical.com> In-Reply-To: <20190511132700.4862-1-colin.king@canonical.com> From: Mike Marshall Date: Thu, 16 May 2019 12:06:31 -0400 Message-ID: Subject: Re: [PATCH] orangefs: remove redundant assignment to variable buffer_index To: Colin King Cc: Martin Brandenburg , devel@lists.orangefs.org, kernel-janitors@vger.kernel.org, LKML , Mike Marshall Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Colin... Thanks for the patch. Before I initialized buffer_index, Dan Williams sent in a warning that a particular error path could try to use ibuffer_index uninitialized. I could induce the problem he described with one of the xfstests resulting in a crashed kernel. I will try to refactor the code to fix the problem some other way than initializing buffer_index in the declaration. -Mike On Sat, May 11, 2019 at 9:27 AM Colin King wrote: > > From: Colin Ian King > > The variable buffer_index is being initialized however this is never > read and later it is being reassigned to a new value. The initialization > is redundant and hence can be removed. > > Addresses-Coverity: ("Unused Value") > Signed-off-by: Colin Ian King > --- > fs/orangefs/file.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c > index a35c17017210..80f06ee794c5 100644 > --- a/fs/orangefs/file.c > +++ b/fs/orangefs/file.c > @@ -52,7 +52,7 @@ ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inode, > struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode); > struct orangefs_khandle *handle = &orangefs_inode->refn.khandle; > struct orangefs_kernel_op_s *new_op = NULL; > - int buffer_index = -1; > + int buffer_index; > ssize_t ret; > size_t copy_amount; > > -- > 2.20.1 >