Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b6cd7f34 authored by David Disseldorp's avatar David Disseldorp Committed by Martin K. Petersen
Browse files

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: 6baca760 ("scsi: target: drop unused pi_prot_format attribute storage")
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1667505


Reported-by: default avatarLee Duncan <lduncan@suse.com>
Reported-by: default avatarLaura Abbott <labbott@redhat.com>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarDavid Disseldorp <ddiss@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 42caa0ed
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -852,6 +852,12 @@ static ssize_t pi_prot_type_store(struct config_item *item,
	return count;
	return count;
}
}


/* always zero, but attr needs to remain RW to avoid userspace breakage */
static ssize_t pi_prot_format_show(struct config_item *item, char *page)
{
	return snprintf(page, PAGE_SIZE, "0\n");
}

static ssize_t pi_prot_format_store(struct config_item *item,
static ssize_t pi_prot_format_store(struct config_item *item,
		const char *page, size_t count)
		const char *page, size_t count)
{
{
@@ -1132,7 +1138,7 @@ CONFIGFS_ATTR(, emulate_3pc);
CONFIGFS_ATTR(, emulate_pr);
CONFIGFS_ATTR(, emulate_pr);
CONFIGFS_ATTR(, pi_prot_type);
CONFIGFS_ATTR(, pi_prot_type);
CONFIGFS_ATTR_RO(, hw_pi_prot_type);
CONFIGFS_ATTR_RO(, hw_pi_prot_type);
CONFIGFS_ATTR_WO(, pi_prot_format);
CONFIGFS_ATTR(, pi_prot_format);
CONFIGFS_ATTR(, pi_prot_verify);
CONFIGFS_ATTR(, pi_prot_verify);
CONFIGFS_ATTR(, enforce_pr_isids);
CONFIGFS_ATTR(, enforce_pr_isids);
CONFIGFS_ATTR(, is_nonrot);
CONFIGFS_ATTR(, is_nonrot);