Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4189562ybf; Tue, 3 Mar 2020 22:23:51 -0800 (PST) X-Google-Smtp-Source: ADFU+vtLHXt3sHXshAx+dTPx70r7TBIJ1/MPk2LBta1n11LRQAhec97VlmNC3ynItz08P+VNNA9s X-Received: by 2002:a9d:ecc:: with SMTP id 70mr1148860otj.182.1583303031322; Tue, 03 Mar 2020 22:23:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583303031; cv=none; d=google.com; s=arc-20160816; b=IyYfoHbueHE+Rf40oyOb3wyRaHUjBYzFAeVNVGZcf6JL4Oze6JXgmxjwRrFZr91cle 1hz8hQFDzdHXSlx30oz/ezqJZKzVYYEJ2FkHlpygSRAOjvHlNHqkvaB/siHEYFBWVwZB b3TzQ7RWsgIw4dUn2jOAqh5n7v+nl+gkwhubV7ff1DLNIsbaa8UdbA2jcalfSTH+0J9C 2jdfdZw3x5iAeRocUo9Vi9bd/GzKBfOWD8bbozlVmH4KCm6UA3BOZ6zjDSOaeiyjXLJo +az6k5nHACW5tvXwmQ5E238cvyptvizKADe+Do+vaL1EBZUDMHn4wBFNVhnH4RjPYG/S 62EQ== 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=tbcuDfYaDl0s2pOUxHvvOkfOWHYsJpebfP0ObmyJLhA=; b=ciyDAATdzfU+MjGKpP/pHIYXaLQe6/Xbf91QwyMDX4KFPQ6d5ibnO0ZPN39ATWk2hv mqagSwiHtFk2hud+8V0XD6y5XuuoRy8KnsGmur6dn1dys7jruksaTfYtg5HYsLA96CIB gEFX55xnLip2My6hz1c2GtF7o6VOmhgn/SlH0G3wBkHn3aZFpaLMa+lGoNli2SG9OAdr wU3gOy3Sg60Z8k4RwE+LoESrEQPFmKtF3LJBdhjf1ShTgyG+TKVUF1ngzPeGdyRsuFCh sTQWt1rLkxMSGPgolYlYC/ExXqszK+77XydFW35fDEUbopXeWmqGlbsx6DyEmEHiPVTd wDWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pnUUEvB3; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l15si655283oig.146.2020.03.03.22.23.37; Tue, 03 Mar 2020 22:23:51 -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=@gmail.com header.s=20161025 header.b=pnUUEvB3; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725965AbgCDGXa (ORCPT + 99 others); Wed, 4 Mar 2020 01:23:30 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:39803 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725271AbgCDGX3 (ORCPT ); Wed, 4 Mar 2020 01:23:29 -0500 Received: by mail-yw1-f67.google.com with SMTP id x184so980944ywd.6; Tue, 03 Mar 2020 22:23:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tbcuDfYaDl0s2pOUxHvvOkfOWHYsJpebfP0ObmyJLhA=; b=pnUUEvB3emIIYIR+4DE+c2kjKv/n3JDAttQZl/Z8rY5peVO84IFZ7XMRFn9sGz13ki 7xYAbcCnds8+jE3Az1o6tS6Vm0utLaCW75ICVgGZ36fvpIW5pNm4AhSJONxVtqsMlhQ8 tJNldWnRN0W9DXGj6W9iGcdmxomrCXhDZGwPgyezJSieiMeBjiVcstmnvKXulRAZssbP g6lqxXdV6UB42snjshIGMEvZF/8PUKHp1iQi71wp2TNfyJxRXDZSlyyOZFv8kvSe+hSV fORT4Wbocws1DsnD1VTADO3nTJX4Rrpndhhm5qtsli8VqT35VW9LbRPAC6+kFYnx+51p E96A== 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=tbcuDfYaDl0s2pOUxHvvOkfOWHYsJpebfP0ObmyJLhA=; b=LUKkBSuI/Oz50G51Wn12C3voyJ0nuR4xOVljiuoI/YJsTbH4G3eDUDb/p3kw5ahpW7 u8WOE9EyufaKeTN4w6HMiCQ94vKfAgPevo5JBWuWi+KpEgGB0NouSxLv+H6HIbq5GCa4 uX6pYBLgdd4UtfdpHY2l2v+e6aUqwp/SsHM2EVruUs0p6yXjDFPuo89JKsBhbYt9wAyj aY0wKCuXqXLmvevJoLZQDk5hh0iGdlFCT5/Ky0kSXLQ+aDt5A7/jF5v+fo8f+uqac7Oz QXUlgRGetuG2Yfy8UROPr4SCX476mpwuEMYvTxlPdiiq/zD7MMw9SNnOgzfiBAa0knUr rJVA== X-Gm-Message-State: ANhLgQ2d+aGvLlmdxPENeT01HWObMhHuo10YXEOAPb2KihbT/nN4/GZc NM+tLrSgaCzbUksFgxkbmI2idHc+EWIfXJ42PIXDGQ== X-Received: by 2002:a81:4cc2:: with SMTP id z185mr1475074ywa.357.1583303007222; Tue, 03 Mar 2020 22:23:27 -0800 (PST) MIME-Version: 1.0 References: <1583278783-11584-1-git-send-email-hqjagain@gmail.com> In-Reply-To: <1583278783-11584-1-git-send-email-hqjagain@gmail.com> From: Steve French Date: Wed, 4 Mar 2020 00:23:16 -0600 Message-ID: Subject: Re: [PATCH] fs/cifs/cifsacl: remove set but not used variable 'rc' To: Qiujun Huang Cc: Steve French , CIFS , samba-technical , LKML 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 Isn't it not used because of a potential bug - missing returning an error in two cases. If we leave the two lines you removed in - and set rc=0 in its declaration (and return rc at the end as you originally had suggested) - doesn't that solve the problem? A minor modification to your first proposed patch? On Tue, Mar 3, 2020 at 5:39 PM Qiujun Huang wrote: > > It is set but not used, So can be removed. > > Signed-off-by: Qiujun Huang > --- > fs/cifs/cifsacl.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c > index 716574a..1cf3916 100644 > --- a/fs/cifs/cifsacl.c > +++ b/fs/cifs/cifsacl.c > @@ -342,7 +342,6 @@ > sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid, > struct cifs_fattr *fattr, uint sidtype) > { > - int rc; > struct key *sidkey; > char *sidstr; > const struct cred *saved_cred; > @@ -403,7 +402,6 @@ > saved_cred = override_creds(root_cred); > sidkey = request_key(&cifs_idmap_key_type, sidstr, ""); > if (IS_ERR(sidkey)) { > - rc = -EINVAL; > cifs_dbg(FYI, "%s: Can't map SID %s to a %cid\n", > __func__, sidstr, sidtype == SIDOWNER ? 'u' : 'g'); > goto out_revert_creds; > @@ -416,7 +414,6 @@ > */ > BUILD_BUG_ON(sizeof(uid_t) != sizeof(gid_t)); > if (sidkey->datalen != sizeof(uid_t)) { > - rc = -EIO; > cifs_dbg(FYI, "%s: Downcall contained malformed key (datalen=%hu)\n", > __func__, sidkey->datalen); > key_invalidate(sidkey); > -- > 1.8.3.1 > -- Thanks, Steve