* [PATCH] tcmu: fix error resetting qfull_time_out to default
@ 2018-04-09 11:56 Prasanna Kumar Kalever
2018-04-10 9:11 ` Xiubo Li
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Prasanna Kumar Kalever @ 2018-04-09 11:56 UTC (permalink / raw)
To: target-devel
Problem:
-------
$ cat /sys/kernel/config/target/core/user_0/block/attrib/qfull_time_out
-1
$ echo "-1" > /sys/kernel/config/target/core/user_0/block/attrib/qfull_time_out
-bash: echo: write error: Invalid argument
Fix:
---
This patch will help reset qfull_time_out to its default i.e. qfull_time_out=-1
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
---
drivers/target/target_core_user.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
index 4ad89ea71a70..4f26bdc3d1dc 100644
--- a/drivers/target/target_core_user.c
+++ b/drivers/target/target_core_user.c
@@ -2121,6 +2121,8 @@ static ssize_t tcmu_qfull_time_out_store(struct config_item *item,
if (val >= 0) {
udev->qfull_time_out = val * MSEC_PER_SEC;
+ } else if (val = -1) {
+ udev->qfull_time_out = val;
} else {
printk(KERN_ERR "Invalid qfull timeout value %d\n", val);
return -EINVAL;
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] tcmu: fix error resetting qfull_time_out to default
2018-04-09 11:56 [PATCH] tcmu: fix error resetting qfull_time_out to default Prasanna Kumar Kalever
@ 2018-04-10 9:11 ` Xiubo Li
2018-04-12 16:49 ` Mike Christie
2018-04-12 16:50 ` Mike Christie
2 siblings, 0 replies; 4+ messages in thread
From: Xiubo Li @ 2018-04-10 9:11 UTC (permalink / raw)
To: target-devel
On 2018/4/9 19:44, Prasanna Kumar Kalever wrote:
> Problem:
> -------
> $ cat /sys/kernel/config/target/core/user_0/block/attrib/qfull_time_out
> -1
>
> $ echo "-1" > /sys/kernel/config/target/core/user_0/block/attrib/qfull_time_out
> -bash: echo: write error: Invalid argument
>
> Fix:
> ---
> This patch will help reset qfull_time_out to its default i.e. qfull_time_out=-1
>
> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
> ---
> drivers/target/target_core_user.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
> index 4ad89ea71a70..4f26bdc3d1dc 100644
> --- a/drivers/target/target_core_user.c
> +++ b/drivers/target/target_core_user.c
> @@ -2121,6 +2121,8 @@ static ssize_t tcmu_qfull_time_out_store(struct config_item *item,
>
> if (val >= 0) {
> udev->qfull_time_out = val * MSEC_PER_SEC;
> + } else if (val = -1) {
> + udev->qfull_time_out = val;
> } else {
> printk(KERN_ERR "Invalid qfull timeout value %d\n", val);
> return -EINVAL;
This looks fine to me.
@Mike, IMO the -1 could also be settable just like this case. And does
it have any other special meaning expects to compatible to cmd_time_out ?
Thanks,
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] tcmu: fix error resetting qfull_time_out to default
2018-04-09 11:56 [PATCH] tcmu: fix error resetting qfull_time_out to default Prasanna Kumar Kalever
2018-04-10 9:11 ` Xiubo Li
@ 2018-04-12 16:49 ` Mike Christie
2018-04-12 16:50 ` Mike Christie
2 siblings, 0 replies; 4+ messages in thread
From: Mike Christie @ 2018-04-12 16:49 UTC (permalink / raw)
To: target-devel
On 04/10/2018 04:11 AM, Xiubo Li wrote:
>
> On 2018/4/9 19:44, Prasanna Kumar Kalever wrote:
>> Problem:
>> -------
>> $ cat /sys/kernel/config/target/core/user_0/block/attrib/qfull_time_out
>> -1
>>
>> $ echo "-1" >
>> /sys/kernel/config/target/core/user_0/block/attrib/qfull_time_out
>> -bash: echo: write error: Invalid argument
>>
>> Fix:
>> ---
>> This patch will help reset qfull_time_out to its default i.e.
>> qfull_time_out=-1
>>
>> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
>> ---
>> drivers/target/target_core_user.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/target/target_core_user.c
>> b/drivers/target/target_core_user.c
>> index 4ad89ea71a70..4f26bdc3d1dc 100644
>> --- a/drivers/target/target_core_user.c
>> +++ b/drivers/target/target_core_user.c
>> @@ -2121,6 +2121,8 @@ static ssize_t tcmu_qfull_time_out_store(struct
>> config_item *item,
>> if (val >= 0) {
>> udev->qfull_time_out = val * MSEC_PER_SEC;
>> + } else if (val = -1) {
>> + udev->qfull_time_out = val;
>> } else {
>> printk(KERN_ERR "Invalid qfull timeout value %d\n", val);
>> return -EINVAL;
>
> This looks fine to me.
>
> @Mike, IMO the -1 could also be settable just like this case. And does
> it have any other special meaning expects to compatible to cmd_time_out ?
>
It was just for backwards compat. It was not meant to be settable,
because I didn't think someone would actually want to set it then reset
it to the compat mode again.
It seems fine.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] tcmu: fix error resetting qfull_time_out to default
2018-04-09 11:56 [PATCH] tcmu: fix error resetting qfull_time_out to default Prasanna Kumar Kalever
2018-04-10 9:11 ` Xiubo Li
2018-04-12 16:49 ` Mike Christie
@ 2018-04-12 16:50 ` Mike Christie
2 siblings, 0 replies; 4+ messages in thread
From: Mike Christie @ 2018-04-12 16:50 UTC (permalink / raw)
To: target-devel
On 04/09/2018 06:44 AM, Prasanna Kumar Kalever wrote:
> Problem:
> -------
> $ cat /sys/kernel/config/target/core/user_0/block/attrib/qfull_time_out
> -1
>
> $ echo "-1" > /sys/kernel/config/target/core/user_0/block/attrib/qfull_time_out
> -bash: echo: write error: Invalid argument
>
> Fix:
> ---
> This patch will help reset qfull_time_out to its default i.e. qfull_time_out=-1
>
> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
> ---
> drivers/target/target_core_user.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
> index 4ad89ea71a70..4f26bdc3d1dc 100644
> --- a/drivers/target/target_core_user.c
> +++ b/drivers/target/target_core_user.c
> @@ -2121,6 +2121,8 @@ static ssize_t tcmu_qfull_time_out_store(struct config_item *item,
>
> if (val >= 0) {
> udev->qfull_time_out = val * MSEC_PER_SEC;
> + } else if (val = -1) {
> + udev->qfull_time_out = val;
> } else {
> printk(KERN_ERR "Invalid qfull timeout value %d\n", val);
> return -EINVAL;
>
Acked-by: Mike Christie <mchristi@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-04-12 16:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-09 11:56 [PATCH] tcmu: fix error resetting qfull_time_out to default Prasanna Kumar Kalever
2018-04-10 9:11 ` Xiubo Li
2018-04-12 16:49 ` Mike Christie
2018-04-12 16:50 ` Mike Christie
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.