Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4883206ybf; Wed, 4 Mar 2020 12:38:37 -0800 (PST) X-Google-Smtp-Source: ADFU+vvD+acpROUyPVINmragcRVhCe0dHdOFfQZP/tk0EdwkFz8TKAYDW+imhjTtUlvLkwX+06nH X-Received: by 2002:a05:6830:2102:: with SMTP id i2mr3704202otc.123.1583354316926; Wed, 04 Mar 2020 12:38:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583354316; cv=none; d=google.com; s=arc-20160816; b=M1y1dSr2Yz/vIdPpYJBbT5tEpUVW8SiSvBjgThs1rppC7lcFR6NK0EyHDtfX6tDAj1 70o+WoagF0vmPdCMaSbhzlyI/fd/61TzWHIbl3xbHS1v8cIo7Wpgcd0hCiU0NZU8ZUmJ 2wNLIi2cqQ+htbfF52AuCspDykXIwt411BJuOAUfUVTnWIgXBMdNFIsIuAPHgF9MNgNd iPoGgCpnZszlIkV/9VgjjhKwUUR1l6LFn0P71/d8gaaAxmtBm3wP2G4FOAyt2pnFnFmS g/f3ZniuoICMG1LvwJGXoXlYHQ/l1KePR6dVrDXRDpcm577/5/RFaMwp62pDwxianA2k V4mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=UMwVhW2Nb3uOp3IuMqdjRyWg+m5O8BbtftWwz+DC160=; b=OjGf0TO3V+DjJo8tVWoX5+2ohvOJxSPg9NxfoD0OSGZpr6s67N/J1W/NlMsoH79raI A6gSNtllYjJjkJysm+h1p4XddOGcatp2U1FdDp4a6rlBkOET5egTtKSO7MdKMeUAoOO3 GuanlQGd5rmKnN8JLhwfRtkjgXnSsScalF+W1CQnYCWq6g1bD2NIFUix7etqcMxKFrxs 8uk/q8kXd+Mbm/jlo09TQmS0/m2zR5l27Zm1RCRYcgQaDJ0PKCyG866emr551KrOk42n BRK+mCfL7WHYZP9/+faZ8gDqMK5rEXM3q0GKwC0NacqfGu1ayaFK+38cqXpXdPsa6SXD IqKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hz3fbN5u; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u4si1871731oic.115.2020.03.04.12.38.25; Wed, 04 Mar 2020 12:38:36 -0800 (PST) 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=@kernel.org header.s=default header.b=hz3fbN5u; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388616AbgCDUhA (ORCPT + 99 others); Wed, 4 Mar 2020 15:37:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:37320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388482AbgCDUg4 (ORCPT ); Wed, 4 Mar 2020 15:36:56 -0500 Received: from tleilax.poochiereds.net (68-20-15-154.lightspeed.rlghnc.sbcglobal.net [68.20.15.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 74E5721556; Wed, 4 Mar 2020 20:36:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583354215; bh=ZK3EZH24PdCA4p7WCYRCBidIeBe2zKk0o/B3DsyXUa0=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=hz3fbN5uN/sdJi1K+xLlQ9TrsNkRtVwRQJs7dmN7PvDmGNH6t7tP31oRWZgm9c3wJ Xxk6WgX6q4THg8LmiiNnmpjeSh8hH1pS7Z0vM0ivD4H/Bn6y02Oxc64Cdk+2omq7Ua +QyrBjNbneUXapBT9Q2oTzY55tWuO3xLJzPW2T0w= Message-ID: Subject: Re: [PATCH] fs/ceph/export: remove unused variable 'err' From: Jeff Layton To: Qiujun Huang Cc: sage@redhat.com, idryomov@gmail.com, ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 04 Mar 2020 15:36:54 -0500 In-Reply-To: <1583252499-16078-1-git-send-email-hqjagain@gmail.com> References: <1583252499-16078-1-git-send-email-hqjagain@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-03-04 at 00:21 +0800, Qiujun Huang wrote: > fix gcc '-Wunused-but-set-variable' warning: > fs/ceph/export.c: In function ‘__get_parent’: > fs/ceph/export.c:294:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable] > int err; > > and needn't use the return value of ceph_mdsc_create_request. > > Signed-off-by: Qiujun Huang > --- > fs/ceph/export.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/ceph/export.c b/fs/ceph/export.c > index b6bfa94..b7bb41c 100644 > --- a/fs/ceph/export.c > +++ b/fs/ceph/export.c > @@ -291,7 +291,6 @@ static struct dentry *__get_parent(struct super_block *sb, > struct ceph_mds_request *req; > struct inode *inode; > int mask; > - int err; > > req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_LOOKUPPARENT, > USE_ANY_MDS); > @@ -314,7 +313,7 @@ static struct dentry *__get_parent(struct super_block *sb, > req->r_args.getattr.mask = cpu_to_le32(mask); > > req->r_num_caps = 1; > - err = ceph_mdsc_do_request(mdsc, NULL, req); > + ceph_mdsc_do_request(mdsc, NULL, req); > inode = req->r_target_inode; > if (inode) > ihold(inode); I think we probably ought to just return ERR_PTR(err) in that case instead of discarding it. It looks like today we'll end up returning ENOENT when that errors out which doesn't seem right when there is a different issue. -- Jeff Layton