Re: [PATCH] Add release function to sd for scsi_disk structure

Christoph Hellwig
2003-10-21T08:26:55Z

On Sat, Oct 18, 2003 at 12:40:41AM -0700, Mike Anderson wrote:
> This patch is against 2.6.0-test8.
>
> This patch removes the delay in calling device_del on the sdev struct
> device during a surprise removal event. Reference counting functions for
> sd's scsi_disk structure where also added to fix issues of unregistering
> when a sd is open.
>
> I have tested this patch using scsi_debug with differnt combinations of
> adds / removes. I mounted both partitioned and un-partitioned sd disks,
> remove the host, and then did a umount. The ref count debug output shows
> the objects staying in place prior to the umount and cleaning up once
> the umount is called.

This looks like a reasonable bandaid until the block layer is fixed.