summaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@suse.de>2019-02-04 13:32:10 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2019-02-04 21:40:32 -0500
commitb6cd7f34ba1354498de03e6882c33f935b071e99 (patch)
tree1d0efd5a93487b23e2c7702a96ec788e0f90aa21 /drivers/target
parent42caa0edabd6a0a392ec36a5f0943924e4954311 (diff)
scsi: target: make the pi_prot_format ConfigFS path readable
pi_prot_format conversion to write-only caused userspace breakage. Make the ConfigFS path readable again and hardcode the "0\n" content, matching previous output. Fixes: 6baca7601bde ("scsi: target: drop unused pi_prot_format attribute storage") Link: https://bugzilla.redhat.com/show_bug.cgi?id=1667505 Reported-by: Lee Duncan <lduncan@suse.com> Reported-by: Laura Abbott <labbott@redhat.com> 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>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_configfs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index 72016d0dfca5..8e7fffbb8802 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -852,6 +852,12 @@ static ssize_t pi_prot_type_store(struct config_item *item,
852 return count; 852 return count;
853} 853}
854 854
855/* always zero, but attr needs to remain RW to avoid userspace breakage */
856static ssize_t pi_prot_format_show(struct config_item *item, char *page)
857{
858 return snprintf(page, PAGE_SIZE, "0\n");
859}
860
855static ssize_t pi_prot_format_store(struct config_item *item, 861static ssize_t pi_prot_format_store(struct config_item *item,
856 const char *page, size_t count) 862 const char *page, size_t count)
857{ 863{
@@ -1132,7 +1138,7 @@ CONFIGFS_ATTR(, emulate_3pc);
1132CONFIGFS_ATTR(, emulate_pr); 1138CONFIGFS_ATTR(, emulate_pr);
1133CONFIGFS_ATTR(, pi_prot_type); 1139CONFIGFS_ATTR(, pi_prot_type);
1134CONFIGFS_ATTR_RO(, hw_pi_prot_type); 1140CONFIGFS_ATTR_RO(, hw_pi_prot_type);
1135CONFIGFS_ATTR_WO(, pi_prot_format); 1141CONFIGFS_ATTR(, pi_prot_format);
1136CONFIGFS_ATTR(, pi_prot_verify); 1142CONFIGFS_ATTR(, pi_prot_verify);
1137CONFIGFS_ATTR(, enforce_pr_isids); 1143CONFIGFS_ATTR(, enforce_pr_isids);
1138CONFIGFS_ATTR(, is_nonrot); 1144CONFIGFS_ATTR(, is_nonrot);