Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281448
b: refs/heads/master
c: d03e129
h: refs/heads/master
v: v3
  • Loading branch information
Zheng Liu authored and Jan Kara committed Jan 9, 2012
1 parent 2770359 commit cf4366b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bcdd0c1600903e9222abfcde28947406020ccb5d
refs/heads/master: d03e1292c46721f60830c5d2e334966472002ed0
14 changes: 7 additions & 7 deletions trunk/fs/ext3/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,9 +1136,11 @@ struct buffer_head *ext3_bread(handle_t *handle, struct inode *inode,
bh = ext3_getblk(handle, inode, block, create, err);
if (!bh)
return bh;
if (buffer_uptodate(bh))
if (bh_uptodate_or_lock(bh))
return bh;
ll_rw_block(READ | REQ_META | REQ_PRIO, 1, &bh);
get_bh(bh);
bh->b_end_io = end_buffer_read_sync;
submit_bh(READ | REQ_META | REQ_PRIO, bh);
wait_on_buffer(bh);
if (buffer_uptodate(bh))
return bh;
Expand Down Expand Up @@ -2068,12 +2070,10 @@ static int ext3_block_truncate_page(struct inode *inode, loff_t from)
if (PageUptodate(page))
set_buffer_uptodate(bh);

if (!buffer_uptodate(bh)) {
err = -EIO;
ll_rw_block(READ, 1, &bh);
wait_on_buffer(bh);
if (!bh_uptodate_or_lock(bh)) {
err = bh_submit_read(bh);
/* Uhhuh. Read error. Complain and punt. */
if (!buffer_uptodate(bh))
if (err)
goto unlock;
}

Expand Down
9 changes: 6 additions & 3 deletions trunk/fs/ext3/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,9 +921,12 @@ static struct buffer_head *ext3_find_entry(struct inode *dir,
num++;
bh = ext3_getblk(NULL, dir, b++, 0, &err);
bh_use[ra_max] = bh;
if (bh)
ll_rw_block(READ | REQ_META | REQ_PRIO,
1, &bh);
if (bh && !bh_uptodate_or_lock(bh)) {
get_bh(bh);
bh->b_end_io = end_buffer_read_sync;
submit_bh(READ | REQ_META | REQ_PRIO,
bh);
}
}
}
if ((bh = bh_use[ra_ptr++]) == NULL)
Expand Down
10 changes: 5 additions & 5 deletions trunk/fs/ext3/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2231,11 +2231,11 @@ static journal_t *ext3_get_dev_journal(struct super_block *sb,
goto out_bdev;
}
journal->j_private = sb;
ll_rw_block(READ, 1, &journal->j_sb_buffer);
wait_on_buffer(journal->j_sb_buffer);
if (!buffer_uptodate(journal->j_sb_buffer)) {
ext3_msg(sb, KERN_ERR, "I/O error on journal device");
goto out_journal;
if (!bh_uptodate_or_lock(journal->j_sb_buffer)) {
if (bh_submit_read(journal->j_sb_buffer)) {
ext3_msg(sb, KERN_ERR, "I/O error on journal device");
goto out_journal;
}
}
if (be32_to_cpu(journal->j_superblock->s_nr_users) != 1) {
ext3_msg(sb, KERN_ERR,
Expand Down

0 comments on commit cf4366b

Please sign in to comment.