[RHEL7,COMMIT] ms/libata: Fix ATA request sense

Submitted by Konstantin Khorenko on Oct. 1, 2019, 2:49 p.m.


Message ID 201910011449.x91Entfr015690@finist-ce7.sw.ru
State New
Series "ms/libata: Fix ATA request sense"
Headers show

Commit Message

Konstantin Khorenko Oct. 1, 2019, 2:49 p.m.
The commit is pushed to "branch-rh7-3.10.0-957.27.2.vz7.107.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.27.2.vz7.107.11
commit be5c8aa1be187c7fc9e5b7f1dd05c087f15db245
Author: Damien Le Moal <damien.lemoal@wdc.com>
Date:   Tue Oct 1 17:49:55 2019 +0300

    ms/libata: Fix ATA request sense
    For an ATA device supporting the sense data reporting feature set, a
    failed command will trigger the execution of ata_eh_request_sense if
    the result task file of the failed command has the ATA_SENSE bit set
    (sense data available bit). ata_eh_request_sense executes the REQUEST
    SENSE DATA EXT command to retrieve the sense data of the failed
    command. On success of REQUEST SENSE DATA EXT, the ATA_SENSE bit will
    NOT be set (the command succeeded) but ata_eh_request_sense
    nevertheless tests the availability of sense data by testing that bit
    presence in the result tf of the REQUEST SENSE DATA EXT command.  This
    leads us to falsely assume that request sense data failed and to the
    warning message:
    atax.xx: request sense failed stat 50 emask 0
    Upon success of REQUEST SENSE DATA EXT, set the ATA_SENSE bit in the
    result task file command so that sense data can be returned by
    Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Cc: stable@vger.kernel.org
    (cherry picked from commit 2dae99558e86894e9e5dbf097477baaa5eb70134)
    Signed-off-by: Ildar Ismagilov <ildar.ismagilov@virtuozzo.com>
    Patchset description:
    Add support of SMR ATA disk
    This patchset adds support of SMR ATA disk through SCSI generic interface
    aka /dev/sgX.
    The SCSI generic interface is used by libzbc library for communicate
    with SMR disk. These patches allow us to use SMR disk through
    "ata" backend of libzbc ("scsi" and "block" backends aren't supported).
    These patches were tested with following command:
     libzbc/test/zbc_test.sh /dev/sgX
    JIRA: https://pmc.acronis.com/browse/VSTOR-26930
    Damien Le Moal (1):
      libata: Fix ATA request sense
    Hannes Reinecke (5):
      libata: Implement ATA_DEV_ZAC
      libata-scsi: Update SATL for ZAC drives
      libata: Implement NCQ autosense
      libata: Implement support for sense data reporting
      libata: fixup ZAC device disabling
 drivers/ata/libata-core.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index d2272247bf58..7ce382cd1da8 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1691,6 +1691,8 @@  unsigned ata_exec_internal_sg(struct ata_device *dev,
 		if (qc->err_mask & ~AC_ERR_OTHER)
 			qc->err_mask &= ~AC_ERR_OTHER;
+	} else if (qc->tf.command == ATA_CMD_REQ_SENSE_DATA) {
+		qc->result_tf.command |= ATA_SENSE;
 	/* finish up */