* [PATCH] target: make the pi_prot_format ConfigFS path readable
@ 2019-02-04 18:32 David Disseldorp
2019-02-05 2:18 ` Martin K. Petersen
2019-02-05 2:31 ` Bart Van Assche
0 siblings, 2 replies; 3+ messages in thread
From: David Disseldorp @ 2019-02-04 18:32 UTC (permalink / raw)
To: target-devel
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\x1667505
Reported-by: Lee Duncan <lduncan@suse.com>
Reported-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>
---
drivers/target/target_core_configfs.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
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,
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,
const char *page, size_t count)
{
@@ -1132,7 +1138,7 @@ CONFIGFS_ATTR(, emulate_3pc);
CONFIGFS_ATTR(, emulate_pr);
CONFIGFS_ATTR(, 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(, enforce_pr_isids);
CONFIGFS_ATTR(, is_nonrot);
--
2.13.7
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] target: make the pi_prot_format ConfigFS path readable
2019-02-04 18:32 [PATCH] target: make the pi_prot_format ConfigFS path readable David Disseldorp
@ 2019-02-05 2:18 ` Martin K. Petersen
2019-02-05 2:31 ` Bart Van Assche
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2019-02-05 2:18 UTC (permalink / raw)
To: target-devel
David,
> 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.
Applied to 5.0/scsi-fixes, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] target: make the pi_prot_format ConfigFS path readable
2019-02-04 18:32 [PATCH] target: make the pi_prot_format ConfigFS path readable David Disseldorp
2019-02-05 2:18 ` Martin K. Petersen
@ 2019-02-05 2:31 ` Bart Van Assche
1 sibling, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2019-02-05 2:31 UTC (permalink / raw)
To: target-devel
On 2/4/19 10:32 AM, David Disseldorp wrote:
> 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\x1667505
> Reported-by: Lee Duncan <lduncan@suse.com>
> Reported-by: Laura Abbott <labbott@redhat.com>
> Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-05 2:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-04 18:32 [PATCH] target: make the pi_prot_format ConfigFS path readable David Disseldorp
2019-02-05 2:18 ` Martin K. Petersen
2019-02-05 2:31 ` Bart Van Assche
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.