watchdog inconsistency.
Hello,
There is inconsistency in fops->write() implementation in different watchdog drivers.
Some of them return number of bytes written while others return 1.
I think the correct implementation should always return number of bytes written (we examine all the buffer after all) otherwise "echo V > /dev/watchdog" doesn't work as expected (it doesn't stop watchdog).
The included patch fix watchdog drivers in linux-2.6.0-test9 (patch is trivial but isn't tested).
drivers/char/watchdog/i810-tco.c +1 -2
@@ -232,9 +232,8 @@/* someone wrote to us, we should reload the timer */ tco_timer_reload (); -return 1 ; } -return 0 ; +return len; } static int i810tco_ioctl (struct inode *inode, struct file *file,
drivers/char/watchdog/ib700wdt.c +1 -2
@@ -161,9 +161,8 @@ } }ibwdt_ping (); -return 1 ; } -return 0 ; +return count; } static int
drivers/char/watchdog/indydog.c +1 -2
@@ -113,9 +113,8 @@ } }indydog_ping (); -return 1 ; } -return 0 ; +return len; } static int indydog_ioctl(struct inode *inode, struct file *file,
drivers/char/watchdog/machzwd.c +1 -2
@@ -343,10 +343,9 @@ next_heartbeat = jiffies +ZF_USER_TIMEO ;dprintk ("user ping at %ld\n" , jiffies); -return 1 ; } -return 0 ; +return count; } static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
drivers/char/watchdog/mixcomwd.c +1 -2
@@ -156,9 +156,8 @@ } }mixcomwd_ping (); -return 1 ; } -return 0 ; +return len; } static int mixcomwd_ioctl(struct inode *inode, struct file *file,
drivers/char/watchdog/pcwd.c +1 -2
@@ -419,9 +419,8 @@ } }pcwd_send_heartbeat (); -return 1 ; } -return 0 ; +return len; }static int pcwd_open (struct inode *ino,struct file *filep)
drivers/char/watchdog/sa1100_wdt.c +1 -1
@@ -106,7 +106,7 @@OSMR3 =OSCR + pre_margin; } -return len ?1 :0 ; +return len; }static struct watchdog_info ident = {
drivers/char/watchdog/softdog.c +1 -2
@@ -155,9 +155,8 @@ } }mod_timer (&watchdog_ticktock, jiffies+(soft_margin*HZ )); -return 1 ; } -return 0 ; +return len; } static int softdog_ioctl(struct inode *inode, struct file *file,
drivers/char/watchdog/wdt.c +1 -2
@@ -265,9 +265,8 @@ } }wdt_ping (); -return 1 ; } -return 0 ; +return count; }/**
--
Gleb.