patch-2.0.30 linux/include/linux/blk.h

Next file: linux/include/linux/ext2_fs.h
Previous file: linux/include/linux/atalk.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.29/linux/include/linux/blk.h linux/include/linux/blk.h
@@ -382,15 +382,19 @@
 	struct request *req = CURRENT;
 #endif /* IDE_DRIVER */
 	struct buffer_head * bh;
+	int nsect;
 
 	req->errors = 0;
 	if (!uptodate) {
 		printk("end_request: I/O error, dev %s, sector %lu\n",
 			kdevname(req->rq_dev), req->sector);
-		req->nr_sectors--;
-		req->nr_sectors &= ~SECTOR_MASK;
-		req->sector += (BLOCK_SIZE / 512);
-		req->sector &= ~SECTOR_MASK;		
+		if ((bh = req->bh) != NULL) {
+			nsect = bh->b_size >> 9;
+			req->nr_sectors--;
+			req->nr_sectors &= ~(nsect - 1);
+			req->sector += nsect;
+			req->sector &= ~(nsect - 1);
+		}
 	}
 
 	if ((bh = req->bh) != NULL) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov