public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fixes for linked list bugs in block I/O code
@ 2003-05-07 23:22 Dave Peterson
  2003-05-07 23:42 ` Bartlomiej Zolnierkiewicz
  2003-05-08  6:29 ` Jens Axboe
  0 siblings, 2 replies; 9+ messages in thread
From: Dave Peterson @ 2003-05-07 23:22 UTC (permalink / raw)
  To: linux-kernel; +Cc: axboe, davej, dsp

I found a couple of small linked list bugs in __make_request() in
drivers/block/ll_rw_blk.c.  The bugs exist in both kernels
2.4.20 and 2.5.69.  Therefore I have made patches for both
kernels.  The problem is that when inserting a new buffer_head
into the linked list of buffer_head structures maintained by
"struct request", the b_reqnext field is not initialized.

-Dave Peterson
 dsp@llnl.gov


========== START OF 2.4.20 PATCH FOR drivers/block/ll_rw_blk.c ===========
--- ll_rw_blk.c.old     Wed May  7 15:54:58 2003
+++ ll_rw_blk.c.new     Wed May  7 15:58:07 2003
@@ -973,6 +973,7 @@
                                insert_here = &req->queue;
                                break;
                        }
+                       bh->b_reqnext = req->bhtail->b_reqnext;
                        req->bhtail->b_reqnext = bh;
                        req->bhtail = bh;
                        req->nr_sectors = req->hard_nr_sectors += count;
@@ -1061,6 +1062,7 @@
        req->waiting = NULL;
        req->bh = bh;
        req->bhtail = bh;
+       bh->b_reqnext = NULL;
        req->rq_dev = bh->b_rdev;
        req->start_time = jiffies;
        req_new_io(req, 0, count);
========== END OF 2.4.20 PATCH FOR drivers/block/ll_rw_blk.c =============


========== START OF 2.5.69 PATCH FOR drivers/block/ll_rw_blk.c ===========
--- ll_rw_blk.c.old     Wed May  7 15:55:18 2003
+++ ll_rw_blk.c.new     Wed May  7 16:01:56 2003
@@ -1721,6 +1721,7 @@
                                break;
                        }

+                       bio->bi_next = req->biotail->bi_next;
                        req->biotail->bi_next = bio;
                        req->biotail = bio;
                        req->nr_sectors = req->hard_nr_sectors += nr_sectors;
@@ -1811,6 +1812,7 @@
        req->buffer = bio_data(bio);    /* see ->buffer comment above */
        req->waiting = NULL;
        req->bio = req->biotail = bio;
+       bio->bi_next = NULL;
        req->rq_disk = bio->bi_bdev->bd_disk;
        req->start_time = jiffies;
        add_request(q, req, insert_here);
========== END OF 2.5.69 PATCH FOR drivers/block/ll_rw_blk.c =============

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-05-08 17:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-07 23:22 [PATCH] fixes for linked list bugs in block I/O code Dave Peterson
2003-05-07 23:42 ` Bartlomiej Zolnierkiewicz
2003-05-08  0:09   ` Dave Peterson
2003-05-08  0:26     ` Bartlomiej Zolnierkiewicz
2003-05-08  0:38       ` Dave Peterson
2003-05-08  1:17         ` Bartlomiej Zolnierkiewicz
2003-05-08 17:47           ` Dave Peterson
2003-05-08  6:29 ` Jens Axboe
2003-05-08 18:06   ` Dave Peterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox