Re: [PATCH v4 1/4] [SCSI] sg: use rwsem to solve race during exclusive open

2013-07-19 Thread Jörn Engel
han@oracle.com > Subject: [PATCH v4 1/4] [SCSI] sg: use rwsem to solve race during > exclusive open > X-Mailer: git-send-email 1.7.11.7 > > A race condition may happen if two threads are both trying to open the same sg > with O_EXCL simultaneously. It's possible that they both

[PATCH v4 1/4] [SCSI] sg: use rwsem to solve race during exclusive open

2013-07-17 Thread Vaughan Cao
A race condition may happen if two threads are both trying to open the same sg with O_EXCL simultaneously. It's possible that they both find fsds list is empty and get_exclude(sdp) returns 0, then they both call set_exclude() and break out from wait_event_interruptible and resume open. Now use rws