linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: linmiaohe <linmiaohe@huawei.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/5] net: Set fput_needed iff FDPUT_FPUT is set
Date: Fri, 7 Aug 2020 09:48:10 +0000	[thread overview]
Message-ID: <f9487fa9e24148dc98f22ebe9c3e9478@huawei.com> (raw)

Al Viro <viro@zeniv.linux.org.uk> wrote:
>On Thu, Aug 06, 2020 at 12:59:16PM +0100, Al Viro wrote:
>> On Thu, Aug 06, 2020 at 07:53:16PM +0800, linmiaohe wrote:
>> > From: Miaohe Lin <linmiaohe@huawei.com>
>> > 
>> > We should fput() file iff FDPUT_FPUT is set. So we should set 
>> > fput_needed accordingly.
>> > 
>> > Fixes: 00e188ef6a7e ("sockfd_lookup_light(): switch to fdget^W^Waway 
>> > from fget_light")
>> 
>> Explain, please.  We are getting it from fdget(); what else can we get in flags there?
>
>FWIW, struct fd ->flags may have two bits set: FDPUT_FPUT and FDPUT_POS_UNLOCK.
>The latter is set only by __fdget_pos() and its callers, and that only for regular files and directories.
>
>Nevermind that sockfd_lookup_light() does *not* use ..._pos() family of primitives, even if it started to use e.g. fdget_pos() it *still* would not end up with anything other than FDPUT_FPUT to deal with on that path - it checks that what it got is a socket.  Anything else is dropped right there, without leaving fput() to caller.
>
>So could you explain what exactly the bug is - if you are seeing some breakage and this patch fixes it, something odd is definitely going on and it would be nice to figure out what that something is.

I'am sorry, but I did not find something odd. I do this because this would make code more clear and consistent. It's pure a clean up patch.
Maybe Fixes tag makes this looks like a bugfix.

Thanks for your reply and detailed explaination. :)

And sorry for my rookie mistake, I wasn't meant to make these as a patch set...


             reply	other threads:[~2020-08-07  9:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07  9:48 linmiaohe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-08-06 11:53 [PATCH 3/5] net: Set fput_needed iff FDPUT_FPUT is set linmiaohe
2020-08-06 11:59 ` Al Viro
2020-08-06 12:08   ` Al Viro
2020-08-08 21:22 ` David Miller

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=f9487fa9e24148dc98f22ebe9c3e9478@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).