libiscsi.c (f777316e52e14059a6a1df45cbf39a93ac49a593) libiscsi.c (65080c51fde468465e3547d72e4a593b1361c0f4)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * iSCSI lib functions
4 *
5 * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
6 * Copyright (C) 2004 - 2006 Mike Christie
7 * Copyright (C) 2004 - 2005 Dmitry Yusupov
8 * Copyright (C) 2004 - 2005 Alex Aizman

--- 1553 unchanged lines hidden (view full) ---

1562 spin_unlock_bh(&conn->session->back_lock);
1563 continue;
1564 }
1565 rc = iscsi_xmit_task(conn, task, false);
1566 if (rc)
1567 goto done;
1568 }
1569
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * iSCSI lib functions
4 *
5 * Copyright (C) 2006 Red Hat, Inc. All rights reserved.
6 * Copyright (C) 2004 - 2006 Mike Christie
7 * Copyright (C) 2004 - 2005 Dmitry Yusupov
8 * Copyright (C) 2004 - 2005 Alex Aizman

--- 1553 unchanged lines hidden (view full) ---

1562 spin_unlock_bh(&conn->session->back_lock);
1563 continue;
1564 }
1565 rc = iscsi_xmit_task(conn, task, false);
1566 if (rc)
1567 goto done;
1568 }
1569
1570check_requeue:
1571 while (!list_empty(&conn->requeue)) {
1572 /*
1573 * we always do fastlogout - conn stop code will clean up.
1574 */
1575 if (conn->session->state == ISCSI_STATE_LOGGING_OUT)
1576 break;
1577
1578 task = list_entry(conn->requeue.next, struct iscsi_task,
1579 running);
1580
1581 if (iscsi_check_tmf_restrictions(task, ISCSI_OP_SCSI_DATA_OUT))
1582 break;
1583
1584 list_del_init(&task->running);
1585 rc = iscsi_xmit_task(conn, task, true);
1586 if (rc)
1587 goto done;
1588 if (!list_empty(&conn->mgmtqueue))
1589 goto check_mgmt;
1590 }
1591
1570 /* process pending command queue */
1571 while (!list_empty(&conn->cmdqueue)) {
1572 task = list_entry(conn->cmdqueue.next, struct iscsi_task,
1573 running);
1574 list_del_init(&task->running);
1575 if (conn->session->state == ISCSI_STATE_LOGGING_OUT) {
1576 fail_scsi_task(task, DID_IMM_RETRY);
1577 continue;

--- 11 unchanged lines hidden (view full) ---

1589 goto done;
1590 /*
1591 * we could continuously get new task requests so
1592 * we need to check the mgmt queue for nops that need to
1593 * be sent to aviod starvation
1594 */
1595 if (!list_empty(&conn->mgmtqueue))
1596 goto check_mgmt;
1592 /* process pending command queue */
1593 while (!list_empty(&conn->cmdqueue)) {
1594 task = list_entry(conn->cmdqueue.next, struct iscsi_task,
1595 running);
1596 list_del_init(&task->running);
1597 if (conn->session->state == ISCSI_STATE_LOGGING_OUT) {
1598 fail_scsi_task(task, DID_IMM_RETRY);
1599 continue;

--- 11 unchanged lines hidden (view full) ---

1611 goto done;
1612 /*
1613 * we could continuously get new task requests so
1614 * we need to check the mgmt queue for nops that need to
1615 * be sent to aviod starvation
1616 */
1617 if (!list_empty(&conn->mgmtqueue))
1618 goto check_mgmt;
1619 if (!list_empty(&conn->requeue))
1620 goto check_requeue;
1597 }
1598
1621 }
1622
1599 while (!list_empty(&conn->requeue)) {
1600 /*
1601 * we always do fastlogout - conn stop code will clean up.
1602 */
1603 if (conn->session->state == ISCSI_STATE_LOGGING_OUT)
1604 break;
1605
1606 task = list_entry(conn->requeue.next, struct iscsi_task,
1607 running);
1608
1609 if (iscsi_check_tmf_restrictions(task, ISCSI_OP_SCSI_DATA_OUT))
1610 break;
1611
1612 list_del_init(&task->running);
1613 rc = iscsi_xmit_task(conn, task, true);
1614 if (rc)
1615 goto done;
1616 if (!list_empty(&conn->mgmtqueue))
1617 goto check_mgmt;
1618 }
1619 spin_unlock_bh(&conn->session->frwd_lock);
1620 return -ENODATA;
1621
1622done:
1623 spin_unlock_bh(&conn->session->frwd_lock);
1624 return rc;
1625}
1626

--- 2173 unchanged lines hidden ---
1623 spin_unlock_bh(&conn->session->frwd_lock);
1624 return -ENODATA;
1625
1626done:
1627 spin_unlock_bh(&conn->session->frwd_lock);
1628 return rc;
1629}
1630

--- 2173 unchanged lines hidden ---