lkml.org 
[lkml]   [1999]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.042 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site