Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 173613 Details for
Bug 248698
[2.6.27 regression] long/infinite loop when bad sectors are encountered
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
usb fix
patch (text/plain), 3.20 KB, created by
Sergey Ovcharenko
on 2008-11-27 21:50:26 UTC
(
hide
)
Description:
usb fix
Filename:
MIME Type:
Creator:
Sergey Ovcharenko
Created:
2008-11-27 21:50:26 UTC
Size:
3.20 KB
patch
obsolete
>From: Brandon Philips <brandon@ifup.org> >Date: Thu, 6 Nov 2008 19:19:11 +0000 (-0800) >Subject: USB: cdc-acm.c: fix recursive lock in acm_start_wb error path >X-Git-Tag: v2.6.28-rc5~16^2~13 >X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=ad0b65efd12d020b046cde8d6f474e37bb98dd73;hp=881e3c9867c585e632dfa4ccb0848b62debc64c7 > >USB: cdc-acm.c: fix recursive lock in acm_start_wb error path > >Fixes an obvious bug in cdc-acm by avoiding a recursive lock on >acm_start_wb()'s error path. Should apply towards 2.6.27 stable and >2.6.28. > >============================================= >[ INFO: possible recursive locking detected ] >2.6.27-2-pae #109 >--------------------------------------------- >python/31449 is trying to acquire lock: > (&acm->write_lock){++..}, at: [<f89a0348>] acm_start_wb+0x5c/0x7b [cdc_acm] > >but task is already holding lock: > (&acm->write_lock){++..}, at: [<f89a04fb>] acm_tty_write+0xe1/0x167 [cdc_acm] > >other info that might help us debug this: >2 locks held by python/31449: > #0: (&tty->atomic_write_lock){--..}, at: [<c0260fae>] tty_write_lock+0x14/0x3b > #1: (&acm->write_lock){++..}, at: [<f89a04fb>] acm_tty_write+0xe1/0x167 [cdc_acm] > >stack backtrace: >Pid: 31449, comm: python Not tainted 2.6.27-2-pae #109 > [<c030f42f>] ? printk+0xf/0x18 > [<c0149f33>] __lock_acquire+0xc7b/0x1316 > [<c014a63e>] lock_acquire+0x70/0x97 > [<f89a0348>] ? acm_start_wb+0x5c/0x7b [cdc_acm] > [<c0312109>] _spin_lock_irqsave+0x37/0x47 > [<f89a0348>] ? acm_start_wb+0x5c/0x7b [cdc_acm] > [<f89a0348>] acm_start_wb+0x5c/0x7b [cdc_acm] > [<f89a055d>] acm_tty_write+0x143/0x167 [cdc_acm] > [<c0262a98>] write_chan+0x1cd/0x297 > [<c012527e>] ? default_wake_function+0x0/0xd > [<c026111e>] tty_write+0x149/0x1b9 > [<c02628cb>] ? write_chan+0x0/0x297 > [<c01912c5>] ? rw_verify_area+0x76/0x98 > [<c0260fd5>] ? tty_write+0x0/0x1b9 > [<c01919ba>] vfs_write+0x8c/0x136 > [<c0191afd>] sys_write+0x3b/0x60 > [<c0103beb>] sysenter_do_call+0x12/0x3f > ======================= > >Signed-off-by: Brandon Philips <bphilips@suse.de> >Cc: Oliver Neukum <oliver@neukum.org> >Cc: stable <stable@kernel.org> >Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> >--- > >diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c >index 2010444..d50a99f 100644 >--- a/drivers/usb/class/cdc-acm.c >+++ b/drivers/usb/class/cdc-acm.c >@@ -158,16 +158,12 @@ static int acm_wb_is_avail(struct acm *acm) > } > > /* >- * Finish write. >+ * Finish write. Caller must hold acm->write_lock > */ > static void acm_write_done(struct acm *acm, struct acm_wb *wb) > { >- unsigned long flags; >- >- spin_lock_irqsave(&acm->write_lock, flags); > wb->use = 0; > acm->transmitting--; >- spin_unlock_irqrestore(&acm->write_lock, flags); > } > > /* >@@ -482,6 +478,7 @@ static void acm_write_bulk(struct urb *urb) > { > struct acm_wb *wb = urb->context; > struct acm *acm = wb->instance; >+ unsigned long flags; > > if (verbose || urb->status > || (urb->actual_length != urb->transfer_buffer_length)) >@@ -490,7 +487,9 @@ static void acm_write_bulk(struct urb *urb) > urb->transfer_buffer_length, > urb->status); > >+ spin_lock_irqsave(&acm->write_lock, flags); > acm_write_done(acm, wb); >+ spin_unlock_irqrestore(&acm->write_lock, flags); > if (ACM_READY(acm)) > schedule_work(&acm->work); > else
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 248698
:
173559
|
173560
|
173561
| 173613 |
174002
|
174198
|
174263
|
174273
|
175109