diff options
-rw-r--r-- | fs/ext3/inode.c | 14 | ||||
-rw-r--r-- | fs/ext3/namei.c | 9 | ||||
-rw-r--r-- | fs/ext3/super.c | 10 |
3 files changed, 18 insertions, 15 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 9da9125ba3ef..a8d3217c5cfe 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -1136,9 +1136,11 @@ struct buffer_head *ext3_bread(handle_t *handle, struct inode *inode, | |||
1136 | bh = ext3_getblk(handle, inode, block, create, err); | 1136 | bh = ext3_getblk(handle, inode, block, create, err); |
1137 | if (!bh) | 1137 | if (!bh) |
1138 | return bh; | 1138 | return bh; |
1139 | if (buffer_uptodate(bh)) | 1139 | if (bh_uptodate_or_lock(bh)) |
1140 | return bh; | 1140 | return bh; |
1141 | ll_rw_block(READ | REQ_META | REQ_PRIO, 1, &bh); | 1141 | get_bh(bh); |
1142 | bh->b_end_io = end_buffer_read_sync; | ||
1143 | submit_bh(READ | REQ_META | REQ_PRIO, bh); | ||
1142 | wait_on_buffer(bh); | 1144 | wait_on_buffer(bh); |
1143 | if (buffer_uptodate(bh)) | 1145 | if (buffer_uptodate(bh)) |
1144 | return bh; | 1146 | return bh; |
@@ -2068,12 +2070,10 @@ static int ext3_block_truncate_page(struct inode *inode, loff_t from) | |||
2068 | if (PageUptodate(page)) | 2070 | if (PageUptodate(page)) |
2069 | set_buffer_uptodate(bh); | 2071 | set_buffer_uptodate(bh); |
2070 | 2072 | ||
2071 | if (!buffer_uptodate(bh)) { | 2073 | if (!bh_uptodate_or_lock(bh)) { |
2072 | err = -EIO; | 2074 | err = bh_submit_read(bh); |
2073 | ll_rw_block(READ, 1, &bh); | ||
2074 | wait_on_buffer(bh); | ||
2075 | /* Uhhuh. Read error. Complain and punt. */ | 2075 | /* Uhhuh. Read error. Complain and punt. */ |
2076 | if (!buffer_uptodate(bh)) | 2076 | if (err) |
2077 | goto unlock; | 2077 | goto unlock; |
2078 | } | 2078 | } |
2079 | 2079 | ||
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index 642dc6d66dfd..337c3f3375c4 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
@@ -921,9 +921,12 @@ restart: | |||
921 | num++; | 921 | num++; |
922 | bh = ext3_getblk(NULL, dir, b++, 0, &err); | 922 | bh = ext3_getblk(NULL, dir, b++, 0, &err); |
923 | bh_use[ra_max] = bh; | 923 | bh_use[ra_max] = bh; |
924 | if (bh) | 924 | if (bh && !bh_uptodate_or_lock(bh)) { |
925 | ll_rw_block(READ | REQ_META | REQ_PRIO, | 925 | get_bh(bh); |
926 | 1, &bh); | 926 | bh->b_end_io = end_buffer_read_sync; |
927 | submit_bh(READ | REQ_META | REQ_PRIO, | ||
928 | bh); | ||
929 | } | ||
927 | } | 930 | } |
928 | } | 931 | } |
929 | if ((bh = bh_use[ra_ptr++]) == NULL) | 932 | if ((bh = bh_use[ra_ptr++]) == NULL) |
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 767fa3a2bd17..662cef4569ab 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -2231,11 +2231,11 @@ static journal_t *ext3_get_dev_journal(struct super_block *sb, | |||
2231 | goto out_bdev; | 2231 | goto out_bdev; |
2232 | } | 2232 | } |
2233 | journal->j_private = sb; | 2233 | journal->j_private = sb; |
2234 | ll_rw_block(READ, 1, &journal->j_sb_buffer); | 2234 | if (!bh_uptodate_or_lock(journal->j_sb_buffer)) { |
2235 | wait_on_buffer(journal->j_sb_buffer); | 2235 | if (bh_submit_read(journal->j_sb_buffer)) { |
2236 | if (!buffer_uptodate(journal->j_sb_buffer)) { | 2236 | ext3_msg(sb, KERN_ERR, "I/O error on journal device"); |
2237 | ext3_msg(sb, KERN_ERR, "I/O error on journal device"); | 2237 | goto out_journal; |
2238 | goto out_journal; | 2238 | } |
2239 | } | 2239 | } |
2240 | if (be32_to_cpu(journal->j_superblock->s_nr_users) != 1) { | 2240 | if (be32_to_cpu(journal->j_superblock->s_nr_users) != 1) { |
2241 | ext3_msg(sb, KERN_ERR, | 2241 | ext3_msg(sb, KERN_ERR, |