]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: target: fix unmap_zeroes_data boolean initialisation
authorDavid Disseldorp <ddiss@suse.de>
Wed, 19 Feb 2020 13:01:35 +0000 (14:01 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 21 Feb 2020 22:37:13 +0000 (17:37 -0500)
commit17de5d8b19ae521c26b597d595ff9e3150d2ba52
tree63a7c20558931cdf7e58fc0a1068c55d5d4d18de
parentf0f5be02a3f6b93ff85a6583552a01d3a5636be9
scsi: target: fix unmap_zeroes_data boolean initialisation

The LIO unmap_zeroes_data device attribute is mapped to the LBPRZ flag in
the READ CAPACITY(16) and Thin Provisioning VPD INQUIRY responses.

The unmap_zeroes_data attribute is exposed via configfs, where any write
value is correctly validated via strtobool(). However, when initialised via
target_configure_unmap_from_queue() it takes the value of the device's
max_write_zeroes_sectors queue limit, which is non-boolean.

A non-boolean value can be read from configfs, but attempting to write the
same value back results in -EINVAL, causing problems for configuration
utilities such as targetcli.

Link: https://marc.info/?l=target-devel&m=158213354011309
Fixes: 599052a4b65b ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_device.c
include/target/target_core_base.h