All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] target:tcmu:add '\n' when return user space
@ 2019-03-11 16:48 David Disseldorp
  0 siblings, 0 replies; 6+ messages in thread
From: David Disseldorp @ 2019-03-11 16:48 UTC (permalink / raw)
  To: target-devel

On Mon, 11 Mar 2019 11:15:53 -0500, Mike Christie wrote:

> >> Although minor, this is still a modification to a released API so
> >> probably can't be done without potentially breaking user-space.
> >>  
> > 
> > I think the lack of newline is breaking some tools, because they were
> > looking for newlines due to the other files having it.
> >   
> 
> I guess that does not make sense. It will be easier to update userspace
> and we would have to carry the userspcae patch for older kernels, so the
> patch is not needed.

Agreed. After getting burnt by 6baca7601bde I'm hesitant to make any
changes to existing configFS attributes.

Cheers, David

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

* Re: [PATCH] target:tcmu:add '\n' when return user space
@ 2019-03-11 16:15 Mike Christie
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Christie @ 2019-03-11 16:15 UTC (permalink / raw)
  To: target-devel

On 03/11/2019 11:05 AM, Mike Christie wrote:
> On 03/10/2019 09:41 AM, David Disseldorp wrote:
>> Hi,
>>
>> On Sun, 10 Mar 2019 22:07:53 +0800, tangwenji wrote:
>>
>>> In function tcmu_get_global_max_data_area return string should include '\n'.
>>
>> Why? Please describe the motivation for your changes.
>>
>>> Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
>>> ---
>>>  drivers/target/target_core_user.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
>>> index 5831e0e..50229c1 100644
>>> --- a/drivers/target/target_core_user.c
>>> +++ b/drivers/target/target_core_user.c
>>> @@ -244,7 +244,7 @@ static int tcmu_set_global_max_data_area(const char *str,
>>>  static int tcmu_get_global_max_data_area(char *buffer,
>>>  					 const struct kernel_param *kp)
>>>  {
>>> -	return sprintf(buffer, "%d", TCMU_BLOCKS_TO_MBS(tcmu_global_max_blocks));
>>> +	return sprintf(buffer, "%d\n", TCMU_BLOCKS_TO_MBS(tcmu_global_max_blocks));
>>
>> Although minor, this is still a modification to a released API so
>> probably can't be done without potentially breaking user-space.
>>
> 
> I think the lack of newline is breaking some tools, because they were
> looking for newlines due to the other files having it.
> 

I guess that does not make sense. It will be easier to update userspace
and we would have to carry the userspcae patch for older kernels, so the
patch is not needed.

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

* Re: [PATCH] target:tcmu:add '\n' when return user space
@ 2019-03-11 16:05 Mike Christie
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Christie @ 2019-03-11 16:05 UTC (permalink / raw)
  To: target-devel

On 03/10/2019 09:41 AM, David Disseldorp wrote:
> Hi,
> 
> On Sun, 10 Mar 2019 22:07:53 +0800, tangwenji wrote:
> 
>> In function tcmu_get_global_max_data_area return string should include '\n'.
> 
> Why? Please describe the motivation for your changes.
> 
>> Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
>> ---
>>  drivers/target/target_core_user.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
>> index 5831e0e..50229c1 100644
>> --- a/drivers/target/target_core_user.c
>> +++ b/drivers/target/target_core_user.c
>> @@ -244,7 +244,7 @@ static int tcmu_set_global_max_data_area(const char *str,
>>  static int tcmu_get_global_max_data_area(char *buffer,
>>  					 const struct kernel_param *kp)
>>  {
>> -	return sprintf(buffer, "%d", TCMU_BLOCKS_TO_MBS(tcmu_global_max_blocks));
>> +	return sprintf(buffer, "%d\n", TCMU_BLOCKS_TO_MBS(tcmu_global_max_blocks));
> 
> Although minor, this is still a modification to a released API so
> probably can't be done without potentially breaking user-space.
> 

I think the lack of newline is breaking some tools, because they were
looking for newlines due to the other files having it.

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

* Re: [PATCH] target:tcmu:add '\n' when return user space
@ 2019-03-11 16:03 Mike Christie
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Christie @ 2019-03-11 16:03 UTC (permalink / raw)
  To: target-devel

On 03/10/2019 09:07 AM, tangwenji wrote:
> From: tangwenji <tang.wenji@zte.com.cn>
> 
> In function tcmu_get_global_max_data_area return string should include '\n'.
> 
> Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
> ---
>  drivers/target/target_core_user.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
> index 5831e0e..50229c1 100644
> --- a/drivers/target/target_core_user.c
> +++ b/drivers/target/target_core_user.c
> @@ -244,7 +244,7 @@ static int tcmu_set_global_max_data_area(const char *str,
>  static int tcmu_get_global_max_data_area(char *buffer,
>  					 const struct kernel_param *kp)
>  {
> -	return sprintf(buffer, "%d", TCMU_BLOCKS_TO_MBS(tcmu_global_max_blocks));
> +	return sprintf(buffer, "%d\n", TCMU_BLOCKS_TO_MBS(tcmu_global_max_blocks));
>  }
>  
>  static const struct kernel_param_ops tcmu_global_max_data_area_op = {
> 

Acked-by: Mike Christie <mchristi@redhat.com>

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

* Re: [PATCH] target:tcmu:add '\n' when return user space
@ 2019-03-10 14:41 David Disseldorp
  0 siblings, 0 replies; 6+ messages in thread
From: David Disseldorp @ 2019-03-10 14:41 UTC (permalink / raw)
  To: target-devel

Hi,

On Sun, 10 Mar 2019 22:07:53 +0800, tangwenji wrote:

> In function tcmu_get_global_max_data_area return string should include '\n'.

Why? Please describe the motivation for your changes.

> Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
> ---
>  drivers/target/target_core_user.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
> index 5831e0e..50229c1 100644
> --- a/drivers/target/target_core_user.c
> +++ b/drivers/target/target_core_user.c
> @@ -244,7 +244,7 @@ static int tcmu_set_global_max_data_area(const char *str,
>  static int tcmu_get_global_max_data_area(char *buffer,
>  					 const struct kernel_param *kp)
>  {
> -	return sprintf(buffer, "%d", TCMU_BLOCKS_TO_MBS(tcmu_global_max_blocks));
> +	return sprintf(buffer, "%d\n", TCMU_BLOCKS_TO_MBS(tcmu_global_max_blocks));

Although minor, this is still a modification to a released API so
probably can't be done without potentially breaking user-space.

Cheers, David

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

* [PATCH] target:tcmu:add '\n' when return user space
@ 2019-03-10 14:07 tangwenji
  0 siblings, 0 replies; 6+ messages in thread
From: tangwenji @ 2019-03-10 14:07 UTC (permalink / raw)
  To: target-devel

From: tangwenji <tang.wenji@zte.com.cn>

In function tcmu_get_global_max_data_area return string should include '\n'.

Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
---
 drivers/target/target_core_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index 5831e0e..50229c1 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -244,7 +244,7 @@ static int tcmu_set_global_max_data_area(const char *str,
 static int tcmu_get_global_max_data_area(char *buffer,
 					 const struct kernel_param *kp)
 {
-	return sprintf(buffer, "%d", TCMU_BLOCKS_TO_MBS(tcmu_global_max_blocks));
+	return sprintf(buffer, "%d\n", TCMU_BLOCKS_TO_MBS(tcmu_global_max_blocks));
 }
 
 static const struct kernel_param_ops tcmu_global_max_data_area_op = {
-- 
2.5.0.windows.1

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

end of thread, other threads:[~2019-03-11 16:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-11 16:48 [PATCH] target:tcmu:add '\n' when return user space David Disseldorp
  -- strict thread matches above, loose matches on Subject: below --
2019-03-11 16:15 Mike Christie
2019-03-11 16:05 Mike Christie
2019-03-11 16:03 Mike Christie
2019-03-10 14:41 David Disseldorp
2019-03-10 14:07 tangwenji

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.