Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3831989ybf; Tue, 3 Mar 2020 13:46:29 -0800 (PST) X-Google-Smtp-Source: ADFU+vsgDdSmYMLRu5p0nXioTbCqjlY0iLiG9h8PYgUFvO5uHLjpw5sf38tF7fRvLCMs0W+HEnXF X-Received: by 2002:aca:1a06:: with SMTP id a6mr422684oia.148.1583271988870; Tue, 03 Mar 2020 13:46:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583271988; cv=none; d=google.com; s=arc-20160816; b=VooouKMspJalxuAiCuO9+LxPzcJoHAwDYnJbYje3Zou0XLM8N1N4RMjz1dJTMG1F5u dC5CQgLtTJe/E8YkpBKE5JukRPyaPg20LtuEry6gGz1kVuPhTbAV0R5uMOm0M+0RPmEw /ZHFS32oVhSwGp20910cEvNvooFb6ivZhiBFaofGhjskRqBOgDvOsUpAZ5KzQHG8Zv8z LvzB+3IOLte73QngBT8nomTQ+cjAVSsFXS6m0/K9Yvh5iALbuPQsTu4/mYwn29+ggKFa nqb2WfVlhSz/VeIgt6XLC/RslyLRuk7WruWXHr/P1T4L05a/W3H37VPOdUTUrp79luff wSRg== 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=pCzvYSdF8vmgaLCTyZpeoxltcbWBACzfXPrjZZqp6qg=; b=ZUYpKjtDywCqQFQybr9ykKYSX/K7K56zXd/4FEBIIviK2kDBdQeDJv5l8tp0yMv/uX tKQukMxuDbITl8gadb8bMVgJ0eFsp8UZz2sdZJUJCrYuPCUECOKr8Jpf9g23m1It74Ph pXeR8J3yXRK/0nVzPOrZDM0sAx5X1xE/sJR+hxzDXN9gIbJYKdSjyGC0W7Et7ODXc9CD shyyzSg/aPai8BCPFLFFy6LqqnRBDvCLHZEDn0tCSJE7iwkju5figOpzEw1/9q0XwUK+ fpEtrnSRgMaLVMk6YPCy5TnPyJ9aTMRZWWk8y+VOGoCvebIzoTrKTuq45OnfZBJrb7lK sTwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HSdwRA5B; 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 s64si27404oig.147.2020.03.03.13.46.17; Tue, 03 Mar 2020 13:46:28 -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=HSdwRA5B; 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 S1730773AbgCCUNw (ORCPT + 99 others); Tue, 3 Mar 2020 15:13:52 -0500 Received: from mail-yw1-f65.google.com ([209.85.161.65]:42018 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730352AbgCCUNv (ORCPT ); Tue, 3 Mar 2020 15:13:51 -0500 Received: by mail-yw1-f65.google.com with SMTP id n127so4612264ywd.9; Tue, 03 Mar 2020 12:13:51 -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=pCzvYSdF8vmgaLCTyZpeoxltcbWBACzfXPrjZZqp6qg=; b=HSdwRA5Bre9VwcSxMFaoCPSA0sPrtL1sp1XGm7Ny1rzf9Vq9rU/Dn+qUCnDuf2pCMt wftX96Y7fd7IIoOntNw7zGMgK57yrEarZLclj6RrcBI5A0f9rHFnPUIasBiiWEMYzwWR JzVPPXHJXW5mPHkhi7HCDIvfjhk1qrXsCnqtuEXCiXTVAdieSA7EprD6b3UQY4sTFoDg hD6k51IOCmpoxhG6mDgWl5cE3pHbMAxH2ujpxrNvitgm/jb94F+2/6HdxvTcwA5MhZDC gwdmUDZmV/s9K21zvY1zt3RLsn6fNQfyWyvFXBreOdQ+zy3RGoBzoLWMMX1OgWArQt+h W7Tg== 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=pCzvYSdF8vmgaLCTyZpeoxltcbWBACzfXPrjZZqp6qg=; b=BIXr5vqsSfmh3vtNyoFZ235atj0qBySD/IJYLt3g+Q1gh+7HT36AHlZNFYA9JKOat9 1WL7Jzq2AUNZpBIma0prakUfaCScSfdXC2VTXbkXYNPW3ODuXNGDW3zLE7kDL/dOaS2F VMUzS6i8R6ZmaCSV6tsoElwkL2s8j4ZL9R8qYPt/oRjANDcyOIVwaw3Fq/IZI0Va2nIZ 2uOxdG7FER1HBaYefikoRkhi6OdwA/rs2HMqDUU99AK48YkxdZkB1vX01/OXsGbWT05D Pc2eaJ9J+/D+Gatj7mTZJaqufQwkuU1dfXF9bYLXTkAPPyp+rJc7Ja7urrMwwT0XgqMi s58w== X-Gm-Message-State: ANhLgQ3arakZgpQPTOFbw6MjZdWnj0qmMhT4QQMSLD2wS08lQCBymKOB LjsTb9pUO0P5cAJnrOX5QR1rPly176gT9fBm8xBXGW4v X-Received: by 2002:a81:6c55:: with SMTP id h82mr6562001ywc.381.1583266430034; Tue, 03 Mar 2020 12:13:50 -0800 (PST) MIME-Version: 1.0 References: <1583250197-10786-1-git-send-email-hqjagain@gmail.com> In-Reply-To: <1583250197-10786-1-git-send-email-hqjagain@gmail.com> From: Steve French Date: Tue, 3 Mar 2020 14:13:39 -0600 Message-ID: Subject: Re: [PATCH] fs/cifs/cifsacl: fix sid_to_id To: Qiujun Huang Cc: Steve French , CIFS , 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 Doesn't rc = 0 have to be set earlier (preferably in the declaration on line 345)? since line 392 does goto got_valid_id; which appears to leave rc unitialized with your change On Tue, Mar 3, 2020 at 9:56 AM Qiujun Huang wrote: > > fix it to return the errcode. > > Signed-off-by: Qiujun Huang > --- > fs/cifs/cifsacl.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c > index 716574a..a8d2aa8 100644 > --- a/fs/cifs/cifsacl.c > +++ b/fs/cifs/cifsacl.c > @@ -400,6 +400,7 @@ > if (!sidstr) > return -ENOMEM; > > + rc = 0; > saved_cred = override_creds(root_cred); > sidkey = request_key(&cifs_idmap_key_type, sidstr, ""); > if (IS_ERR(sidkey)) { > @@ -454,7 +455,7 @@ > fattr->cf_uid = fuid; > else > fattr->cf_gid = fgid; > - return 0; > + return rc; > } > > int > -- > 1.8.3.1 > -- Thanks, Steve