On Mon, 21 Feb 2005 00:15:22 -0500, Glenn Maynard <[EMAIL PROTECTED]> wrote:

> I'm still seeing this oops with 2.6.11-rc4-bk8 (updated oops attached).
> I've been using the attached patch, but judging by the comments after
> the removed code, it may not be correct.

Actually, ignore my previous mail, I'm ashamed for being so lazy.
Your patch is all right except I think the order of cleanup is
the opposite, and declarations-in-the-middle are too much of gcc-ism.

As for comments, they turned out to be incorrect. We do not rely
on waiting for active commands anymore. Instead we employ a two-stage
shutdown by poisoning and prohibiting new opens at the first stage,
letting close wait for requests to run out, and deallocating
structures at second stage.

-- Pete

--- linux-2.6.11-rc4/drivers/block/ub.c 2005-02-15 22:38:33.000000000 -0800
+++ linux-2.6.11-rc4-bq/drivers/block/ub.c      2005-02-20 21:46:58.000000000 
-0800
@@ -491,6 +491,11 @@
  */
 static void ub_cleanup(struct ub_dev *sc)
 {
+       request_queue_t *q;
+
+       /* I don't think queue can be NULL. But... Stolen from sx8.c */
+       if ((q = sc->disk->queue) != NULL)
+               blk_cleanup_queue(q);
 
        /*
         * If we zero disk->private_data BEFORE put_disk, we have to check
@@ -2013,7 +2018,6 @@
 {
        struct ub_dev *sc = usb_get_intfdata(intf);
        struct gendisk *disk = sc->disk;
-       request_queue_t *q = disk->queue;
        unsigned long flags;
 
        /*
@@ -2056,13 +2060,8 @@
         */
        if (disk->flags & GENHD_FL_UP)
                del_gendisk(disk);
-       if (q)
-               blk_cleanup_queue(q);
 
        /*
-        * We really expect blk_cleanup_queue() to wait, so no amount
-        * of paranoya is too much.
-        *
         * Taking a lock on a structure which is about to be freed
         * is very nonsensual. Here it is largely a way to do a debug freeze,
         * and a bracket which shows where the nonsensual code segment ends.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to