public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: target: core: add line break to status show
@ 2025-01-14  2:50 Guixin Liu
  2025-01-17  5:57 ` Guixin Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Guixin Liu @ 2025-01-14  2:50 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, target-devel

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

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
---
 drivers/target/target_core_stat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c
index c42cbde8a31b..210648a0092e 100644
--- a/drivers/target/target_core_stat.c
+++ b/drivers/target/target_core_stat.c
@@ -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,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: target: core: add line break to status show
  2025-01-14  2:50 [PATCH] scsi: target: core: add line break to status show Guixin Liu
@ 2025-01-17  5:57 ` Guixin Liu
  2025-01-17 19:43 ` Mike Christie
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Guixin Liu @ 2025-01-17  5:57 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, target-devel

gentle ping...

Best Regards,

Guixin Liu

在 2025/1/14 10:50, Guixin Liu 写道:
> To ensure the output is not tangled with the shell prompt, add a
> line break to clearly display the status.
>
> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
> ---
>   drivers/target/target_core_stat.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c
> index c42cbde8a31b..210648a0092e 100644
> --- a/drivers/target/target_core_stat.c
> +++ b/drivers/target/target_core_stat.c
> @@ -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,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: target: core: add line break to status show
  2025-01-14  2:50 [PATCH] scsi: target: core: add line break to status show Guixin Liu
  2025-01-17  5:57 ` Guixin Liu
@ 2025-01-17 19:43 ` Mike Christie
  2025-01-21 17:19 ` Martin K. Petersen
  2025-02-04  3:35 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Mike Christie @ 2025-01-17 19:43 UTC (permalink / raw)
  To: Guixin Liu, Martin K . Petersen; +Cc: linux-scsi, target-devel

On 1/13/25 8:50 PM, Guixin Liu wrote:
> To ensure the output is not tangled with the shell prompt, add a
> line break to clearly display the status.
> 
> Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
> ---
>  drivers/target/target_core_stat.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/target/target_core_stat.c b/drivers/target/target_core_stat.c
> index c42cbde8a31b..210648a0092e 100644
> --- a/drivers/target/target_core_stat.c
> +++ b/drivers/target/target_core_stat.c
> @@ -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,

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

Reviewed-by: Mike Christie <michael.christie@oracle.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: target: core: add line break to status show
  2025-01-14  2:50 [PATCH] scsi: target: core: add line break to status show Guixin Liu
  2025-01-17  5:57 ` Guixin Liu
  2025-01-17 19:43 ` Mike Christie
@ 2025-01-21 17:19 ` Martin K. Petersen
  2025-02-04  3:35 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2025-01-21 17:19 UTC (permalink / raw)
  To: Guixin Liu; +Cc: Martin K . Petersen, linux-scsi, target-devel


Guixin,

> 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!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] scsi: target: core: add line break to status show
  2025-01-14  2:50 [PATCH] scsi: target: core: add line break to status show Guixin Liu
                   ` (2 preceding siblings ...)
  2025-01-21 17:19 ` Martin K. Petersen
@ 2025-02-04  3:35 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2025-02-04  3:35 UTC (permalink / raw)
  To: Guixin Liu; +Cc: Martin K . Petersen, linux-scsi, target-devel

On Tue, 14 Jan 2025 10:50:41 +0800, Guixin Liu wrote:

> 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-fixes, thanks!

[1/1] scsi: target: core: add line break to status show
      https://git.kernel.org/mkp/scsi/c/c9d2782988df

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-02-04  3:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-14  2:50 [PATCH] scsi: target: core: add line break to status show Guixin Liu
2025-01-17  5:57 ` Guixin Liu
2025-01-17 19:43 ` Mike Christie
2025-01-21 17:19 ` Martin K. Petersen
2025-02-04  3:35 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox