Date: Sun, 21 Mar 2010 09:14:14 +0200 From: Alexander Motin <mav@FreeBSD.org> To: Attilio Rao <attilio@freebsd.org> Cc: freebsd-scsi@freebsd.org, "Justin T. Gibbs" <gibbs@freebsd.org>, mj@feral.com, Ed Maste <emaste@sandvine.com> Subject: Re: How is supposed to be protected the units list? Message-ID: <4BA5C746.7060203@FreeBSD.org> In-Reply-To: <3bbf2fe11003200523t60895bfv1fa73d04e58a7838@mail.gmail.com> References: <3bbf2fe11002281655i61a5f0a0if3f381ad0c4a1ef8@mail.gmail.com> <3bbf2fe11003031532u2207eb55h19c3a045215a7d84@mail.gmail.com> <4B8EF336.80107@feral.com> <3bbf2fe11003031547kd5f7314t3d83b2bde06c1c2f@mail.gmail.com> <4B8EF990.5030407@feral.com> <3bbf2fe11003031607wa3727b5ke89bc2a909d4d6a6@mail.gmail.com> <4B901419.8060800@feral.com> <3bbf2fe11003041737p30690522ya81e1b8f4bd6bbf9@mail.gmail.com> <3bbf2fe11003120601y3c403a1ct50f9fc6c1f0903bf@mail.gmail.com> <4B9A91DA.7030107@FreeBSD.org> <3bbf2fe11003200523t60895bfv1fa73d04e58a7838@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BA5C746.7060203>