Messages in this thread Patch in this message | | | Date | Mon, 24 May 1999 18:54:12 +0100 (GMT) | From | Tim Waugh <> | Subject | [PATCH] 2.2.9: block_read bug |
| |
There is a problem with block_read. While running badblocks on a particular partition on a particular machine, I've seen control fall out of the inner loop here with bhe equal to bhb, but with left still 1024. This causes it to go round the loop again, using uninitialized buffer heads.
The code is a little hard to follow. Here is a patch that prevents the bug from causing the otherwise inevitable oopses. Does someone who knows that code a little better than me want to take a closer look and see why this is happening in the first place?
Tim. */
--- block_dev.c.orig Mon May 24 18:41:04 1999 +++ block_dev.c Mon May 24 18:41:07 1999 @@ -273,6 +273,8 @@ if (++bhe == &buflist[NBUF]) bhe = buflist; } while (left > 0 && bhe != bhb && (!*bhe || !buffer_locked(*bhe))); + if (bhe == bhb && !blocks) + break; } while (left > 0); /* Release the read-ahead blocks */
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |