Skip to contentSkip to conversation

scsi: target: core: add line break to status show

PATCH Applied Guixin Liu 3 participants 5 messages Jan 14, 2025 – Feb 4, 2025

Subsystems (2)
lore
Share & tools
lore

Guixin Liu

author
#0 lore raw

PATCH 1/1 scsi: target: core: add line break to status show

To ensure the output is not tangled with the shell prompt, add a line break to clearly display the status.

---
 drivers/target/target_core_stat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/target/target_core_stat.c +2 -2
index c42cbde8a31b..210648a0092e 100644
@@ -117,9 +117,9 @@ static ssize_t target_stat_tgt_status_show(struct config_item *item,
 		char *page)
 {
 	if (to_stat_tgt_dev(item)->export_count)
-		return snprintf(page, PAGE_SIZE, "activated");
+		return snprintf(page, PAGE_SIZE, "activated\n");
 	else
-		return snprintf(page, PAGE_SIZE, "deactivated");
+		return snprintf(page, PAGE_SIZE, "deactivated\n");
 }
 
 static ssize_t target_stat_tgt_non_access_lus_show(struct config_item *item,
Signature · 1 line
2.43.0
author
#1 lore raw

gentle ping...

Best Regards,

Guixin Liu

Quoted 24 lines · Guixin Liu

To ensure the output is not tangled with the shell prompt, add a line break to clearly display the status.

---
  drivers/target/target_core_stat.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/target/target_core_stat.c +2 -2
index c42cbde8a31b..210648a0092e 100644
@@ -117,9 +117,9 @@ static ssize_t target_stat_tgt_status_show(struct config_item *item,
  		char *page)
  {
  	if (to_stat_tgt_dev(item)->export_count)
-		return snprintf(page, PAGE_SIZE, "activated");
+		return snprintf(page, PAGE_SIZE, "activated\n");
  	else
-		return snprintf(page, PAGE_SIZE, "deactivated");
+		return snprintf(page, PAGE_SIZE, "deactivated\n");
  }
 
  static ssize_t target_stat_tgt_non_access_lus_show(struct config_item *item,
Reviewed-by on v1 1/1
#2 lore raw
In reply to Guixin Liu
Quoted 14 lines · Guixin Liu

To ensure the output is not tangled with the shell prompt, add a line break to clearly display the status.

---
 drivers/target/target_core_stat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/target/target_core_stat.c +0 -0
index c42cbde8a31b..210648a0092e 100644
@@ -117,9 +117,9 @@ static ssize_t target_stat_tgt_status_show(struct config_item *item,
 		char *page)

drivers/target/target_core_stat.c static ssize_t target_stat_tgt_status_show(struct config_item *item, · line 125

Quoted 10 lines
drivers/target/target_core_stat.c +2 -2
 {
 	if (to_stat_tgt_dev(item)->export_count)
-		return snprintf(page, PAGE_SIZE, "activated");
+		return snprintf(page, PAGE_SIZE, "activated\n");
 	else
-		return snprintf(page, PAGE_SIZE, "deactivated");
+		return snprintf(page, PAGE_SIZE, "deactivated\n");
 }
 
 static ssize_t target_stat_tgt_non_access_lus_show(struct config_item *item,

Since all the other files have newlines, this will most likely be ok. targetcli/rtslib work fine.

#3 lore raw
In reply to Guixin Liu

Guixin,

Quoted 2 lines

To ensure the output is not tangled with the shell prompt, add a line break to clearly display the status.

Applied to 6.14/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering