public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IPMI: return correct value from ipmi_write
@ 2008-07-10 19:27 Mark Rustad
  2008-07-10 20:16 ` [Openipmi-developer] " Corey Minyard
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Rustad @ 2008-07-10 19:27 UTC (permalink / raw)
  To: openipmi-developer; +Cc: linux-kernel, wim

From: Mark Rustad <MRustad@gmail.com>

This patch corrects the handling of write operations to the IPMI watchdog
to work as intended by returning the number of characters actually
processed. Without this patch, an "echo V >/dev/watchdog" enables the
watchdog if IPMI is providing the watchdog function.

Signed-off-by: Mark Rustad <MRustad@gmail.com>
---
I have not checked all of the watchdogs to see if there are others that have
this problem, but the one I was using before using the IPMI one did work
right. It was also a big surprise how much the default watchdog timeout
varies from one to another. Let me tell you that the 10 second default
for the IPMI watchdog was a real sore spot while tracking this problem down!
This problem goes back at least as far as 2.6.20, but I generated this patch
based on 2.6.26-rc9. I have applied, compiled and tested this fix.

 drivers/char/ipmi/ipmi_watchdog.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/char/ipmi/ipmi_watchdog.c	2008-07-10 09:31:52.000000000 -0500
+++ b/drivers/char/ipmi/ipmi_watchdog.c	2008-07-10 09:33:41.000000000 -0500
@@ -755,9 +755,8 @@ static ssize_t ipmi_write(struct file *f
 		rv = ipmi_heartbeat();
 		if (rv)
 			return rv;
-		return 1;
 	}
-	return 0;
+	return len;
 }
 
 static ssize_t ipmi_read(struct file *file,

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

* Re: [Openipmi-developer] [PATCH] IPMI: return correct value from ipmi_write
  2008-07-10 19:27 [PATCH] IPMI: return correct value from ipmi_write Mark Rustad
@ 2008-07-10 20:16 ` Corey Minyard
  2008-07-11 11:58   ` Wim Van Sebroeck
  0 siblings, 1 reply; 3+ messages in thread
From: Corey Minyard @ 2008-07-10 20:16 UTC (permalink / raw)
  To: Mark Rustad; +Cc: openipmi-developer, wim, linux-kernel, Andrew Morton

This patch is correct.

Signed-off-by: Corey Minyard <cminyard@mvista.com>

Mark Rustad wrote:
> From: Mark Rustad <MRustad@gmail.com>
>
> This patch corrects the handling of write operations to the IPMI watchdog
> to work as intended by returning the number of characters actually
> processed. Without this patch, an "echo V >/dev/watchdog" enables the
> watchdog if IPMI is providing the watchdog function.
>
> Signed-off-by: Mark Rustad <MRustad@gmail.com>
> ---
> I have not checked all of the watchdogs to see if there are others that have
> this problem, but the one I was using before using the IPMI one did work
> right. It was also a big surprise how much the default watchdog timeout
> varies from one to another. Let me tell you that the 10 second default
> for the IPMI watchdog was a real sore spot while tracking this problem down!
> This problem goes back at least as far as 2.6.20, but I generated this patch
> based on 2.6.26-rc9. I have applied, compiled and tested this fix.
>
>  drivers/char/ipmi/ipmi_watchdog.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> --- a/drivers/char/ipmi/ipmi_watchdog.c	2008-07-10 09:31:52.000000000 -0500
> +++ b/drivers/char/ipmi/ipmi_watchdog.c	2008-07-10 09:33:41.000000000 -0500
> @@ -755,9 +755,8 @@ static ssize_t ipmi_write(struct file *f
>  		rv = ipmi_heartbeat();
>  		if (rv)
>  			return rv;
> -		return 1;
>  	}
> -	return 0;
> +	return len;
>  }
>  
>  static ssize_t ipmi_read(struct file *file,
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Openipmi-developer mailing list
> Openipmi-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openipmi-developer
>   


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

* Re: [Openipmi-developer] [PATCH] IPMI: return correct value from ipmi_write
  2008-07-10 20:16 ` [Openipmi-developer] " Corey Minyard
@ 2008-07-11 11:58   ` Wim Van Sebroeck
  0 siblings, 0 replies; 3+ messages in thread
From: Wim Van Sebroeck @ 2008-07-11 11:58 UTC (permalink / raw)
  To: Corey Minyard
  Cc: Mark Rustad, openipmi-developer, linux-kernel, Andrew Morton

Hi All,

> This patch is correct.
> 
> Signed-off-by: Corey Minyard <cminyard@mvista.com>
> 
> Mark Rustad wrote:
> >From: Mark Rustad <MRustad@gmail.com>
> >
> >This patch corrects the handling of write operations to the IPMI watchdog
> >to work as intended by returning the number of characters actually
> >processed. Without this patch, an "echo V >/dev/watchdog" enables the
> >watchdog if IPMI is providing the watchdog function.
> >
> >Signed-off-by: Mark Rustad <MRustad@gmail.com>

I'll add this to he linux-2.6-watchdog tree this evening so that Linus can pull.

Greetings,
Wim.


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

end of thread, other threads:[~2008-07-11 11:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-10 19:27 [PATCH] IPMI: return correct value from ipmi_write Mark Rustad
2008-07-10 20:16 ` [Openipmi-developer] " Corey Minyard
2008-07-11 11:58   ` Wim Van Sebroeck

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