Skip to content

Commit cebcff3

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Four minor fixes: three in drivers and one in the core. The core one allows an additional state change that fixes a regression introduced by an update to the aacraid driver in the previous merge window" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: target/iblock: fix WRITE SAME zeroing scsi: qla2xxx: check UNLOADING before posting async work scsi: qla2xxx: set UNLOADING before waiting for session deletion scsi: core: Allow the state change from SDEV_QUIESCE to SDEV_BLOCK
2 parents c45e8bc + 1d2ff14 commit cebcff3

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,6 +3732,13 @@ qla2x00_remove_one(struct pci_dev *pdev)
37323732
}
37333733
qla2x00_wait_for_hba_ready(base_vha);
37343734

3735+
/*
3736+
* if UNLOADING flag is already set, then continue unload,
3737+
* where it was set first.
3738+
*/
3739+
if (test_and_set_bit(UNLOADING, &base_vha->dpc_flags))
3740+
return;
3741+
37353742
if (IS_QLA25XX(ha) || IS_QLA2031(ha) || IS_QLA27XX(ha) ||
37363743
IS_QLA28XX(ha)) {
37373744
if (ha->flags.fw_started)
@@ -3750,15 +3757,6 @@ qla2x00_remove_one(struct pci_dev *pdev)
37503757

37513758
qla2x00_wait_for_sess_deletion(base_vha);
37523759

3753-
/*
3754-
* if UNLOAD flag is already set, then continue unload,
3755-
* where it was set first.
3756-
*/
3757-
if (test_bit(UNLOADING, &base_vha->dpc_flags))
3758-
return;
3759-
3760-
set_bit(UNLOADING, &base_vha->dpc_flags);
3761-
37623760
qla_nvme_delete(base_vha);
37633761

37643762
dma_free_coherent(&ha->pdev->dev,
@@ -4864,6 +4862,9 @@ qla2x00_alloc_work(struct scsi_qla_host *vha, enum qla_work_type type)
48644862
struct qla_work_evt *e;
48654863
uint8_t bail;
48664864

4865+
if (test_bit(UNLOADING, &vha->dpc_flags))
4866+
return NULL;
4867+
48674868
QLA_VHA_MARK_BUSY(vha, bail);
48684869
if (bail)
48694870
return NULL;
@@ -6628,13 +6629,6 @@ qla2x00_disable_board_on_pci_error(struct work_struct *work)
66286629
struct pci_dev *pdev = ha->pdev;
66296630
scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);
66306631

6631-
/*
6632-
* if UNLOAD flag is already set, then continue unload,
6633-
* where it was set first.
6634-
*/
6635-
if (test_bit(UNLOADING, &base_vha->dpc_flags))
6636-
return;
6637-
66386632
ql_log(ql_log_warn, base_vha, 0x015b,
66396633
"Disabling adapter.\n");
66406634

@@ -6645,9 +6639,14 @@ qla2x00_disable_board_on_pci_error(struct work_struct *work)
66456639
return;
66466640
}
66476641

6648-
qla2x00_wait_for_sess_deletion(base_vha);
6642+
/*
6643+
* if UNLOADING flag is already set, then continue unload,
6644+
* where it was set first.
6645+
*/
6646+
if (test_and_set_bit(UNLOADING, &base_vha->dpc_flags))
6647+
return;
66496648

6650-
set_bit(UNLOADING, &base_vha->dpc_flags);
6649+
qla2x00_wait_for_sess_deletion(base_vha);
66516650

66526651
qla2x00_delete_all_vps(ha, base_vha);
66536652

drivers/scsi/scsi_lib.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,6 +2284,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
22842284
switch (oldstate) {
22852285
case SDEV_RUNNING:
22862286
case SDEV_CREATED_BLOCK:
2287+
case SDEV_QUIESCE:
22872288
case SDEV_OFFLINE:
22882289
break;
22892290
default:

drivers/target/target_core_iblock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ iblock_execute_zero_out(struct block_device *bdev, struct se_cmd *cmd)
432432
target_to_linux_sector(dev, cmd->t_task_lba),
433433
target_to_linux_sector(dev,
434434
sbc_get_write_same_sectors(cmd)),
435-
GFP_KERNEL, false);
435+
GFP_KERNEL, BLKDEV_ZERO_NOUNMAP);
436436
if (ret)
437437
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
438438

0 commit comments

Comments
 (0)