mirror of
https://github.com/torvalds/linux.git
synced 2024-11-16 00:52:01 +00:00
[SCSI] aacraid: fib context lock for management ioctls (take 2)
The first patch (a119ee8ee3
) was a bit too aggressive and nested the locks (!) unit testing was in error. This patch was reverted by203a512f09
. This new patch should fix the locks correctly. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
This commit is contained in:
parent
df922075f2
commit
5234e25c35
@ -243,6 +243,7 @@ static int next_getadapter_fib(struct aac_dev * dev, void __user *arg)
|
||||
* Search the list of AdapterFibContext addresses on the adapter
|
||||
* to be sure this is a valid address
|
||||
*/
|
||||
spin_lock_irqsave(&dev->fib_lock, flags);
|
||||
entry = dev->fib_list.next;
|
||||
fibctx = NULL;
|
||||
|
||||
@ -258,17 +259,18 @@ static int next_getadapter_fib(struct aac_dev * dev, void __user *arg)
|
||||
fibctx = NULL;
|
||||
}
|
||||
if (!fibctx) {
|
||||
spin_unlock_irqrestore(&dev->fib_lock, flags);
|
||||
dprintk ((KERN_INFO "Fib Context not found\n"));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if((fibctx->type != FSAFS_NTC_GET_ADAPTER_FIB_CONTEXT) ||
|
||||
(fibctx->size != sizeof(struct aac_fib_context))) {
|
||||
spin_unlock_irqrestore(&dev->fib_lock, flags);
|
||||
dprintk ((KERN_INFO "Fib Context corrupt?\n"));
|
||||
return -EINVAL;
|
||||
}
|
||||
status = 0;
|
||||
spin_lock_irqsave(&dev->fib_lock, flags);
|
||||
/*
|
||||
* If there are no fibs to send back, then either wait or return
|
||||
* -EAGAIN
|
||||
|
Loading…
Reference in New Issue
Block a user