Browse Source

ocfs2: add IO error check in ocfs2_get_sector()

Check for IO error in ocfs2_get_sector().

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
wengang wang 16 years ago
parent
commit
28d57d4377
1 changed files with 7 additions and 0 deletions
  1. 7 0
      fs/ocfs2/super.c

+ 7 - 0
fs/ocfs2/super.c

@@ -1537,6 +1537,13 @@ static int ocfs2_get_sector(struct super_block *sb,
 	unlock_buffer(*bh);
 	unlock_buffer(*bh);
 	ll_rw_block(READ, 1, bh);
 	ll_rw_block(READ, 1, bh);
 	wait_on_buffer(*bh);
 	wait_on_buffer(*bh);
+	if (!buffer_uptodate(*bh)) {
+		mlog_errno(-EIO);
+		brelse(*bh);
+		*bh = NULL;
+		return -EIO;
+	}
+
 	return 0;
 	return 0;
 }
 }