How is supposed to be protected the units list?

Attilio Rao attilio at freebsd.org
Tue Mar 30 14:25:31 UTC 2010


2010/3/21 Alexander Motin <mav at freebsd.org>:
> Attilio Rao wrote:
>> So I made this new patch using the bus lock:
>> http://www.freebsd.org/~attilio/Sandvine/pdrv/xpt_lock.diff
>
> OK. I've looked on both and I think both have race window between unit
> number allocation and insertion into the list. I've changed last patch
> to not drop the lock in meantime. What do you think about this:
> http://people.freebsd.org/~mav/unit_lock.patch
> ?
>
> Part about scsi_da.c I don't like in both cases, as I am not sure that
> locks can't be recursed there in case of some errors. I don't see how
> adding second lock could solve it.

The lock recursion is going to happen because of the necessary
refcount acquisition as Matt pointed out?
Or there is another recursion?
In the former case, the global lock will help because you may just
acquire it, refcount the periph, cache them and run lockless.
You can't do this with xpt_lock_bus because of the recursion in
cam_periph_acquire.

So we want to live this unprotected and just live with this bug?

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein


More information about the freebsd-scsi mailing list