[Patch 1/8] 2.4: Fix ext3 panic due to ll_rw_block behaviour after illegal block access.

From: Stephen Tweedie (sct@redhat.com)
Date: Tue Mar 25 2003 - 12:39:35 EST


It is really rude to clear all the buffer state bits on an access
beyond end-of-device. It can panic filesystems which have internal
state bits, for example. Just clear the dirty flag instead, and leave
the others intact.

--- linux-2.4-ext3push/drivers/block/ll_rw_blk.c.=K0000=.orig 2003-03-25 10:59:15.000000000 +0000
+++ linux-2.4-ext3push/drivers/block/ll_rw_blk.c 2003-03-25 10:59:15.000000000 +0000
@@ -1129,7 +1129,7 @@ void generic_make_request (int rw, struc
 
                 if (maxsector < count || maxsector - count < sector) {
                         /* Yecch */
- bh->b_state &= (1 << BH_Lock) | (1 << BH_Mapped);
+ bh->b_state &= ~(1 << BH_Dirty);
 
                         /* This may well happen - the kernel calls bread()
                            without checking the size of the device, e.g.,
@@ -1140,7 +1140,6 @@ void generic_make_request (int rw, struc
                                kdevname(bh->b_rdev), rw,
                                (sector + count)>>1, minorsize);
 
- /* Yecch again */
                         bh->b_end_io(bh, 0);
                         return;
                 }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Mar 31 2003 - 22:00:20 EST