aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShlomo Pongratz <shlomop@mellanox.com>2013-04-05 23:38:36 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-05-02 11:17:54 -0400
commitad3f428e0fbab1f306cbc22340e9f7672a49147f (patch)
treeacdf67e8fb630712b238d6ab32da92eeed741637
parent533c165fa81d2c5f36adf41a07efeef0e4822300 (diff)
[SCSI] be2iscsi: Fix possible reentrancy issue in be_iopoll
The driver creates "NAPI" context per core which is fine, however the above routine declares the ret variable as static! Thus there is only one instance of this variable! When this routine is called from more than one thread of execution, than the result is unpredictable. static unsigned int ret; ..... ret = beiscsi_process_cq(pbe_eq); <--------Another thread can enter here and change "ret". if (ret < budget) { .... } <--------Another thread can enter here and change "ret". return ret; Fix - remove the "static" Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/be2iscsi/be_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 228d33181912..fe30e3fe7eed 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -2191,7 +2191,7 @@ void beiscsi_process_all_cqs(struct work_struct *work)
2191 2191
2192static int be_iopoll(struct blk_iopoll *iop, int budget) 2192static int be_iopoll(struct blk_iopoll *iop, int budget)
2193{ 2193{
2194 static unsigned int ret; 2194 unsigned int ret;
2195 struct beiscsi_hba *phba; 2195 struct beiscsi_hba *phba;
2196 struct be_eq_obj *pbe_eq; 2196 struct be_eq_obj *pbe_eq;
2197 2197