linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] s390: Fix me in dasd_eer.c
@ 2014-07-22  6:29 Nicholas Krause
  2014-07-23 12:18 ` One Thousand Gnomes
  2014-07-28 16:02 ` Stefan Weinhuber
  0 siblings, 2 replies; 5+ messages in thread
From: Nicholas Krause @ 2014-07-22  6:29 UTC (permalink / raw)
  To: wein
  Cc: stefan.haberland, schwidefsky, heiko.carstens, linux390,
	linux-s390, linux-kernel

This patch changes return type to EMEDUIMTYPE in function, dasd_eer_enable
for when checking if the medium has no errors according to this function.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 drivers/s390/block/dasd_eer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c
index 21ef63c..08ee040 100644
--- a/drivers/s390/block/dasd_eer.c
+++ b/drivers/s390/block/dasd_eer.c
@@ -462,7 +462,7 @@ int dasd_eer_enable(struct dasd_device *device)
 		return 0;
 
 	if (!device->discipline || strcmp(device->discipline->name, "ECKD"))
-		return -EPERM;	/* FIXME: -EMEDIUMTYPE ? */
+		return -EMEDIUMTYPE;	/* FIXME: -EMEDIUMTYPE ? */
 
 	cqr = dasd_kmalloc_request(DASD_ECKD_MAGIC, 1 /* SNSS */,
 				   SNSS_DATA_SIZE, device);
-- 
1.9.1


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

* Re: [PATCH] s390: Fix me in dasd_eer.c
  2014-07-22  6:29 [PATCH] s390: Fix me in dasd_eer.c Nicholas Krause
@ 2014-07-23 12:18 ` One Thousand Gnomes
  2014-07-23 15:41   ` Nick Krause
  2014-07-28 16:02 ` Stefan Weinhuber
  1 sibling, 1 reply; 5+ messages in thread
From: One Thousand Gnomes @ 2014-07-23 12:18 UTC (permalink / raw)
  To: Nicholas Krause
  Cc: wein, stefan.haberland, schwidefsky, heiko.carstens, linux390,
	linux-s390, linux-kernel

On Tue, 22 Jul 2014 02:29:32 -0400
Nicholas Krause <xerofoify@gmail.com> wrote:

> This patch changes return type to EMEDUIMTYPE in function, dasd_eer_enable
> for when checking if the medium has no errors according to this function.
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>

What distributions have you tested this with and what configurations?

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

* Re: [PATCH] s390: Fix me in dasd_eer.c
  2014-07-23 12:18 ` One Thousand Gnomes
@ 2014-07-23 15:41   ` Nick Krause
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Krause @ 2014-07-23 15:41 UTC (permalink / raw)
  To: One Thousand Gnomes
  Cc: wein, stefan.haberland, schwidefsky, heiko.carstens, linux390,
	linux-s390, linux-kernel

On Wed, Jul 23, 2014 at 8:18 AM, One Thousand Gnomes
<gnomes@lxorguk.ukuu.org.uk> wrote:
> On Tue, 22 Jul 2014 02:29:32 -0400
> Nicholas Krause <xerofoify@gmail.com> wrote:
>
>> This patch changes return type to EMEDUIMTYPE in function, dasd_eer_enable
>> for when checking if the medium has no errors according to this function.
>>
>> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
>
> What distributions have you tested this with and what configurations?

I have not tested this patch but based on the logical statements this
seems to be
correct.
Nick

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

* Re: [PATCH] s390: Fix me in dasd_eer.c
  2014-07-22  6:29 [PATCH] s390: Fix me in dasd_eer.c Nicholas Krause
  2014-07-23 12:18 ` One Thousand Gnomes
@ 2014-07-28 16:02 ` Stefan Weinhuber
  2014-07-28 16:06   ` Nick Krause
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Weinhuber @ 2014-07-28 16:02 UTC (permalink / raw)
  To: Nicholas Krause
  Cc: BOEBLINGEN LINUX390, heicars2, linux-kernel, linux-s390,
	mschwid2, Stefan Haberland1

Nicholas Krause <xerofoify@gmail.com> wrote on 2014-07-22 08:29:32:

[..] 
> Subject:
> 
> [PATCH] s390: Fix me in dasd_eer.c
> 
> This patch changes return type to EMEDUIMTYPE in function, 
dasd_eer_enable
> for when checking if the medium has no errors according to this 
function.
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  drivers/s390/block/dasd_eer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/s390/block/dasd_eer.c 
b/drivers/s390/block/dasd_eer.c
> index 21ef63c..08ee040 100644
> --- a/drivers/s390/block/dasd_eer.c
> +++ b/drivers/s390/block/dasd_eer.c
> @@ -462,7 +462,7 @@ int dasd_eer_enable(struct dasd_device *device)
>        return 0;
> 
>     if (!device->discipline || strcmp(device->discipline->name, "ECKD"))
> -      return -EPERM;   /* FIXME: -EMEDIUMTYPE ? */
> +      return -EMEDIUMTYPE;   /* FIXME: -EMEDIUMTYPE ? */
> 
>     cqr = dasd_kmalloc_request(DASD_ECKD_MAGIC, 1 /* SNSS */,
>                 SNSS_DATA_SIZE, device);
> -- 
> 1.9.1
>

Hm, after some consideration, I have to disagree with your suggestion.
If you try to enable EER on an FBA device, you will get the following
result with current code:

$ echo 1 > eer_enabled
-bash: echo: write error: Operation not permitted

and with your code the following:

$ echo 1 > eer_enabled
-bash: echo: write error: Wrong medium type

When I wrote this code, I was not sure which one is better. But today I 
say
that the 'Operation not permitted' is more to the point. An FBA device
has no (changable) medium, so what could be wrong about its type?
Could be confusing.

>From your patch description I do not really get why you want to change the
return code. Why do you think that EMEDIUMTYPE is better than EPERM?

Mit freundlichen Grüßen / Kind regards
 
Stefan Weinhuber


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

* Re: [PATCH] s390: Fix me in dasd_eer.c
  2014-07-28 16:02 ` Stefan Weinhuber
@ 2014-07-28 16:06   ` Nick Krause
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Krause @ 2014-07-28 16:06 UTC (permalink / raw)
  To: Stefan Weinhuber
  Cc: BOEBLINGEN LINUX390, heicars2, linux-kernel, linux-s390,
	mschwid2, Stefan Haberland1

On Mon, Jul 28, 2014 at 12:02 PM, Stefan Weinhuber <WEIN@de.ibm.com> wrote:
> Nicholas Krause <xerofoify@gmail.com> wrote on 2014-07-22 08:29:32:
>
> [..]
>> Subject:
>>
>> [PATCH] s390: Fix me in dasd_eer.c
>>
>> This patch changes return type to EMEDUIMTYPE in function,
> dasd_eer_enable
>> for when checking if the medium has no errors according to this
> function.
>>
>> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
>> ---
>>  drivers/s390/block/dasd_eer.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/s390/block/dasd_eer.c
> b/drivers/s390/block/dasd_eer.c
>> index 21ef63c..08ee040 100644
>> --- a/drivers/s390/block/dasd_eer.c
>> +++ b/drivers/s390/block/dasd_eer.c
>> @@ -462,7 +462,7 @@ int dasd_eer_enable(struct dasd_device *device)
>>        return 0;
>>
>>     if (!device->discipline || strcmp(device->discipline->name, "ECKD"))
>> -      return -EPERM;   /* FIXME: -EMEDIUMTYPE ? */
>> +      return -EMEDIUMTYPE;   /* FIXME: -EMEDIUMTYPE ? */
>>
>>     cqr = dasd_kmalloc_request(DASD_ECKD_MAGIC, 1 /* SNSS */,
>>                 SNSS_DATA_SIZE, device);
>> --
>> 1.9.1
>>
>
> Hm, after some consideration, I have to disagree with your suggestion.
> If you try to enable EER on an FBA device, you will get the following
> result with current code:
>
> $ echo 1 > eer_enabled
> -bash: echo: write error: Operation not permitted
>
> and with your code the following:
>
> $ echo 1 > eer_enabled
> -bash: echo: write error: Wrong medium type
>
> When I wrote this code, I was not sure which one is better. But today I
> say
> that the 'Operation not permitted' is more to the point. An FBA device
> has no (changable) medium, so what could be wrong about its type?
> Could be confusing.
>
> From your patch description I do not really get why you want to change the
> return code. Why do you think that EMEDIUMTYPE is better than EPERM?
>
> Mit freundlichen Grüßen / Kind regards
>
> Stefan Weinhuber
>
Stefan,
>From my reading seemed more like EMEDUIMTYPE return but seems I was
wrong here. If you want I can remove the fix me message in a patch if you
want to keep this return type.
Regards Nick

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

end of thread, other threads:[~2014-07-28 16:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-22  6:29 [PATCH] s390: Fix me in dasd_eer.c Nicholas Krause
2014-07-23 12:18 ` One Thousand Gnomes
2014-07-23 15:41   ` Nick Krause
2014-07-28 16:02 ` Stefan Weinhuber
2014-07-28 16:06   ` Nick Krause

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).