patch-2.3.12 linux/drivers/block/ll_rw_blk.c

Next file: linux/drivers/char/Makefile
Previous file: linux/drivers/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.11/linux/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
@@ -403,7 +403,7 @@
 		unsigned long maxsector = (blk_size[major][MINOR(bh->b_rdev)] << 1) + 1;
 
 		if (maxsector < count || maxsector - count < sector) {
-			bh->b_state &= (1 << BH_Lock);
+			bh->b_state &= (1 << BH_Lock) | (1 << BH_Mapped);
                         /* This may well happen - the kernel calls bread()
                            without checking the size of the device, e.g.,
                            when mounting a device. */
@@ -428,6 +428,9 @@
 			kstat.pgpgin++;
 			max_req = NR_REQUEST;	/* reads take precedence */
 			break;
+		case WRITERAW:
+			rw = WRITE;
+			goto do_write;	/* Skip the buffer refile */
 		case WRITEA:
 			rw_ahead = 1;
 			rw = WRITE;	/* drop into WRITE */
@@ -435,6 +438,7 @@
 			if (!test_and_clear_bit(BH_Dirty, &bh->b_state))
 				goto end_io;	/* Hmmph! Nothing to write */
 			refile_buffer(bh);
+		do_write:
 			/*
 			 * We don't allow the write-requests to fill up the
 			 * queue completely:  we want some room for reads,
@@ -641,7 +645,7 @@
 #endif
 	}
 
-	if ((rw == WRITE || rw == WRITEA) && is_read_only(bh[0]->b_dev)) {
+	if ((rw & WRITE) && is_read_only(bh[0]->b_dev)) {
 		printk(KERN_NOTICE "Can't write to read-only device %s\n",
 		       kdevname(bh[0]->b_dev));
 		goto sorry;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)