Skip to content

Commit b6cd7f3

Browse files
ddissmartinkpetersen
authored andcommitted
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: 6baca76 ("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>
1 parent 42caa0e commit b6cd7f3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/target/target_core_configfs.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,12 @@ static ssize_t pi_prot_type_store(struct config_item *item,
852852
return count;
853853
}
854854

855+
/* always zero, but attr needs to remain RW to avoid userspace breakage */
856+
static ssize_t pi_prot_format_show(struct config_item *item, char *page)
857+
{
858+
return snprintf(page, PAGE_SIZE, "0\n");
859+
}
860+
855861
static ssize_t pi_prot_format_store(struct config_item *item,
856862
const char *page, size_t count)
857863
{
@@ -1132,7 +1138,7 @@ CONFIGFS_ATTR(, emulate_3pc);
11321138
CONFIGFS_ATTR(, emulate_pr);
11331139
CONFIGFS_ATTR(, pi_prot_type);
11341140
CONFIGFS_ATTR_RO(, hw_pi_prot_type);
1135-
CONFIGFS_ATTR_WO(, pi_prot_format);
1141+
CONFIGFS_ATTR(, pi_prot_format);
11361142
CONFIGFS_ATTR(, pi_prot_verify);
11371143
CONFIGFS_ATTR(, enforce_pr_isids);
11381144
CONFIGFS_ATTR(, is_nonrot);

0 commit comments

Comments
 (0)