Re: schedule_timeout: wrong timeout value fffffffffffffff0

2013-01-03 Thread Andrew Morton
On Wed, 2 Jan 2013 10:27:27 -0500
Dave Jones  wrote:

> This happened to a box I left running fuzz tests over the holidays.
> 
> 
> schedule_timeout: wrong timeout value fff0
> Pid: 6606, comm: trinity-child1 Not tainted 3.8.0-rc1+ #43
> Call Trace:
>  [] schedule_timeout+0x305/0x340
>  [] ? preempt_schedule+0x42/0x60
>  [] ? _raw_spin_unlock_irqrestore+0x75/0x80
>  [] audit_log_start+0x311/0x470
>  [] ? __rcu_read_unlock+0x5c/0xa0
>  [] ? try_to_wake_up+0x320/0x320
>  [] audit_log_exit+0x4b/0xfb0
>  [] ? vm_mmap_pgoff+0x8b/0xb0
>  [] ? get_lock_stats+0x22/0x70
>  [] ? put_lock_stats.isra.23+0xe/0x40
>  [] ? lock_release_holdtime.part.24+0xcb/0x130
>  [] ? up_write+0x23/0x40
>  [] ? vm_mmap_pgoff+0x8b/0xb0
>  [] ? sysret_signal+0x5/0x47
>  [] __audit_syscall_exit+0x25f/0x2c0
>  [] sysret_audit+0x17/0x21
> 

ooh, I can fix that.  Please review.

From: Andrew Morton 
Subject: kernel/audit.c: avoid negative sleep durations

audit_log_start() performs the same jiffies comparison in two places.  If
sufficient time has elapsed between the two comparisons, the second one
produces a negative sleep duration:

schedule_timeout: wrong timeout value fff0
Pid: 6606, comm: trinity-child1 Not tainted 3.8.0-rc1+ #43
Call Trace:
 [] schedule_timeout+0x305/0x340
 [] ? preempt_schedule+0x42/0x60
 [] ? _raw_spin_unlock_irqrestore+0x75/0x80
 [] audit_log_start+0x311/0x470
 [] ? __rcu_read_unlock+0x5c/0xa0
 [] ? try_to_wake_up+0x320/0x320
 [] audit_log_exit+0x4b/0xfb0
 [] ? vm_mmap_pgoff+0x8b/0xb0
 [] ? get_lock_stats+0x22/0x70
 [] ? put_lock_stats.isra.23+0xe/0x40
 [] ? lock_release_holdtime.part.24+0xcb/0x130
 [] ? up_write+0x23/0x40
 [] ? vm_mmap_pgoff+0x8b/0xb0
 [] ? sysret_signal+0x5/0x47
 [] __audit_syscall_exit+0x25f/0x2c0
 [] sysret_audit+0x17/0x21

Fix it by performing the comparison a single time.

Reported-by: Dave Jones 
Cc: Al Viro 
Cc: Eric Paris 
Signed-off-by: Andrew Morton 
---

 kernel/audit.c |   36 +++-
 1 file changed, 23 insertions(+), 13 deletions(-)

diff -puN kernel/audit.c~a kernel/audit.c
--- a/kernel/audit.c~a
+++ a/kernel/audit.c
@@ -1101,6 +1101,23 @@ static inline void audit_get_stamp(struc
}
 }
 
+/*
+ * Wait for auditd to drain the queue a little
+ */
+static void wait_for_auditd(unsigned long sleep_time)
+{
+   DECLARE_WAITQUEUE(wait, current);
+   set_current_state(TASK_INTERRUPTIBLE);
+   add_wait_queue(_backlog_wait, );
+
+   if (audit_backlog_limit &&
+   skb_queue_len(_skb_queue) > audit_backlog_limit)
+   schedule_timeout(sleep_time);
+
+   __set_current_state(TASK_RUNNING);
+   remove_wait_queue(_backlog_wait, );
+}
+
 /* Obtain an audit buffer.  This routine does locking to obtain the
  * audit buffer, but then no locking is required for calls to
  * audit_log_*format.  If the tsk is a task that is currently in a
@@ -1146,20 +1163,13 @@ struct audit_buffer *audit_log_start(str
 
while (audit_backlog_limit
   && skb_queue_len(_skb_queue) > audit_backlog_limit + 
reserve) {
-   if (gfp_mask & __GFP_WAIT && audit_backlog_wait_time
-   && time_before(jiffies, timeout_start + 
audit_backlog_wait_time)) {
-
-   /* Wait for auditd to drain the queue a little */
-   DECLARE_WAITQUEUE(wait, current);
-   set_current_state(TASK_INTERRUPTIBLE);
-   add_wait_queue(_backlog_wait, );
-
-   if (audit_backlog_limit &&
-   skb_queue_len(_skb_queue) > 
audit_backlog_limit)
-   schedule_timeout(timeout_start + 
audit_backlog_wait_time - jiffies);
+   if (gfp_mask & __GFP_WAIT && audit_backlog_wait_time) {
+   unsigned long sleep_time;
 
-   __set_current_state(TASK_RUNNING);
-   remove_wait_queue(_backlog_wait, );
+   sleep_time = timeout_start + audit_backlog_wait_time -
+   jiffies;
+   if ((long)sleep_time > 0)
+   wait_for_auditd(sleep_time);
continue;
}
if (audit_rate_check() && printk_ratelimit())
_

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: schedule_timeout: wrong timeout value fffffffffffffff0

2013-01-03 Thread Andrew Morton
On Wed, 2 Jan 2013 10:27:27 -0500
Dave Jones da...@redhat.com wrote:

 This happened to a box I left running fuzz tests over the holidays.
 
 
 schedule_timeout: wrong timeout value fff0
 Pid: 6606, comm: trinity-child1 Not tainted 3.8.0-rc1+ #43
 Call Trace:
  [81698415] schedule_timeout+0x305/0x340
  [8169ae82] ? preempt_schedule+0x42/0x60
  [8169cb65] ? _raw_spin_unlock_irqrestore+0x75/0x80
  [810dc461] audit_log_start+0x311/0x470
  [8106c62c] ? __rcu_read_unlock+0x5c/0xa0
  [81086120] ? try_to_wake_up+0x320/0x320
  [810e0d0b] audit_log_exit+0x4b/0xfb0
  [81156e1b] ? vm_mmap_pgoff+0x8b/0xb0
  [810b2342] ? get_lock_stats+0x22/0x70
  [810b27ae] ? put_lock_stats.isra.23+0xe/0x40
  [810b2ecb] ? lock_release_holdtime.part.24+0xcb/0x130
  [81075f93] ? up_write+0x23/0x40
  [81156e1b] ? vm_mmap_pgoff+0x8b/0xb0
  [816a4afc] ? sysret_signal+0x5/0x47
  [810e3d3f] __audit_syscall_exit+0x25f/0x2c0
  [816a4bad] sysret_audit+0x17/0x21
 

ooh, I can fix that.  Please review.

From: Andrew Morton a...@linux-foundation.org
Subject: kernel/audit.c: avoid negative sleep durations

audit_log_start() performs the same jiffies comparison in two places.  If
sufficient time has elapsed between the two comparisons, the second one
produces a negative sleep duration:

schedule_timeout: wrong timeout value fff0
Pid: 6606, comm: trinity-child1 Not tainted 3.8.0-rc1+ #43
Call Trace:
 [81698415] schedule_timeout+0x305/0x340
 [8169ae82] ? preempt_schedule+0x42/0x60
 [8169cb65] ? _raw_spin_unlock_irqrestore+0x75/0x80
 [810dc461] audit_log_start+0x311/0x470
 [8106c62c] ? __rcu_read_unlock+0x5c/0xa0
 [81086120] ? try_to_wake_up+0x320/0x320
 [810e0d0b] audit_log_exit+0x4b/0xfb0
 [81156e1b] ? vm_mmap_pgoff+0x8b/0xb0
 [810b2342] ? get_lock_stats+0x22/0x70
 [810b27ae] ? put_lock_stats.isra.23+0xe/0x40
 [810b2ecb] ? lock_release_holdtime.part.24+0xcb/0x130
 [81075f93] ? up_write+0x23/0x40
 [81156e1b] ? vm_mmap_pgoff+0x8b/0xb0
 [816a4afc] ? sysret_signal+0x5/0x47
 [810e3d3f] __audit_syscall_exit+0x25f/0x2c0
 [816a4bad] sysret_audit+0x17/0x21

Fix it by performing the comparison a single time.

Reported-by: Dave Jones da...@redhat.com
Cc: Al Viro v...@zeniv.linux.org.uk
Cc: Eric Paris epa...@redhat.com
Signed-off-by: Andrew Morton a...@linux-foundation.org
---

 kernel/audit.c |   36 +++-
 1 file changed, 23 insertions(+), 13 deletions(-)

diff -puN kernel/audit.c~a kernel/audit.c
--- a/kernel/audit.c~a
+++ a/kernel/audit.c
@@ -1101,6 +1101,23 @@ static inline void audit_get_stamp(struc
}
 }
 
+/*
+ * Wait for auditd to drain the queue a little
+ */
+static void wait_for_auditd(unsigned long sleep_time)
+{
+   DECLARE_WAITQUEUE(wait, current);
+   set_current_state(TASK_INTERRUPTIBLE);
+   add_wait_queue(audit_backlog_wait, wait);
+
+   if (audit_backlog_limit 
+   skb_queue_len(audit_skb_queue)  audit_backlog_limit)
+   schedule_timeout(sleep_time);
+
+   __set_current_state(TASK_RUNNING);
+   remove_wait_queue(audit_backlog_wait, wait);
+}
+
 /* Obtain an audit buffer.  This routine does locking to obtain the
  * audit buffer, but then no locking is required for calls to
  * audit_log_*format.  If the tsk is a task that is currently in a
@@ -1146,20 +1163,13 @@ struct audit_buffer *audit_log_start(str
 
while (audit_backlog_limit
skb_queue_len(audit_skb_queue)  audit_backlog_limit + 
reserve) {
-   if (gfp_mask  __GFP_WAIT  audit_backlog_wait_time
-time_before(jiffies, timeout_start + 
audit_backlog_wait_time)) {
-
-   /* Wait for auditd to drain the queue a little */
-   DECLARE_WAITQUEUE(wait, current);
-   set_current_state(TASK_INTERRUPTIBLE);
-   add_wait_queue(audit_backlog_wait, wait);
-
-   if (audit_backlog_limit 
-   skb_queue_len(audit_skb_queue)  
audit_backlog_limit)
-   schedule_timeout(timeout_start + 
audit_backlog_wait_time - jiffies);
+   if (gfp_mask  __GFP_WAIT  audit_backlog_wait_time) {
+   unsigned long sleep_time;
 
-   __set_current_state(TASK_RUNNING);
-   remove_wait_queue(audit_backlog_wait, wait);
+   sleep_time = timeout_start + audit_backlog_wait_time -
+   jiffies;
+   if ((long)sleep_time  0)
+   wait_for_auditd(sleep_time);
continue;
}
if (audit_rate_check()  printk_ratelimit())
_

--
To unsubscribe from this list: send

schedule_timeout: wrong timeout value fffffffffffffff0

2013-01-02 Thread Dave Jones
This happened to a box I left running fuzz tests over the holidays.


schedule_timeout: wrong timeout value fff0
Pid: 6606, comm: trinity-child1 Not tainted 3.8.0-rc1+ #43
Call Trace:
 [] schedule_timeout+0x305/0x340
 [] ? preempt_schedule+0x42/0x60
 [] ? _raw_spin_unlock_irqrestore+0x75/0x80
 [] audit_log_start+0x311/0x470
 [] ? __rcu_read_unlock+0x5c/0xa0
 [] ? try_to_wake_up+0x320/0x320
 [] audit_log_exit+0x4b/0xfb0
 [] ? vm_mmap_pgoff+0x8b/0xb0
 [] ? get_lock_stats+0x22/0x70
 [] ? put_lock_stats.isra.23+0xe/0x40
 [] ? lock_release_holdtime.part.24+0xcb/0x130
 [] ? up_write+0x23/0x40
 [] ? vm_mmap_pgoff+0x8b/0xb0
 [] ? sysret_signal+0x5/0x47
 [] __audit_syscall_exit+0x25f/0x2c0
 [] sysret_audit+0x17/0x21

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


schedule_timeout: wrong timeout value fffffffffffffff0

2013-01-02 Thread Dave Jones
This happened to a box I left running fuzz tests over the holidays.


schedule_timeout: wrong timeout value fff0
Pid: 6606, comm: trinity-child1 Not tainted 3.8.0-rc1+ #43
Call Trace:
 [81698415] schedule_timeout+0x305/0x340
 [8169ae82] ? preempt_schedule+0x42/0x60
 [8169cb65] ? _raw_spin_unlock_irqrestore+0x75/0x80
 [810dc461] audit_log_start+0x311/0x470
 [8106c62c] ? __rcu_read_unlock+0x5c/0xa0
 [81086120] ? try_to_wake_up+0x320/0x320
 [810e0d0b] audit_log_exit+0x4b/0xfb0
 [81156e1b] ? vm_mmap_pgoff+0x8b/0xb0
 [810b2342] ? get_lock_stats+0x22/0x70
 [810b27ae] ? put_lock_stats.isra.23+0xe/0x40
 [810b2ecb] ? lock_release_holdtime.part.24+0xcb/0x130
 [81075f93] ? up_write+0x23/0x40
 [81156e1b] ? vm_mmap_pgoff+0x8b/0xb0
 [816a4afc] ? sysret_signal+0x5/0x47
 [810e3d3f] __audit_syscall_exit+0x25f/0x2c0
 [816a4bad] sysret_audit+0x17/0x21

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [linux-usb-devel] [usb-storage] schedule_timeout: wrong timeout value c1a95554

2007-08-09 Thread Rafael J. Wysocki
On Thursday, 9 August 2007 17:20, Mariusz Kozlowski wrote:
> > > > Happens every time I reattach usb pen drive.
> > > > 
> > > > usb 1-2: new high speed USB device using ehci_hcd and address 10
> > > > usb 1-2: configuration #1 chosen from 1 choice
> > > > scsi6 : SCSI emulation for USB Mass Storage devices
> > > > usb 1-2: new device found, idVendor=13fe, idProduct=1a00
> > > > usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=0
> > > > usb 1-2: Product: GEIL USB DISK   
> > > > usb 1-2: Manufacturer: 
> > > > usb-storage: device found at 10
> > > > usb-storage: waiting for device to settle before scanning
> > > > schedule_timeout: wrong timeout value c1a95554
> > > >  [] show_trace_log_lvl+0x1a/0x30
> > > >  [] show_trace+0x12/0x14
> > > >  [] dump_stack+0x15/0x17
> > > >  [] schedule_timeout+0x8c/0xa2
> > > >  [] usb_stor_scan_thread+0x100/0x160
> > > >  [] kthread+0x36/0x58
> > > >  [] kernel_thread_helper+0x7/0x14
> > > >  ===
> > > > scsi 6:0:0:0: Direct-Access  GEIL USB DISK>2.0 PQ: 0 
> > > > ANSI: 0 CCS
> > > > sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
> > > > sd 6:0:0:0: [sda] Write Protect is off
> > > > sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
> > > > sd 6:0:0:0: [sda] Assuming drive cache: write through
> > > > sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
> > > > sd 6:0:0:0: [sda] Write Protect is off
> > > > sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
> > > > sd 6:0:0:0: [sda] Assuming drive cache: write through
> > > >  sda: sda1
> > > > sd 6:0:0:0: [sda] Attached SCSI removable disk
> > > > sd 6:0:0:0: Attached scsi generic sg0 type 0
> > > > usb-storage: device scan complete
> > > 
> > > This is a known problem.  See
> > > 
> > >   http://marc.info/?l=linux-kernel=118641424414399=2
> > > 
> > > Rafael, has this been fixed yet?
> > 
> > No, I wasn't aware of it.
> > 
> > I think that something like the appended patch is necessary.
> > 
> > Mariusz, please see if that helps.
> 
> Yes - this patch fixes the bug.

OK, thanks for the confirmation.

Here it goes again with a changelog etc.

---
From: Rafael J. Wysocki <[EMAIL PROTECTED]>

Fix a bug in freezer-introduce-freezer-firendly-waiting-macros.patch which
uses a wrong variable name in wait_event_freezable() and
wait_event_freezable_timeout() (this name is also used in 
wait_event_interruptible() and wait_event_interruptible_timeout() which are
macros and the names clash).

Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
---
 include/linux/freezer.h |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

Index: linux-2.6.23-rc2/include/linux/freezer.h
===
--- linux-2.6.23-rc2.orig/include/linux/freezer.h
+++ linux-2.6.23-rc2/include/linux/freezer.h
@@ -134,28 +134,28 @@ static inline void set_freezable(void)
 
 #define wait_event_freezable(wq, condition)\
 ({ \
-   int __ret;  \
+   int __retval;   \
do {\
-   __ret = wait_event_interruptible(wq,\
+   __retval = wait_event_interruptible(wq, \
(condition) || freezing(current));  \
-   if (__ret && !freezing(current))\
+   if (__retval && !freezing(current)) \
break;  \
else if (!(condition))  \
-   __ret = -ERESTARTSYS;   \
+   __retval = -ERESTARTSYS;\
} while (try_to_freeze());  \
-   __ret;  \
+   __retval;   \
 })
 
 
 #define wait_event_freezable_timeout(wq, condition, timeout)   \
 ({ \
-   long __ret = timeout;   \
+   long 

Re: [linux-usb-devel] [usb-storage] schedule_timeout: wrong timeout value c1a95554

2007-08-09 Thread Mariusz Kozlowski
> > >   Happens every time I reattach usb pen drive.
> > > 
> > > usb 1-2: new high speed USB device using ehci_hcd and address 10
> > > usb 1-2: configuration #1 chosen from 1 choice
> > > scsi6 : SCSI emulation for USB Mass Storage devices
> > > usb 1-2: new device found, idVendor=13fe, idProduct=1a00
> > > usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=0
> > > usb 1-2: Product: GEIL USB DISK   
> > > usb 1-2: Manufacturer: 
> > > usb-storage: device found at 10
> > > usb-storage: waiting for device to settle before scanning
> > > schedule_timeout: wrong timeout value c1a95554
> > >  [] show_trace_log_lvl+0x1a/0x30
> > >  [] show_trace+0x12/0x14
> > >  [] dump_stack+0x15/0x17
> > >  [] schedule_timeout+0x8c/0xa2
> > >  [] usb_stor_scan_thread+0x100/0x160
> > >  [] kthread+0x36/0x58
> > >  [] kernel_thread_helper+0x7/0x14
> > >  ===
> > > scsi 6:0:0:0: Direct-Access  GEIL USB DISK>2.0 PQ: 0 
> > > ANSI: 0 CCS
> > > sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
> > > sd 6:0:0:0: [sda] Write Protect is off
> > > sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
> > > sd 6:0:0:0: [sda] Assuming drive cache: write through
> > > sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
> > > sd 6:0:0:0: [sda] Write Protect is off
> > > sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
> > > sd 6:0:0:0: [sda] Assuming drive cache: write through
> > >  sda: sda1
> > > sd 6:0:0:0: [sda] Attached SCSI removable disk
> > > sd 6:0:0:0: Attached scsi generic sg0 type 0
> > > usb-storage: device scan complete
> > 
> > This is a known problem.  See
> > 
> > http://marc.info/?l=linux-kernel=118641424414399=2
> > 
> > Rafael, has this been fixed yet?
> 
> No, I wasn't aware of it.
> 
> I think that something like the appended patch is necessary.
> 
> Mariusz, please see if that helps.

Yes - this patch fixes the bug.

Thanks,

Mariusz



> ---
>  include/linux/freezer.h |   18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> Index: linux-2.6.23-rc2/include/linux/freezer.h
> ===
> --- linux-2.6.23-rc2.orig/include/linux/freezer.h
> +++ linux-2.6.23-rc2/include/linux/freezer.h
> @@ -134,28 +134,28 @@ static inline void set_freezable(void)
>  
>  #define wait_event_freezable(wq, condition)  \
>  ({   \
> - int __ret;  \
> + int __retval;   \
>   do {\
> - __ret = wait_event_interruptible(wq,\
> + __retval = wait_event_interruptible(wq, \
>   (condition) || freezing(current));  \
> - if (__ret && !freezing(current))\
> + if (__retval && !freezing(current)) \
>   break;  \
>   else if (!(condition))  \
> - __ret = -ERESTARTSYS;   \
> + __retval = -ERESTARTSYS;\
>   } while (try_to_freeze());  \
> - __ret;  \
> + __retval;   \
>  })
>  
>  
>  #define wait_event_freezable_timeout(wq, condition, timeout) \
>  ({   \
> - long __ret = timeout;   \
> + long __retval = timeout;\
>   do {\
> - __ret = wait_event_interruptible_timeout(wq,\
> + __retval = wait_event_interruptible_timeout(wq, \
>   (condition) || freezing(current),   \
> - __ret); \
> + __retval);  \
>   } while (try_to_freeze());  \
> - __ret;  \
> + __retval;   \
>  })
>  #else /* !CONFIG_PM_SLEEP */
>  static inline int frozen(struct task_struct *p) { return 0; }
> 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [linux-usb-devel] [usb-storage] schedule_timeout: wrong timeout value c1a95554

2007-08-09 Thread Rafael J. Wysocki
On Thursday, 9 August 2007 16:43, Alan Stern wrote:
> On Thu, 9 Aug 2007, Mariusz Kozlowski wrote:
> 
> > Hello,
> > 
> > Happens every time I reattach usb pen drive.
> > 
> > usb 1-2: new high speed USB device using ehci_hcd and address 10
> > usb 1-2: configuration #1 chosen from 1 choice
> > scsi6 : SCSI emulation for USB Mass Storage devices
> > usb 1-2: new device found, idVendor=13fe, idProduct=1a00
> > usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=0
> > usb 1-2: Product: GEIL USB DISK   
> > usb 1-2: Manufacturer: 
> > usb-storage: device found at 10
> > usb-storage: waiting for device to settle before scanning
> > schedule_timeout: wrong timeout value c1a95554
> >  [] show_trace_log_lvl+0x1a/0x30
> >  [] show_trace+0x12/0x14
> >  [] dump_stack+0x15/0x17
> >  [] schedule_timeout+0x8c/0xa2
> >  [] usb_stor_scan_thread+0x100/0x160
> >  [] kthread+0x36/0x58
> >  [] kernel_thread_helper+0x7/0x14
> >  ===
> > scsi 6:0:0:0: Direct-Access  GEIL USB DISK>2.0 PQ: 0 ANSI: 
> > 0 CCS
> > sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
> > sd 6:0:0:0: [sda] Write Protect is off
> > sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
> > sd 6:0:0:0: [sda] Assuming drive cache: write through
> > sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
> > sd 6:0:0:0: [sda] Write Protect is off
> > sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
> > sd 6:0:0:0: [sda] Assuming drive cache: write through
> >  sda: sda1
> > sd 6:0:0:0: [sda] Attached SCSI removable disk
> > sd 6:0:0:0: Attached scsi generic sg0 type 0
> > usb-storage: device scan complete
> 
> This is a known problem.  See
> 
>   http://marc.info/?l=linux-kernel=118641424414399=2
> 
> Rafael, has this been fixed yet?

No, I wasn't aware of it.

I think that something like the appended patch is necessary.

Mariusz, please see if that helps.

Greetings,
Rafael


---
 include/linux/freezer.h |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

Index: linux-2.6.23-rc2/include/linux/freezer.h
===
--- linux-2.6.23-rc2.orig/include/linux/freezer.h
+++ linux-2.6.23-rc2/include/linux/freezer.h
@@ -134,28 +134,28 @@ static inline void set_freezable(void)
 
 #define wait_event_freezable(wq, condition)\
 ({ \
-   int __ret;  \
+   int __retval;   \
do {\
-   __ret = wait_event_interruptible(wq,\
+   __retval = wait_event_interruptible(wq, \
(condition) || freezing(current));  \
-   if (__ret && !freezing(current))\
+   if (__retval && !freezing(current)) \
break;  \
else if (!(condition))  \
-   __ret = -ERESTARTSYS;   \
+   __retval = -ERESTARTSYS;\
} while (try_to_freeze());  \
-   __ret;  \
+   __retval;   \
 })
 
 
 #define wait_event_freezable_timeout(wq, condition, timeout)   \
 ({ \
-   long __ret = timeout;   \
+   long __retval = timeout;\
do {\
-   __ret = wait_event_interruptible_timeout(wq,\
+   __retval = wait_event_interruptible_timeout(wq, \
(condition) || freezing(current),   \
-   __ret); \
+   __retval);  \
} while (try_to_freeze());  \
-   __ret;  \
+   __retval;   \
 })
 #else /* !CONFIG_PM_SLEEP */
 static inline int frozen(struct task_struct *p) { return 0; }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [linux-usb-devel] [usb-storage] schedule_timeout: wrong timeout value c1a95554

2007-08-09 Thread Alan Stern
On Thu, 9 Aug 2007, Mariusz Kozlowski wrote:

> Hello,
> 
>   Happens every time I reattach usb pen drive.
> 
> usb 1-2: new high speed USB device using ehci_hcd and address 10
> usb 1-2: configuration #1 chosen from 1 choice
> scsi6 : SCSI emulation for USB Mass Storage devices
> usb 1-2: new device found, idVendor=13fe, idProduct=1a00
> usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=0
> usb 1-2: Product: GEIL USB DISK   
> usb 1-2: Manufacturer: 
> usb-storage: device found at 10
> usb-storage: waiting for device to settle before scanning
> schedule_timeout: wrong timeout value c1a95554
>  [] show_trace_log_lvl+0x1a/0x30
>  [] show_trace+0x12/0x14
>  [] dump_stack+0x15/0x17
>  [] schedule_timeout+0x8c/0xa2
>  [] usb_stor_scan_thread+0x100/0x160
>  [] kthread+0x36/0x58
>  [] kernel_thread_helper+0x7/0x14
>  ===
> scsi 6:0:0:0: Direct-Access  GEIL USB DISK>2.0 PQ: 0 ANSI: 0 
> CCS
> sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
> sd 6:0:0:0: [sda] Write Protect is off
> sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
> sd 6:0:0:0: [sda] Assuming drive cache: write through
> sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
> sd 6:0:0:0: [sda] Write Protect is off
> sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
> sd 6:0:0:0: [sda] Assuming drive cache: write through
>  sda: sda1
> sd 6:0:0:0: [sda] Attached SCSI removable disk
> sd 6:0:0:0: Attached scsi generic sg0 type 0
> usb-storage: device scan complete

This is a known problem.  See

http://marc.info/?l=linux-kernel=118641424414399=2

Rafael, has this been fixed yet?

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[usb-storage] schedule_timeout: wrong timeout value c1a95554

2007-08-09 Thread Mariusz Kozlowski
Hello,

Happens every time I reattach usb pen drive.

usb 1-2: new high speed USB device using ehci_hcd and address 10
usb 1-2: configuration #1 chosen from 1 choice
scsi6 : SCSI emulation for USB Mass Storage devices
usb 1-2: new device found, idVendor=13fe, idProduct=1a00
usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2: Product: GEIL USB DISK   
usb 1-2: Manufacturer: 
usb-storage: device found at 10
usb-storage: waiting for device to settle before scanning
schedule_timeout: wrong timeout value c1a95554
 [] show_trace_log_lvl+0x1a/0x30
 [] show_trace+0x12/0x14
 [] dump_stack+0x15/0x17
 [] schedule_timeout+0x8c/0xa2
 [] usb_stor_scan_thread+0x100/0x160
 [] kthread+0x36/0x58
 [] kernel_thread_helper+0x7/0x14
 ===
scsi 6:0:0:0: Direct-Access  GEIL USB DISK>2.0 PQ: 0 ANSI: 0 CCS
sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
sd 6:0:0:0: [sda] Write Protect is off
sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
sd 6:0:0:0: [sda] Assuming drive cache: write through
sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
sd 6:0:0:0: [sda] Write Protect is off
sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
sd 6:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 6:0:0:0: [sda] Attached SCSI removable disk
sd 6:0:0:0: Attached scsi generic sg0 type 0
usb-storage: device scan complete

Regards,

Mariusz

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[usb-storage] schedule_timeout: wrong timeout value c1a95554

2007-08-09 Thread Mariusz Kozlowski
Hello,

Happens every time I reattach usb pen drive.

usb 1-2: new high speed USB device using ehci_hcd and address 10
usb 1-2: configuration #1 chosen from 1 choice
scsi6 : SCSI emulation for USB Mass Storage devices
usb 1-2: new device found, idVendor=13fe, idProduct=1a00
usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2: Product: GEIL USB DISK   
usb 1-2: Manufacturer: 
usb-storage: device found at 10
usb-storage: waiting for device to settle before scanning
schedule_timeout: wrong timeout value c1a95554
 [c010456a] show_trace_log_lvl+0x1a/0x30
 [c010508d] show_trace+0x12/0x14
 [c01051e0] dump_stack+0x15/0x17
 [c04174d1] schedule_timeout+0x8c/0xa2
 [c032aeec] usb_stor_scan_thread+0x100/0x160
 [c0127f2e] kthread+0x36/0x58
 [c0104233] kernel_thread_helper+0x7/0x14
 ===
scsi 6:0:0:0: Direct-Access  GEIL USB DISK2.0 PQ: 0 ANSI: 0 CCS
sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
sd 6:0:0:0: [sda] Write Protect is off
sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
sd 6:0:0:0: [sda] Assuming drive cache: write through
sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
sd 6:0:0:0: [sda] Write Protect is off
sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
sd 6:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 6:0:0:0: [sda] Attached SCSI removable disk
sd 6:0:0:0: Attached scsi generic sg0 type 0
usb-storage: device scan complete

Regards,

Mariusz

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [linux-usb-devel] [usb-storage] schedule_timeout: wrong timeout value c1a95554

2007-08-09 Thread Alan Stern
On Thu, 9 Aug 2007, Mariusz Kozlowski wrote:

 Hello,
 
   Happens every time I reattach usb pen drive.
 
 usb 1-2: new high speed USB device using ehci_hcd and address 10
 usb 1-2: configuration #1 chosen from 1 choice
 scsi6 : SCSI emulation for USB Mass Storage devices
 usb 1-2: new device found, idVendor=13fe, idProduct=1a00
 usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=0
 usb 1-2: Product: GEIL USB DISK   
 usb 1-2: Manufacturer: 
 usb-storage: device found at 10
 usb-storage: waiting for device to settle before scanning
 schedule_timeout: wrong timeout value c1a95554
  [c010456a] show_trace_log_lvl+0x1a/0x30
  [c010508d] show_trace+0x12/0x14
  [c01051e0] dump_stack+0x15/0x17
  [c04174d1] schedule_timeout+0x8c/0xa2
  [c032aeec] usb_stor_scan_thread+0x100/0x160
  [c0127f2e] kthread+0x36/0x58
  [c0104233] kernel_thread_helper+0x7/0x14
  ===
 scsi 6:0:0:0: Direct-Access  GEIL USB DISK2.0 PQ: 0 ANSI: 0 
 CCS
 sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
 sd 6:0:0:0: [sda] Write Protect is off
 sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
 sd 6:0:0:0: [sda] Assuming drive cache: write through
 sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
 sd 6:0:0:0: [sda] Write Protect is off
 sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
 sd 6:0:0:0: [sda] Assuming drive cache: write through
  sda: sda1
 sd 6:0:0:0: [sda] Attached SCSI removable disk
 sd 6:0:0:0: Attached scsi generic sg0 type 0
 usb-storage: device scan complete

This is a known problem.  See

http://marc.info/?l=linux-kernelm=118641424414399w=2

Rafael, has this been fixed yet?

Alan Stern

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [linux-usb-devel] [usb-storage] schedule_timeout: wrong timeout value c1a95554

2007-08-09 Thread Rafael J. Wysocki
On Thursday, 9 August 2007 16:43, Alan Stern wrote:
 On Thu, 9 Aug 2007, Mariusz Kozlowski wrote:
 
  Hello,
  
  Happens every time I reattach usb pen drive.
  
  usb 1-2: new high speed USB device using ehci_hcd and address 10
  usb 1-2: configuration #1 chosen from 1 choice
  scsi6 : SCSI emulation for USB Mass Storage devices
  usb 1-2: new device found, idVendor=13fe, idProduct=1a00
  usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=0
  usb 1-2: Product: GEIL USB DISK   
  usb 1-2: Manufacturer: 
  usb-storage: device found at 10
  usb-storage: waiting for device to settle before scanning
  schedule_timeout: wrong timeout value c1a95554
   [c010456a] show_trace_log_lvl+0x1a/0x30
   [c010508d] show_trace+0x12/0x14
   [c01051e0] dump_stack+0x15/0x17
   [c04174d1] schedule_timeout+0x8c/0xa2
   [c032aeec] usb_stor_scan_thread+0x100/0x160
   [c0127f2e] kthread+0x36/0x58
   [c0104233] kernel_thread_helper+0x7/0x14
   ===
  scsi 6:0:0:0: Direct-Access  GEIL USB DISK2.0 PQ: 0 ANSI: 
  0 CCS
  sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
  sd 6:0:0:0: [sda] Write Protect is off
  sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
  sd 6:0:0:0: [sda] Assuming drive cache: write through
  sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
  sd 6:0:0:0: [sda] Write Protect is off
  sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
  sd 6:0:0:0: [sda] Assuming drive cache: write through
   sda: sda1
  sd 6:0:0:0: [sda] Attached SCSI removable disk
  sd 6:0:0:0: Attached scsi generic sg0 type 0
  usb-storage: device scan complete
 
 This is a known problem.  See
 
   http://marc.info/?l=linux-kernelm=118641424414399w=2
 
 Rafael, has this been fixed yet?

No, I wasn't aware of it.

I think that something like the appended patch is necessary.

Mariusz, please see if that helps.

Greetings,
Rafael


---
 include/linux/freezer.h |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

Index: linux-2.6.23-rc2/include/linux/freezer.h
===
--- linux-2.6.23-rc2.orig/include/linux/freezer.h
+++ linux-2.6.23-rc2/include/linux/freezer.h
@@ -134,28 +134,28 @@ static inline void set_freezable(void)
 
 #define wait_event_freezable(wq, condition)\
 ({ \
-   int __ret;  \
+   int __retval;   \
do {\
-   __ret = wait_event_interruptible(wq,\
+   __retval = wait_event_interruptible(wq, \
(condition) || freezing(current));  \
-   if (__ret  !freezing(current))\
+   if (__retval  !freezing(current)) \
break;  \
else if (!(condition))  \
-   __ret = -ERESTARTSYS;   \
+   __retval = -ERESTARTSYS;\
} while (try_to_freeze());  \
-   __ret;  \
+   __retval;   \
 })
 
 
 #define wait_event_freezable_timeout(wq, condition, timeout)   \
 ({ \
-   long __ret = timeout;   \
+   long __retval = timeout;\
do {\
-   __ret = wait_event_interruptible_timeout(wq,\
+   __retval = wait_event_interruptible_timeout(wq, \
(condition) || freezing(current),   \
-   __ret); \
+   __retval);  \
} while (try_to_freeze());  \
-   __ret;  \
+   __retval;   \
 })
 #else /* !CONFIG_PM_SLEEP */
 static inline int frozen(struct task_struct *p) { return 0; }
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [linux-usb-devel] [usb-storage] schedule_timeout: wrong timeout value c1a95554

2007-08-09 Thread Mariusz Kozlowski
 Happens every time I reattach usb pen drive.
   
   usb 1-2: new high speed USB device using ehci_hcd and address 10
   usb 1-2: configuration #1 chosen from 1 choice
   scsi6 : SCSI emulation for USB Mass Storage devices
   usb 1-2: new device found, idVendor=13fe, idProduct=1a00
   usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=0
   usb 1-2: Product: GEIL USB DISK   
   usb 1-2: Manufacturer: 
   usb-storage: device found at 10
   usb-storage: waiting for device to settle before scanning
   schedule_timeout: wrong timeout value c1a95554
[c010456a] show_trace_log_lvl+0x1a/0x30
[c010508d] show_trace+0x12/0x14
[c01051e0] dump_stack+0x15/0x17
[c04174d1] schedule_timeout+0x8c/0xa2
[c032aeec] usb_stor_scan_thread+0x100/0x160
[c0127f2e] kthread+0x36/0x58
[c0104233] kernel_thread_helper+0x7/0x14
===
   scsi 6:0:0:0: Direct-Access  GEIL USB DISK2.0 PQ: 0 
   ANSI: 0 CCS
   sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
   sd 6:0:0:0: [sda] Write Protect is off
   sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
   sd 6:0:0:0: [sda] Assuming drive cache: write through
   sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
   sd 6:0:0:0: [sda] Write Protect is off
   sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
   sd 6:0:0:0: [sda] Assuming drive cache: write through
sda: sda1
   sd 6:0:0:0: [sda] Attached SCSI removable disk
   sd 6:0:0:0: Attached scsi generic sg0 type 0
   usb-storage: device scan complete
  
  This is a known problem.  See
  
  http://marc.info/?l=linux-kernelm=118641424414399w=2
  
  Rafael, has this been fixed yet?
 
 No, I wasn't aware of it.
 
 I think that something like the appended patch is necessary.
 
 Mariusz, please see if that helps.

Yes - this patch fixes the bug.

Thanks,

Mariusz



 ---
  include/linux/freezer.h |   18 +-
  1 file changed, 9 insertions(+), 9 deletions(-)
 
 Index: linux-2.6.23-rc2/include/linux/freezer.h
 ===
 --- linux-2.6.23-rc2.orig/include/linux/freezer.h
 +++ linux-2.6.23-rc2/include/linux/freezer.h
 @@ -134,28 +134,28 @@ static inline void set_freezable(void)
  
  #define wait_event_freezable(wq, condition)  \
  ({   \
 - int __ret;  \
 + int __retval;   \
   do {\
 - __ret = wait_event_interruptible(wq,\
 + __retval = wait_event_interruptible(wq, \
   (condition) || freezing(current));  \
 - if (__ret  !freezing(current))\
 + if (__retval  !freezing(current)) \
   break;  \
   else if (!(condition))  \
 - __ret = -ERESTARTSYS;   \
 + __retval = -ERESTARTSYS;\
   } while (try_to_freeze());  \
 - __ret;  \
 + __retval;   \
  })
  
  
  #define wait_event_freezable_timeout(wq, condition, timeout) \
  ({   \
 - long __ret = timeout;   \
 + long __retval = timeout;\
   do {\
 - __ret = wait_event_interruptible_timeout(wq,\
 + __retval = wait_event_interruptible_timeout(wq, \
   (condition) || freezing(current),   \
 - __ret); \
 + __retval);  \
   } while (try_to_freeze());  \
 - __ret;  \
 + __retval;   \
  })
  #else /* !CONFIG_PM_SLEEP */
  static inline int frozen(struct task_struct *p) { return 0; }
 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [linux-usb-devel] [usb-storage] schedule_timeout: wrong timeout value c1a95554

2007-08-09 Thread Rafael J. Wysocki
On Thursday, 9 August 2007 17:20, Mariusz Kozlowski wrote:
Happens every time I reattach usb pen drive.

usb 1-2: new high speed USB device using ehci_hcd and address 10
usb 1-2: configuration #1 chosen from 1 choice
scsi6 : SCSI emulation for USB Mass Storage devices
usb 1-2: new device found, idVendor=13fe, idProduct=1a00
usb 1-2: new device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2: Product: GEIL USB DISK   
usb 1-2: Manufacturer: 
usb-storage: device found at 10
usb-storage: waiting for device to settle before scanning
schedule_timeout: wrong timeout value c1a95554
 [c010456a] show_trace_log_lvl+0x1a/0x30
 [c010508d] show_trace+0x12/0x14
 [c01051e0] dump_stack+0x15/0x17
 [c04174d1] schedule_timeout+0x8c/0xa2
 [c032aeec] usb_stor_scan_thread+0x100/0x160
 [c0127f2e] kthread+0x36/0x58
 [c0104233] kernel_thread_helper+0x7/0x14
 ===
scsi 6:0:0:0: Direct-Access  GEIL USB DISK2.0 PQ: 0 
ANSI: 0 CCS
sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
sd 6:0:0:0: [sda] Write Protect is off
sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
sd 6:0:0:0: [sda] Assuming drive cache: write through
sd 6:0:0:0: [sda] 1007616 512-byte hardware sectors (516 MB)
sd 6:0:0:0: [sda] Write Protect is off
sd 6:0:0:0: [sda] Mode Sense: 23 00 00 00
sd 6:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 6:0:0:0: [sda] Attached SCSI removable disk
sd 6:0:0:0: Attached scsi generic sg0 type 0
usb-storage: device scan complete
   
   This is a known problem.  See
   
 http://marc.info/?l=linux-kernelm=118641424414399w=2
   
   Rafael, has this been fixed yet?
  
  No, I wasn't aware of it.
  
  I think that something like the appended patch is necessary.
  
  Mariusz, please see if that helps.
 
 Yes - this patch fixes the bug.

OK, thanks for the confirmation.

Here it goes again with a changelog etc.

---
From: Rafael J. Wysocki [EMAIL PROTECTED]

Fix a bug in freezer-introduce-freezer-firendly-waiting-macros.patch which
uses a wrong variable name in wait_event_freezable() and
wait_event_freezable_timeout() (this name is also used in 
wait_event_interruptible() and wait_event_interruptible_timeout() which are
macros and the names clash).

Signed-off-by: Rafael J. Wysocki [EMAIL PROTECTED]
---
 include/linux/freezer.h |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

Index: linux-2.6.23-rc2/include/linux/freezer.h
===
--- linux-2.6.23-rc2.orig/include/linux/freezer.h
+++ linux-2.6.23-rc2/include/linux/freezer.h
@@ -134,28 +134,28 @@ static inline void set_freezable(void)
 
 #define wait_event_freezable(wq, condition)\
 ({ \
-   int __ret;  \
+   int __retval;   \
do {\
-   __ret = wait_event_interruptible(wq,\
+   __retval = wait_event_interruptible(wq, \
(condition) || freezing(current));  \
-   if (__ret  !freezing(current))\
+   if (__retval  !freezing(current)) \
break;  \
else if (!(condition))  \
-   __ret = -ERESTARTSYS;   \
+   __retval = -ERESTARTSYS;\
} while (try_to_freeze());  \
-   __ret;  \
+   __retval;   \
 })
 
 
 #define wait_event_freezable_timeout(wq, condition, timeout)   \
 ({ \
-   long __ret = timeout;   \
+   long __retval = timeout;\
do {\
-   __ret = wait_event_interruptible_timeout(wq,\
+   __retval = wait_event_interruptible_timeout(wq, \
(condition) || freezing(current),   \
-   __ret); \
+   __retval);  \
} while (try_to_freeze());  \
-   __ret;  \
+   __retval

Re: schedule_timeout: wrong timeout value

2006-12-19 Thread kyle


- Original Message - 
From: "Robert Hancock" <[EMAIL PROTECTED]>

To: "kyle" <[EMAIL PROTECTED]>
Cc: 
Sent: Tuesday, December 19, 2006 10:34 AM
Subject: Re: schedule_timeout: wrong timeout value



kyle wrote:

Hi,

Recently my mysql servershows something like:
Dec 18 18:24:05 sql kernel: schedule_timeout: wrong timeout value 
 from c0284efd

Dec 18 18:24:36 sql last message repeated 19939 times
Dec 18 18:25:37 sql last message repeated 33392 times



The message means some code in the kernel or in some module passed a 
negative value to schedule_timeout which it shouldn't have. The c0284efd 
value is the address of the function that made the call - you may be able 
to look that up in your /proc/ksyms or the System.map file and figure out 
what function that is..


There was no module loaded, and unfortunlately, I cannot find the System.map 
or /proc/ksyms file for the affected kernel!
Anyway thank you for your explanation. I have upgraded the kernel to 
2.6.17.14 and wish that it can fix the problem. Thank you


Kyle 


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: schedule_timeout: wrong timeout value

2006-12-19 Thread Andrew Morton
On Mon, 18 Dec 2006 20:34:43 -0600
Robert Hancock <[EMAIL PROTECTED]> wrote:

> kyle wrote:
> > Hi,
> > 
> > Recently my mysql servershows something like:
> > Dec 18 18:24:05 sql kernel: schedule_timeout: wrong timeout value 
> >  from c0284efd
> > Dec 18 18:24:36 sql last message repeated 19939 times
> > Dec 18 18:25:37 sql last message repeated 33392 times
> > 
> > from syslog every 1 or 2 days. Whenever the messages show, mysql server 
> > stop accept new connections from the same network, and I need to restart 
> > the mysql service and then it will keep running well for 1-2 days until 
> > the messages show up again.
> > 
> > The server has been running over 1 year without any problem, the problem 
> > started show up around 2 weeks ago. It's running kernel 2.6.12, and 
> > mysql server, nothing else. Hardware is Pentium 4 2.8GHz with 
> > hyperthreading enabled.
> > 
> > What does the kernel message mean and why it make mysql stop accept new 
> > connections? Is it hardware problem or try upgrade the kernel may help?
> > Please CC me if possible. Thank you
> 
> The message means some code in the kernel or in some module passed a 
> negative value to schedule_timeout which it shouldn't have. The c0284efd 
> value is the address of the function that made the call - you may be 
> able to look that up in your /proc/ksyms or the System.map file and 
> figure out what function that is..
> 

I queued this:


From: Andrew Morton <[EMAIL PROTECTED]>

Kyle is hitting this warning, and we don't have a clue what it's caused by. 
Add the obligatory dump_stack().

Cc: kyle <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 kernel/timer.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff -puN kernel/timer.c~schedule_timeout-improve-warning-message kernel/timer.c
--- a/kernel/timer.c~schedule_timeout-improve-warning-message
+++ a/kernel/timer.c
@@ -1344,11 +1344,10 @@ fastcall signed long __sched schedule_ti
 * should never happens anyway). You just have the printk()
 * that will tell you if something is gone wrong and where.
 */
-   if (timeout < 0)
-   {
+   if (timeout < 0) {
printk(KERN_ERR "schedule_timeout: wrong timeout "
-   "value %lx from %p\n", timeout,
-   __builtin_return_address(0));
+   "value %lx\n", timeout);
+   dump_stack();
current->state = TASK_RUNNING;
goto out;
}
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: schedule_timeout: wrong timeout value

2006-12-19 Thread Andrew Morton
On Mon, 18 Dec 2006 20:34:43 -0600
Robert Hancock [EMAIL PROTECTED] wrote:

 kyle wrote:
  Hi,
  
  Recently my mysql servershows something like:
  Dec 18 18:24:05 sql kernel: schedule_timeout: wrong timeout value 
   from c0284efd
  Dec 18 18:24:36 sql last message repeated 19939 times
  Dec 18 18:25:37 sql last message repeated 33392 times
  
  from syslog every 1 or 2 days. Whenever the messages show, mysql server 
  stop accept new connections from the same network, and I need to restart 
  the mysql service and then it will keep running well for 1-2 days until 
  the messages show up again.
  
  The server has been running over 1 year without any problem, the problem 
  started show up around 2 weeks ago. It's running kernel 2.6.12, and 
  mysql server, nothing else. Hardware is Pentium 4 2.8GHz with 
  hyperthreading enabled.
  
  What does the kernel message mean and why it make mysql stop accept new 
  connections? Is it hardware problem or try upgrade the kernel may help?
  Please CC me if possible. Thank you
 
 The message means some code in the kernel or in some module passed a 
 negative value to schedule_timeout which it shouldn't have. The c0284efd 
 value is the address of the function that made the call - you may be 
 able to look that up in your /proc/ksyms or the System.map file and 
 figure out what function that is..
 

I queued this:


From: Andrew Morton [EMAIL PROTECTED]

Kyle is hitting this warning, and we don't have a clue what it's caused by. 
Add the obligatory dump_stack().

Cc: kyle [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 kernel/timer.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff -puN kernel/timer.c~schedule_timeout-improve-warning-message kernel/timer.c
--- a/kernel/timer.c~schedule_timeout-improve-warning-message
+++ a/kernel/timer.c
@@ -1344,11 +1344,10 @@ fastcall signed long __sched schedule_ti
 * should never happens anyway). You just have the printk()
 * that will tell you if something is gone wrong and where.
 */
-   if (timeout  0)
-   {
+   if (timeout  0) {
printk(KERN_ERR schedule_timeout: wrong timeout 
-   value %lx from %p\n, timeout,
-   __builtin_return_address(0));
+   value %lx\n, timeout);
+   dump_stack();
current-state = TASK_RUNNING;
goto out;
}
_

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: schedule_timeout: wrong timeout value

2006-12-19 Thread kyle


- Original Message - 
From: Robert Hancock [EMAIL PROTECTED]

To: kyle [EMAIL PROTECTED]
Cc: linux-kernel@vger.kernel.org
Sent: Tuesday, December 19, 2006 10:34 AM
Subject: Re: schedule_timeout: wrong timeout value



kyle wrote:

Hi,

Recently my mysql servershows something like:
Dec 18 18:24:05 sql kernel: schedule_timeout: wrong timeout value 
 from c0284efd

Dec 18 18:24:36 sql last message repeated 19939 times
Dec 18 18:25:37 sql last message repeated 33392 times



The message means some code in the kernel or in some module passed a 
negative value to schedule_timeout which it shouldn't have. The c0284efd 
value is the address of the function that made the call - you may be able 
to look that up in your /proc/ksyms or the System.map file and figure out 
what function that is..


There was no module loaded, and unfortunlately, I cannot find the System.map 
or /proc/ksyms file for the affected kernel!
Anyway thank you for your explanation. I have upgraded the kernel to 
2.6.17.14 and wish that it can fix the problem. Thank you


Kyle 


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: schedule_timeout: wrong timeout value

2006-12-18 Thread Robert Hancock

kyle wrote:

Hi,

Recently my mysql servershows something like:
Dec 18 18:24:05 sql kernel: schedule_timeout: wrong timeout value 
 from c0284efd

Dec 18 18:24:36 sql last message repeated 19939 times
Dec 18 18:25:37 sql last message repeated 33392 times

from syslog every 1 or 2 days. Whenever the messages show, mysql server 
stop accept new connections from the same network, and I need to restart 
the mysql service and then it will keep running well for 1-2 days until 
the messages show up again.


The server has been running over 1 year without any problem, the problem 
started show up around 2 weeks ago. It's running kernel 2.6.12, and 
mysql server, nothing else. Hardware is Pentium 4 2.8GHz with 
hyperthreading enabled.


What does the kernel message mean and why it make mysql stop accept new 
connections? Is it hardware problem or try upgrade the kernel may help?

Please CC me if possible. Thank you


The message means some code in the kernel or in some module passed a 
negative value to schedule_timeout which it shouldn't have. The c0284efd 
value is the address of the function that made the call - you may be 
able to look that up in your /proc/ksyms or the System.map file and 
figure out what function that is..


--
Robert Hancock  Saskatoon, SK, Canada
To email, remove "nospam" from [EMAIL PROTECTED]
Home Page: http://www.roberthancock.com/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


schedule_timeout: wrong timeout value

2006-12-18 Thread kyle

Hi,

Recently my mysql servershows something like:
Dec 18 18:24:05 sql kernel: schedule_timeout: wrong timeout value  
from c0284efd

Dec 18 18:24:36 sql last message repeated 19939 times
Dec 18 18:25:37 sql last message repeated 33392 times

from syslog every 1 or 2 days. Whenever the messages show, mysql server stop 
accept new connections from the same network, and I need to restart the 
mysql service and then it will keep running well for 1-2 days until the 
messages show up again.


The server has been running over 1 year without any problem, the problem 
started show up around 2 weeks ago. It's running kernel 2.6.12, and mysql 
server, nothing else. Hardware is Pentium 4 2.8GHz with hyperthreading 
enabled.


What does the kernel message mean and why it make mysql stop accept new 
connections? Is it hardware problem or try upgrade the kernel may help?

Please CC me if possible. Thank you

Kyle



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


schedule_timeout: wrong timeout value

2006-12-18 Thread kyle

Hi,

Recently my mysql servershows something like:
Dec 18 18:24:05 sql kernel: schedule_timeout: wrong timeout value  
from c0284efd

Dec 18 18:24:36 sql last message repeated 19939 times
Dec 18 18:25:37 sql last message repeated 33392 times

from syslog every 1 or 2 days. Whenever the messages show, mysql server stop 
accept new connections from the same network, and I need to restart the 
mysql service and then it will keep running well for 1-2 days until the 
messages show up again.


The server has been running over 1 year without any problem, the problem 
started show up around 2 weeks ago. It's running kernel 2.6.12, and mysql 
server, nothing else. Hardware is Pentium 4 2.8GHz with hyperthreading 
enabled.


What does the kernel message mean and why it make mysql stop accept new 
connections? Is it hardware problem or try upgrade the kernel may help?

Please CC me if possible. Thank you

Kyle



-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: schedule_timeout: wrong timeout value

2006-12-18 Thread Robert Hancock

kyle wrote:

Hi,

Recently my mysql servershows something like:
Dec 18 18:24:05 sql kernel: schedule_timeout: wrong timeout value 
 from c0284efd

Dec 18 18:24:36 sql last message repeated 19939 times
Dec 18 18:25:37 sql last message repeated 33392 times

from syslog every 1 or 2 days. Whenever the messages show, mysql server 
stop accept new connections from the same network, and I need to restart 
the mysql service and then it will keep running well for 1-2 days until 
the messages show up again.


The server has been running over 1 year without any problem, the problem 
started show up around 2 weeks ago. It's running kernel 2.6.12, and 
mysql server, nothing else. Hardware is Pentium 4 2.8GHz with 
hyperthreading enabled.


What does the kernel message mean and why it make mysql stop accept new 
connections? Is it hardware problem or try upgrade the kernel may help?

Please CC me if possible. Thank you


The message means some code in the kernel or in some module passed a 
negative value to schedule_timeout which it shouldn't have. The c0284efd 
value is the address of the function that made the call - you may be 
able to look that up in your /proc/ksyms or the System.map file and 
figure out what function that is..


--
Robert Hancock  Saskatoon, SK, Canada
To email, remove nospam from [EMAIL PROTECTED]
Home Page: http://www.roberthancock.com/

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/