Re: [PATCH v2 1/1] [SCSI] sg: fix race condition when do exclusive open

2013-07-15 Thread Jörn Engel
On Sun, 7 July 2013 01:24:44 +0800, vaughan wrote: > > Do you agree that I use a per device spin_lock 'sfd_lock' to protect > sfds list and leave sg_index_lock > only protect the global sg device lookup? I think it's reasonable > for concurrency. That bit looks fine to me. I don't think it

Re: [PATCH v2 1/1] [SCSI] sg: fix race condition when do exclusive open

2013-07-15 Thread Jörn Engel
On Sun, 7 July 2013 01:24:44 +0800, vaughan wrote: Do you agree that I use a per device spin_lock 'sfd_lock' to protect sfds list and leave sg_index_lock only protect the global sg device lookup? I think it's reasonable for concurrency. That bit looks fine to me. I don't think it matters

Re: [PATCH v2 1/1] [SCSI] sg: fix race condition when do exclusive open

2013-07-06 Thread vaughan
On 07/06/2013 01:39 AM, Jörn Engel wrote: Sorry about replying so late. On Mon, 17 June 2013 21:10:53 +0800, vaughan wrote: Rewrite the last patch. Add a new field 'toopen' in sg_device to count ongoing sg_open's. By checking both 'toopen' and 'exclude' marks when do exclusive open, old race

Re: [PATCH v2 1/1] [SCSI] sg: fix race condition when do exclusive open

2013-07-06 Thread vaughan
On 07/06/2013 01:39 AM, Jörn Engel wrote: Sorry about replying so late. On Mon, 17 June 2013 21:10:53 +0800, vaughan wrote: Rewrite the last patch. Add a new field 'toopen' in sg_device to count ongoing sg_open's. By checking both 'toopen' and 'exclude' marks when do exclusive open, old race

Re: [PATCH v2 1/1] [SCSI] sg: fix race condition when do exclusive open

2013-07-05 Thread Jörn Engel
Sorry about replying so late. On Mon, 17 June 2013 21:10:53 +0800, vaughan wrote: > > Rewrite the last patch. > Add a new field 'toopen' in sg_device to count ongoing sg_open's. By checking > both 'toopen' and 'exclude' marks when do exclusive open, old race conditions > can be avoided. >

Re: [PATCH v2 1/1] [SCSI] sg: fix race condition when do exclusive open

2013-07-05 Thread Jörn Engel
Sorry about replying so late. On Mon, 17 June 2013 21:10:53 +0800, vaughan wrote: Rewrite the last patch. Add a new field 'toopen' in sg_device to count ongoing sg_open's. By checking both 'toopen' and 'exclude' marks when do exclusive open, old race conditions can be avoided. Replace

Re: [PATCH v2 1/1] [SCSI] sg: fix race condition when do exclusive open

2013-07-04 Thread vaughan
On 06/26/2013 09:37 AM, vaughan wrote: Hi Jörn Engel, Ping. How about this one? I found my lat patch hasn't fix the issue, so I modified it a little more. Last thread is: Subject: Re: [PATCH] sg: atomize check and set sdp->exclude in sg_open Message-ID: <20130605154106.ga2...@logfs.org>

Re: [PATCH v2 1/1] [SCSI] sg: fix race condition when do exclusive open

2013-07-04 Thread vaughan
On 06/26/2013 09:37 AM, vaughan wrote: Hi Jörn Engel, Ping. How about this one? I found my lat patch hasn't fix the issue, so I modified it a little more. Last thread is: Subject: Re: [PATCH] sg: atomize check and set sdp-exclude in sg_open Message-ID: 20130605154106.ga2...@logfs.org Regards,

Re: [PATCH v2 1/1] [SCSI] sg: fix race condition when do exclusive open

2013-06-25 Thread vaughan
Hi Jörn Engel, Ping. How about this one? I found my lat patch hasn't fix the issue, so I modified it a little more. Last thread is: Subject: Re: [PATCH] sg: atomize check and set sdp->exclude in sg_open Message-ID: <20130605154106.ga2...@logfs.org> Regards, Vaughan 于 2013年06月17日 21:10, vaughan

Re: [PATCH v2 1/1] [SCSI] sg: fix race condition when do exclusive open

2013-06-25 Thread vaughan
Hi Jörn Engel, Ping. How about this one? I found my lat patch hasn't fix the issue, so I modified it a little more. Last thread is: Subject: Re: [PATCH] sg: atomize check and set sdp-exclude in sg_open Message-ID: 20130605154106.ga2...@logfs.org Regards, Vaughan 于 2013年06月17日 21:10, vaughan 写道:

[PATCH v2 1/1] [SCSI] sg: fix race condition when do exclusive open

2013-06-17 Thread vaughan
Rewrite the last patch. Add a new field 'toopen' in sg_device to count ongoing sg_open's. By checking both 'toopen' and 'exclude' marks when do exclusive open, old race conditions can be avoided. Replace global sg_open_exclusive_lock with a per device lock - sfd_lock. Since sfds list is now

[PATCH v2 1/1] [SCSI] sg: fix race condition when do exclusive open

2013-06-17 Thread vaughan
Rewrite the last patch. Add a new field 'toopen' in sg_device to count ongoing sg_open's. By checking both 'toopen' and 'exclude' marks when do exclusive open, old race conditions can be avoided. Replace global sg_open_exclusive_lock with a per device lock - sfd_lock. Since sfds list is now