Re: [PATCH] update sd to use kref and fix open/release race

Mike Anderson
2004-04-13T18:12:37Z

James Bottomley [James.Bottomley@steeleye.com] wrote:
> @@ -1338,17 +1338,19 @@
> if ((sdp->type != TYPE_DISK) && (sdp->type != TYPE_MOD))
> goto out;
>
> + if ((error = scsi_device_get(sdp)) != 0)
> + goto out;
> +
> SCSI_LOG_HLQUEUE(3, printk("sd_attach: scsi device: <%d,%d,%d,%d>\n",
> sdp->host->host_no, sdp->channel, sdp->id, sdp->lun));
>
> error = -ENOMEM;
> sdkp = kmalloc(sizeof(*sdkp), GFP_KERNEL);

Did we decide through the thread on this issue that we will not allow a
rmmod to happen anymore unless you manually delete the children devices
off the host? In using scsi_debug I am not able to rmmod until I delete
all the children (i.e. sd's).

The parent child hierarchy should be held in place through kobject_add /
kobject_get of the parent so I would believe that the extra
scsi_device_get should not be needed.

-andmike
--
Michael Anderson
andmike@us.ibm.com