All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yijing Wang <wangyijing@huawei.com>
To: Greg KH <gregkh@linuxfoundation.org>
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: Fri, 7 Nov 2014 11:12:19 +0800	[thread overview]
Message-ID: <545C3893.3020003@huawei.com> (raw)
In-Reply-To: <20141107024654.GC22844@kroah.com>

>> +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!

> 
> thanks,
> 
> greg k-h
> 
> .
> 


-- 
Thanks!
Yijing


  reply	other threads:[~2014-11-07  3:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06  8:16 [PATCH] sysfs: driver core: Fix glue dir race condition 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 [this message]
2014-11-07  5:51           ` Greg KH
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=545C3893.3020003@huawei.com \
    --to=wangyijing@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    --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 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.