scsi: sd: Fix wrong DPOFUA disable in sd_read_cache_type
authorDamien Le Moal <damien.lemoal@wdc.com>
Thu, 12 Jan 2017 06:25:10 +0000 (15:25 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Jul 2017 12:37:16 +0000 (14:37 +0200)
commit5c982bac211ccc3923519a980f2e9a53ea8e6b60
tree7c3e8043f1df2c955ff42ae3abd7f9ee743ed8c4
parentb92f9f6a2c09683bab8c3ac806f8dd0235bb9003
scsi: sd: Fix wrong DPOFUA disable in sd_read_cache_type

[ Upstream commit 26f2819772af891dee2843e1f8662c58e5129d5f ]

Zoned block devices force the use of READ/WRITE(16) commands by setting
sdkp->use_16_for_rw and clearing sdkp->use_10_for_rw. This result in
DPOFUA always being disabled for these drives as the assumed use of
the deprecated READ/WRITE(6) commands only looks at sdkp->use_10_for_rw.
Strenghten the test by also checking that sdkp->use_16_for_rw is false.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/sd.c