Re: [PATCH] block: don't acquire .sysfs_lock before removing mq & iosched kobjects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 21, 2019 at 08:41:32AM -0700, Bart Van Assche wrote:
> On 8/20/19 8:00 PM, Ming Lei wrote:
> > On Tue, Aug 20, 2019 at 02:21:10PM -0700, Bart Van Assche wrote:
> > > -	/*
> > > -	 * Remove the sysfs attributes before unregistering the queue data
> > > -	 * structures that can be modified through sysfs.
> > > -	 */
> > >   	if (queue_is_mq(q))
> > > -		blk_mq_unregister_dev(disk_to_dev(disk), q);
> > > -	mutex_unlock(&q->sysfs_lock);
> > > -
> > > +		kobject_uevent(q->mq_kobj, KOBJ_REMOVE);
> > 
> > Could you explain why you move the above line here?
> 
> I'm not sure whether kobject_del() deletes any objects attached to the
> deleted kobj. This change ensures that kobject_uevent() is called before the
> parent object of q->mq_kobj is deleted.

>From comment of kernfs_remove(), all subdirectories and files will be
removed.

kobject_del
	sysfs_remove_dir
		kernfs_remove

	/**
	 * kernfs_remove - remove a kernfs_node recursively
	 * @kn: the kernfs_node to remove
	 *
	 * Remove @kn along with all its subdirectories and files.
	 */
	void kernfs_remove(struct kernfs_node *kn)


Thanks,
Ming



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux