How is supposed to be protected the units list?

Alexander Motin mav at FreeBSD.org
Sun Mar 21 07:14:20 UTC 2010


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.

> I would have preferred to have a dedicated lock for the units lists,
> but as long as you seem having strong opionion, I'm fine with it.

I haven't told it is strong. I have asked some time to check it. Now
comparing the patches I don't see benefits from having second lock. I
would say you just changing possible lock recursions to possible LORs.
It's not much better.

-- 
Alexander Motin


More information about the freebsd-scsi mailing list