mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tejun Heo <tj@kernel.org>
Cc: Yijing Wang <wangyijing@huawei.com>,
	Weng Meiling <wengmeiling.weng@huawei.com>,
	Frans Klaver <fransklaver@gmail.com>,
	Jens Axboe <axboe@kernel.dk>,
	akpm@linux-foundation.org, adilger.kernel@dilger.ca,
	Jan Kara <jack@suse.cz>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Xiang Rui <rui.xiang@huawei.com>, Li Zefan <lizefan@huawei.com>,
	Huang Qiang <h.huangqiang@huawei.com>,
	Zhao Hongjiang <zhaohongjiang@huawei.com>
Subject: Re: Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent
Date: Tue, 4 Nov 2014 19:52:24 -0800	[thread overview]
Message-ID: <20141105035224.GB9419@kroah.com> (raw)
In-Reply-To: <20141105032943.GB29392@htj.dyndns.org>

On Tue, Nov 04, 2014 at 10:29:43PM -0500, Tejun Heo wrote:
> Hello,
> 
> On Wed, Nov 05, 2014 at 11:27:39AM +0800, Yijing Wang wrote:
> > Keep the parent directory looks good to me,  we could only add kobject_get(&parent)
> > after the parent dir be created.
> > 
> > ....
> > 		/* or create a new class-directory at the parent device */
> > 		k = class_dir_create_and_add(dev->class, parent_kobj);
> > 		/* do not emit an uevent for this simple "glue" directory */
> > 		kobject_get(k);  <--------add parent ref count for first child device.
> 
> The created directory would already have the base ref.  I don't think
> you need the above.  Just never put the parent once created.
> 
> Greg, how does this sound to you?

It makes sense, but I don't understand, what "parent" directory is going
away and causing problems?

thanks,

greg k-h

  reply	other threads:[~2014-11-05  3:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15  6:42 Weng Meiling
2014-10-16  1:56 ` Weng Meiling
2014-10-16  7:07   ` Frans Klaver
2014-10-16  7:23     ` Weng Meiling
2014-10-16  9:13       ` Greg KH
2014-10-22  8:07         ` Weng Meiling
2014-11-04 19:15           ` Tejun Heo
2014-11-05  2:01             ` Yijing Wang
2014-11-05  3:13               ` Tejun Heo
2014-11-05  3:27                 ` Yijing Wang
2014-11-05  3:29                   ` Tejun Heo
2014-11-05  3:52                     ` Greg KH [this message]
2014-11-05  5:14                       ` 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=20141105035224.GB9419@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=fransklaver@gmail.com \
    --cc=h.huangqiang@huawei.com \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=rui.xiang@huawei.com \
    --cc=tj@kernel.org \
    --cc=wangyijing@huawei.com \
    --cc=wengmeiling.weng@huawei.com \
    --cc=zhaohongjiang@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

Powered by JetHome