aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorQu Fuping <fs@ercist.iscas.ac.cn>2005-06-25 14:55:44 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 16:24:40 -0700
commit6283d58e7464f82b1c1c33943f0bd51c1e83899a (patch)
tree24ec734f50695f715a9f4a418fd206b88695d293 /fs
parent442ff702233287df3f50ec3a7fd0a73d7367cf5a (diff)
[PATCH] reiserfs: do not ignore i/io error on readpage
Reiserfs's readpage does not notice i/o errors. This patch makes reiserfs_readpage to return -EIO when i/o error appears. This patch makes reiserfs to not ignore I/O error on readpage. Signed-off-by: Qu Fuping <fs@ercist.iscas.ac.cn> Signed-off-by: Vladimir V. Saveliev <vs@namesys.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/reiserfs/inode.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 0d5817f8197..289d864fe73 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -254,6 +254,7 @@ static int _get_block_create_0 (struct inode * inode, long block,
char * p = NULL;
int chars;
int ret ;
+ int result ;
int done = 0 ;
unsigned long offset ;
@@ -262,10 +263,13 @@ static int _get_block_create_0 (struct inode * inode, long block,
(loff_t)block * inode->i_sb->s_blocksize + 1, TYPE_ANY, 3);
research:
- if (search_for_position_by_key (inode->i_sb, &key, &path) != POSITION_FOUND) {
+ result = search_for_position_by_key (inode->i_sb, &key, &path) ;
+ if (result != POSITION_FOUND) {
pathrelse (&path);
if (p)
kunmap(bh_result->b_page) ;
+ if (result == IO_ERROR)
+ return -EIO;
// We do not return -ENOENT if there is a hole but page is uptodate, because it means
// That there is some MMAPED data associated with it that is yet to be written to disk.
if ((args & GET_BLOCK_NO_HOLE) && !PageUptodate(bh_result->b_page) ) {
@@ -382,8 +386,9 @@ research:
// update key to look for the next piece
set_cpu_key_k_offset (&key, cpu_key_k_offset (&key) + chars);
- if (search_for_position_by_key (inode->i_sb, &key, &path) != POSITION_FOUND)
- // we read something from tail, even if now we got IO_ERROR
+ result = search_for_position_by_key (inode->i_sb, &key, &path);
+ if (result != POSITION_FOUND)
+ // i/o error most likely
break;
bh = get_last_bh (&path);
ih = get_ih (&path);
@@ -394,6 +399,10 @@ research:
finished:
pathrelse (&path);
+
+ if (result == IO_ERROR)
+ return -EIO;
+
/* this buffer has valid data, but isn't valid for io. mapping it to
* block #0 tells the rest of reiserfs it just has a tail in it
*/