[Ocfs2-commits] mfasheh commits r2462 - trunk/fs/ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Jul 8 14:26:59 CDT 2005


Author: mfasheh
Signed-off-by: manish
Date: 2005-07-08 14:26:58 -0500 (Fri, 08 Jul 2005)
New Revision: 2462

Modified:
   trunk/fs/ocfs2/buffer_head_io.c
Log:
* handle I/O errors more cleanly

Signed-off-by: manish



Modified: trunk/fs/ocfs2/buffer_head_io.c
===================================================================
--- trunk/fs/ocfs2/buffer_head_io.c	2005-07-08 01:56:47 UTC (rev 2461)
+++ trunk/fs/ocfs2/buffer_head_io.c	2005-07-08 19:26:58 UTC (rev 2462)
@@ -112,10 +112,23 @@
 	for (i = (nr - 1) ; i >= 0; i--) {
 		bh = bhs[i];
 
+		wait_on_buffer(bh);
+
+		if (!buffer_uptodate(bh)) {
+			/* Status won't be cleared from here on out,
+			 * so we can safely record this and loop back
+			 * to cleanup the other buffers. Don't need to
+			 * remove the clustered uptodate information
+			 * for this bh as it's not marked locally
+			 * uptodate. */
+			status = -EIO;
+			brelse(bh);
+			bhs[i] = NULL;
+			continue;
+		}
+
 		if (inode)
 			ocfs2_set_buffer_uptodate(inode, bh);
-
-		wait_on_buffer(bh);
 	}
 	if (inode)
 		up(&OCFS2_I(inode)->ip_io_sem);
@@ -234,16 +247,27 @@
 	for (i = (nr - 1); i >= 0; i--) {
 		bh = bhs[i];
 
-		if (inode)
-			ocfs2_set_buffer_uptodate(inode, bh);
+		/* We know this can't have changed as we hold the
+		 * inode sem. Avoid doing any work on the bh if the
+		 * journal has it. */
+		if (!buffer_jbd(bh))
+			wait_on_buffer(bh);
 
-		/* We know this can't have changed as we hold the
-		 * inode sem. Avoid doing any work on the bh as the
-		 * journal has it now. */
-		if (buffer_jbd(bh))
+		if (!buffer_uptodate(bh)) {
+			/* Status won't be cleared from here on out,
+			 * so we can safely record this and loop back
+			 * to cleanup the other buffers. Don't need to
+			 * remove the clustered uptodate information
+			 * for this bh as it's not marked locally
+			 * uptodate. */
+			status = -EIO;
+			brelse(bh);
+			bhs[i] = NULL;
 			continue;
+		}
 
-		wait_on_buffer(bh);
+		if (inode)
+			ocfs2_set_buffer_uptodate(inode, bh);
 	}
 	if (inode)
 		up(&OCFS2_I(inode)->ip_io_sem);



More information about the Ocfs2-commits mailing list