* [PATCH] fs/cifs/cifsacl: remove set but not used variable 'rc'
@ 2020-03-03 23:39 Qiujun Huang
2020-03-04 6:23 ` Steve French
0 siblings, 1 reply; 3+ messages in thread
From: Qiujun Huang @ 2020-03-03 23:39 UTC (permalink / raw)
To: sfrench; +Cc: linux-cifs, samba-technical, linux-kernel, smfrench, Qiujun Huang
It is set but not used, So can be removed.
Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fs/cifs/cifsacl: remove set but not used variable 'rc'
2020-03-03 23:39 [PATCH] fs/cifs/cifsacl: remove set but not used variable 'rc' Qiujun Huang
@ 2020-03-04 6:23 ` Steve French
2020-03-04 6:53 ` Qiujun Huang
0 siblings, 1 reply; 3+ messages in thread
From: Steve French @ 2020-03-04 6:23 UTC (permalink / raw)
To: Qiujun Huang; +Cc: Steve French, CIFS, samba-technical, LKML
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 <hqjagain@gmail.com> wrote:
>
> It is set but not used, So can be removed.
>
> Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
> ---
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fs/cifs/cifsacl: remove set but not used variable 'rc'
2020-03-04 6:23 ` Steve French
@ 2020-03-04 6:53 ` Qiujun Huang
0 siblings, 0 replies; 3+ messages in thread
From: Qiujun Huang @ 2020-03-04 6:53 UTC (permalink / raw)
To: Steve French; +Cc: Steve French, CIFS, samba-technical, LKML
On Wed, Mar 4, 2020 at 2:23 PM Steve French <smfrench@gmail.com> wrote:
>
> Isn't it not used because of a potential bug - missing returning an
> error in two cases.
I get it, thanks.
>
> 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?
ok, I'll send v2.
>
> On Tue, Mar 3, 2020 at 5:39 PM Qiujun Huang <hqjagain@gmail.com> wrote:
> >
> > It is set but not used, So can be removed.
> >
> > Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
> > ---
> > 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-04 6:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-03 23:39 [PATCH] fs/cifs/cifsacl: remove set but not used variable 'rc' Qiujun Huang
2020-03-04 6:23 ` Steve French
2020-03-04 6:53 ` Qiujun Huang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.