lkml.org 
[lkml]   [2017]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] scsi, block: fix duplicate bdi name registration crashes
Hi Dan,

this looks mostly fine to me. A few code comments below, but except
for this there is another issue with it: We still have drivers
that share a single request_queue for multiple gendisks, so I wonder

Also I think you probably want one patch for the block framework,
and one to switch SCSI over to it.

> +struct disk_devt {
> + struct kref kref;
> + void (*release)(struct kref *);
> +};
> +
> +static inline void put_disk_devt(struct disk_devt *disk_devt)
> +{
> + if (disk_devt)
> + kref_put(&disk_devt->kref, disk_devt->release);
> +}
> +
> +static inline void get_disk_devt(struct disk_devt *disk_devt)
> +{
> + if (disk_devt)
> + kref_get(&disk_devt->kref);
> +}

Given that we have a user-supplied release callack I'd much rather get
rid of the kref here, use a normal atomic_t and pass the disk_devt
structure to the release callback then a kref.

\
 
 \ /
  Last update: 2017-01-30 13:28    [W:0.096 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site