Re: Time to make dynamically allocated devt the default for scsi disks?
From: Dan Williams <hidden>
Date: 2016-08-13 20:38:26
Also in:
linux-scsi
Attachments
- patch-v3 [application/octet-stream] 8923 bytes
From: Dan Williams <hidden>
Date: 2016-08-13 20:38:26
Also in:
linux-scsi
On Sat, Aug 13, 2016 at 11:27 AM, Dan Williams [off-list ref] wrote:
On Sat, Aug 13, 2016 at 10:43 AM, James Bottomley
[..]
quoted
Um, so this patch doesn't fix the problem. It merely makes the lifetime rules correct so the problem can then be fixed at the scsi level.You're right that this patch does not fix the problem, I missed that the scsi_disk is not the parent of the gendisk, so this patch does nothing to delay scsi_disk_release. What I think is the real fix is to make the devt properly reference counted and prevent ida_remove(&sd_index_ida, sdkp->index); from being called until all objects derived from that allocation are done with it.
So, here's an RFC along these lines (only compile tested). This approach provides a generic way to coordinate the lifetime of the bdi name versus the devt allocated by the block device driver.