Skip to content

Commit 7001f0c

Browse files
Martin PetermannJames Bottomley
authored andcommitted
[SCSI] zfcp: revert previous patch for sbal counting
The current sbal counting can be wrong if a fsf request is waiting for free sbals and at the same time qdio request queue is shutdown and re-opened. Revering a previous patch fixes this issue. Signed-off-by: Martin Petermann <[email protected]> Signed-off-by: Christof Schmitt <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent c6936e7 commit 7001f0c

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

drivers/s390/scsi/zfcp_fsf.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -645,30 +645,30 @@ static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req)
645645
}
646646
}
647647

648-
static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter)
649-
__releases(&adapter->req_q_lock)
650-
__acquires(&adapter->req_q_lock)
648+
static int zfcp_fsf_sbal_check(struct zfcp_adapter *adapter)
651649
{
652650
struct zfcp_qdio_queue *req_q = &adapter->req_q;
653-
long ret;
654651

655-
if (atomic_read(&req_q->count) <= -REQUEST_LIST_SIZE)
656-
return -EIO;
657-
if (atomic_read(&req_q->count) > 0)
658-
return 0;
652+
spin_lock_bh(&adapter->req_q_lock);
653+
if (atomic_read(&req_q->count))
654+
return 1;
655+
spin_unlock_bh(&adapter->req_q_lock);
656+
return 0;
657+
}
658+
659+
static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter)
660+
{
661+
long ret;
659662

660-
atomic_dec(&req_q->count);
661663
spin_unlock_bh(&adapter->req_q_lock);
662664
ret = wait_event_interruptible_timeout(adapter->request_wq,
663-
atomic_read(&req_q->count) >= 0,
664-
5 * HZ);
665-
spin_lock_bh(&adapter->req_q_lock);
666-
atomic_inc(&req_q->count);
667-
665+
zfcp_fsf_sbal_check(adapter), 5 * HZ);
668666
if (ret > 0)
669667
return 0;
670668
if (!ret)
671669
atomic_inc(&adapter->qdio_outb_full);
670+
671+
spin_lock_bh(&adapter->req_q_lock);
672672
return -EIO;
673673
}
674674

0 commit comments

Comments
 (0)