[PATCH] scsi: aacraid: add missing manage_lock on management_fib_count

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All other places modify the management_fib_count under the manage_lock.
Avoid a possible race condition by also applying that lock in
aac_src_intr_message.

Signed-off-by: Niels Dossche <niels.dossche@xxxxxxxx>
---
 drivers/scsi/aacraid/src.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c
index 11ef58204e96..ca73439587ed 100644
--- a/drivers/scsi/aacraid/src.c
+++ b/drivers/scsi/aacraid/src.c
@@ -91,7 +91,9 @@ static irqreturn_t aac_src_intr_message(int irq, void *dev_id)
                                        dev->sync_fib);
                        spin_lock_irqsave(&dev->sync_fib->event_lock, sflags);
                        if (dev->sync_fib->flags & FIB_CONTEXT_FLAG_WAIT) {
+                               spin_lock(&dev->manage_lock);
                                dev->management_fib_count--;
+                               spin_unlock(&dev->manage_lock);
                                complete(&dev->sync_fib->event_wait);
                        }
                        spin_unlock_irqrestore(&dev->sync_fib->event_lock,
-- 
2.35.1



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux