Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1007
b: refs/heads/master
c: ad576e6
h: refs/heads/master
i:
  1005: 5c48132
  1003: e8c957d
  999: 2dc1a75
  991: ef4afc6
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed May 5, 2005
1 parent d5cd93d commit db6455f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 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: f3ddbdc6267c32223035ea9bb8456a2d86f65ba1
refs/heads/master: ad576e63e0c8b274a8558b8e05a6d0526e804dc0
18 changes: 13 additions & 5 deletions trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
int err;
sector_t block;
sector_t last_block;
struct buffer_head *bh, *head;
struct buffer_head *bh, *head, *last_bh = NULL;
int nr_underway = 0;

BUG_ON(!PageLocked(page));
Expand Down Expand Up @@ -1809,7 +1809,6 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
} while (bh != head);

do {
get_bh(bh);
if (!buffer_mapped(bh))
continue;
/*
Expand All @@ -1827,6 +1826,8 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
}
if (test_clear_buffer_dirty(bh)) {
mark_buffer_async_write(bh);
get_bh(bh);
last_bh = bh;
} else {
unlock_buffer(bh);
}
Expand All @@ -1845,10 +1846,13 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
if (buffer_async_write(bh)) {
submit_bh(WRITE, bh);
nr_underway++;
put_bh(bh);
if (bh == last_bh)
break;
}
put_bh(bh);
bh = next;
} while (bh != head);
bh = head;

err = 0;
done:
Expand Down Expand Up @@ -1887,10 +1891,11 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
bh = head;
/* Recovery: lock and submit the mapped buffers */
do {
get_bh(bh);
if (buffer_mapped(bh) && buffer_dirty(bh)) {
lock_buffer(bh);
mark_buffer_async_write(bh);
get_bh(bh);
last_bh = bh;
} else {
/*
* The buffer may have been set dirty during
Expand All @@ -1909,10 +1914,13 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
clear_buffer_dirty(bh);
submit_bh(WRITE, bh);
nr_underway++;
put_bh(bh);
if (bh == last_bh)
break;
}
put_bh(bh);
bh = next;
} while (bh != head);
bh = head;
goto done;
}

Expand Down

0 comments on commit db6455f

Please sign in to comment.