Re: [for-4.16 PATCH 1/2] block: cope with gendisk's 'queue' being added later

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

 



On Tue, 2018-01-09 at 17:10 -0500, Mike Snitzer wrote:
> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
> index 870484eaed1f..0b0dda8e2420 100644
> --- a/block/blk-sysfs.c
> +++ b/block/blk-sysfs.c
> @@ -919,8 +919,20 @@ int blk_register_queue(struct gendisk *disk)
>  	ret = 0;
>  unlock:
>  	mutex_unlock(&q->sysfs_lock);
> +
> +	/*
> +	 * Take an extra ref on queue which will be put on disk_release()
> +	 * so that it sticks around as long as @disk is there.
> +	 */
> +	WARN_ON_ONCE(!blk_get_queue(q));
> +
> +	WARN_ON(sysfs_create_link(&dev->kobj,
> +				  &q->backing_dev_info->dev->kobj,
> +				  "bdi"));
> +
>  	return ret;
>  }
> +EXPORT_SYMBOL_GPL(blk_register_queue);

Hello Mike,

So the sysfs_create_link() call is moved from register_disk() into
blk_register_queue() but the sysfs_remove_link() call stays in del_gendisk()?
Are you sure that you want this asymmetry?

Thanks,

Bart.




[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