From: Peter Wu <[email protected]>

This solves a BUG followed by a lockup in the following case:

1. Connect device and look in dmesg for the address:

    [   40.034520] usb 6-2: Product: My Passport 0748

2. Write something:

    dd if=/dev/zero of=/dev/sdd bs=1M

3. Remove device:

    echo 1 > /sys/bus/usb/devices/6-2/remove

4. Machine locks up (because the work queue got stuck?).

Signed-off-by: Peter Wu <[email protected]>
---
 fs/fs-writeback.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 68851ff..6e38a8b 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1007,7 +1007,8 @@ void bdi_writeback_workfn(struct work_struct *work)
        struct backing_dev_info *bdi = wb->bdi;
        long pages_written;
 
-       set_worker_desc("flush-%s", dev_name(bdi->dev));
+       if (bdi->dev)
+               set_worker_desc("flush-%s", dev_name(bdi->dev));
        current->flags |= PF_SWAPWRITE;
 
        if (likely(!current_is_workqueue_rescuer() ||
-- 
1.8.3.4
--
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/

Reply via email to