mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Axel Lin <axel.lin@ingics.com>
Cc: Rob Landley <rob@landley.net>, Al Viro <viro@zeniv.linux.org.uk>,
	Kay Sievers <kay.sievers@vrfy.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] devtmpfs: Calling delete_path() only when necessary
Date: Mon, 9 Dec 2013 01:05:30 -0800	[thread overview]
Message-ID: <20131209090530.GA4586@kroah.com> (raw)
In-Reply-To: <CAFRkauCQdOyWbck+WtmNxtnenKyPAFNcqqUgcGSb1kAqj56sYA@mail.gmail.com>

On Mon, Dec 09, 2013 at 04:54:29PM +0800, Axel Lin wrote:
> 2013/12/9 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
> > On Wed, Dec 04, 2013 at 02:44:14PM +0800, Axel Lin wrote:
> >> 2013/12/4 Rob Landley <rob@landley.net>:
> >> > On 11/16/2013 02:15:23 AM, Axel Lin wrote:
> >> >>
> >> >> The deleted variable is always 1 in current code.
> >> >> Initialize deleted variable to be 0, so delete_path() will be called only
> >> >> when
> >> >> necessary.
> >> >>
> >> >> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> >> >
> >> >
> >> > I'm not seeing this in linux-next, or a reply on the web archive. Assuming
> >> > nobody's objected to this, you might want to forward it to
> >> > trivial@kernel.org.
> >> >
> >> > That said, you could describe what it _does_ a little more?
> >>
> >> I was expecting Greg to pick up this patch.
> >>
> >> I thought the description is pretty clear.
> >> What the patch does is changing the init value of deleted variable to 0.
> >> The intention of this change is to avoid unnecessary delete_path() call.
> >
> > I agree the logic is a bit odd here, but are you seeing an "unnecessary"
> > delete_path() call happening?  The code has always been like this from
> > what I can tell...
> 
> Honestly, I havn't see the "unnecessary" delete_path() call happening druing my
> test. I look at the code when I was debugging a hangup issue.
> (In the end, I think the issue is not related to the devtmpfs code.)
> But I found the logic for the deleted variable looks odd.
> There are below possible (unlikely) case:
> When strchr(nodename, '/') != 0 and
> 1. If dentry->d_inode is NULL
> 2. vfs_getattr returns error
> 3. vfs_unlink returns error except -ENOENT.
> 
> In these cases, delete_path() will fail anyway.
> 
> Although this is a unlikely case, and I know the code is there since initial
> commit. But I think it's still good to fix it.

Have you tested your patch to verify nothing breaks?

  reply	other threads:[~2013-12-09  9:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-16  8:15 Axel Lin
2013-12-04  2:59 ` Rob Landley
2013-12-04  6:44   ` Axel Lin
2013-12-04  7:10     ` Greg Kroah-Hartman
2013-12-09  6:46     ` Greg Kroah-Hartman
2013-12-09  8:54       ` Axel Lin
2013-12-09  9:05         ` Greg Kroah-Hartman [this message]
2013-12-09  9:06           ` Axel Lin
2013-12-10  6:08             ` Axel Lin
2013-12-10  7:26               ` Fengguang Wu
2013-12-10  7:53                 ` Greg Kroah-Hartman

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=20131209090530.GA4586@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=axel.lin@ingics.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob@landley.net \
    --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

Powered by JetHome