mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Yijing Wang <wangyijing@huawei.com>
Cc: Tejun Heo <tj@kernel.org>,
	lizefan@huawei.com, linux-kernel@vger.kernel.org,
	Weng Meiling <wengmeiling.weng@huawei.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] sysfs: driver core: Fix glue dir race condition
Date: Thu, 6 Nov 2014 21:51:39 -0800	[thread overview]
Message-ID: <20141107055139.GA29210@kroah.com> (raw)
In-Reply-To: <545C3893.3020003@huawei.com>

On Fri, Nov 07, 2014 at 11:12:19AM +0800, Yijing Wang wrote:
> >> +static DEFINE_MUTEX(gdp_mutex);
> >>
> >>  static struct kobject *get_device_parent(struct device *dev,
> >>  					 struct device *parent)
> >>  {
> >>  	if (dev->class) {
> >> -		static DEFINE_MUTEX(gdp_mutex);
> >>  		struct kobject *kobj = NULL;
> >>  		struct kobject *parent_kobj;
> >>  		struct kobject *k;
> >> @@ -793,7 +793,9 @@ static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
> >>  	    glue_dir->kset != &dev->class->p->glue_dirs)
> >>  		return;
> >>
> >> +	mutex_lock(&gdp_mutex);
> >>  	kobject_put(glue_dir);
> >> +	mutex_unlock(&gdp_mutex);
> >>  }
> >>
> >>  static void cleanup_device_parent(struct device *dev)
> >>
> > 
> > I much prefer this patch over the other one, as it keeps the same
> > behavior as today, and fixes the existing bug.
> > 
> > Have you tested it out to see if it works properly?  If so, can you
> > resend it in a "proper" form so I can apply it?
> 
> Yes, we tested it in our system, I will resend it now, thanks!

Wonderful, thanks for that, and persisting with this.  I'll queue up
that patch tomorrow morning.

greg k-h

  reply	other threads:[~2014-11-07  5:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06  8:16 Yijing Wang
2014-11-06 16:55 ` Tejun Heo
2014-11-06 17:22   ` Greg KH
2014-11-07  1:44     ` Yijing Wang
2014-11-07  2:46       ` Greg KH
2014-11-07  3:12         ` Yijing Wang
2014-11-07  5:51           ` Greg KH [this message]
2014-11-07  1:22   ` Yijing Wang

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=20141107055139.GA29210@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=wangyijing@huawei.com \
    --cc=wengmeiling.weng@huawei.com \
    /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

all inboxes | Powered by JetHome®