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

Patrick Mansfield
2004-04-09T16:57:04Z

On Fri, Apr 09, 2004 at 08:52:59AM -0500, James Bottomley wrote:
> All this does is replace our kobject usage with a kref.

Nice work, I did not think this could be fixed without changing gendisk
code. It took me a bit to walk through the code paths, I still don't
fully grok the kobj_unmap/map/lookup.

I was about to post on the other thread that you missed the semaphore
around the put in sd_remove but I see it is fixed here.

Per other thread, comments about using the private_data to mark the device
as removed, and about the get/put race would be good.

Code comments can't clarify the overall ref counting that occurs, maybe
Mike A can update his ref counting slides.

-- Patrick Mansfield