public inbox for linux-cifs@vger.kernel.org
 help / color / mirror / Atom feed
From: Muhammad Usama Anjum <musamaanjum@gmail.com>
To: "Aurélien Aptel" <aaptel@suse.com>,
	"Steve French" <sfrench@samba.org>,
	"Ronnie Sahlberg" <lsahlber@redhat.com>,
	"open list:COMMON INTERNET FILE SYSTEM CLIENT (CIFS)"
	<linux-cifs@vger.kernel.org>,
	"moderated list:COMMON INTERNET FILE SYSTEM CLIENT (CIFS)"
	<samba-technical@lists.samba.org>,
	"open list" <linux-kernel@vger.kernel.org>
Cc: musamaanjum@gmail.com, kernel-janitors@vger.kernel.org,
	dan.carpenter@oracle.com, colin.king@canonical.com
Subject: Re: [PATCH] cifs: remove unnecessary copies of tcon->crfid.fid
Date: Thu, 15 Apr 2021 19:52:09 +0500	[thread overview]
Message-ID: <654ae83eb92077ab01b962890fdf57453d889d7c.camel@gmail.com> (raw)
In-Reply-To: <87tuo913g6.fsf@suse.com>

On Wed, 2021-04-14 at 14:00 +0200, Aurélien Aptel wrote:
> Muhammad Usama Anjum <musamaanjum@gmail.com> writes:
> > pfid is being set to tcon->crfid.fid and they are copied in each other
> > multiple times. Remove the memcopy between same pointers.
> > 
> > Addresses-Coverity: ("Overlapped copy")
> > Fixes: 9e81e8ff74b9 ("cifs: return cached_fid from open_shroot")
> > Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
> > ---
> > I'm not sure why refcount was being incremented here. This file has been
> > evoloved so much. Any ideas?
> 
> The fact that pfid is the same as the cache is very weird... Probably
> due to recent change.
> 
> This function returns a cached dir entry for the root of the share which
> can be accessed/shared by multiple task.
> 
Aurélien Aptel,

Thank you so much for awesome explanation. The whole function makes
sense now. We need to remove the memcpy calls only. We need to
increment the refcount (it was removed in this patch). I'll send a V2.

Regards,
Usama


      reply	other threads:[~2021-04-15 14:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 23:25 [PATCH] cifs: remove unnecessary copies of tcon->crfid.fid Muhammad Usama Anjum
2021-04-14 12:00 ` Aurélien Aptel
2021-04-15 14:52   ` Muhammad Usama Anjum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=654ae83eb92077ab01b962890fdf57453d889d7c.camel@gmail.com \
    --to=musamaanjum@gmail.com \
    --cc=aaptel@suse.com \
    --cc=colin.king@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lsahlber@redhat.com \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox