Re: [patch] __block_write_full_page bug
From: Nick Piggin
Date: Tue Apr 26 2005 - 20:04:04 EST
Andrew Morton wrote:
Those tests for buffer_async_write(bh) are redundant now, aren't they?
Like this?
--
SUSE Labs, Novell Inc.
Previous patch made buffer_async_write tests superfluous.
As suggested by Andrew Morton.
Signed-off-by: Nick Piggin <nickpiggin@xxxxxxxxxxxx>
Index: linux-2.6/fs/buffer.c
===================================================================
--- linux-2.6.orig/fs/buffer.c 2005-04-25 13:14:52.000000000 +1000
+++ linux-2.6/fs/buffer.c 2005-04-27 11:00:01.000000000 +1000
@@ -1843,8 +1843,8 @@ static int __block_write_full_page(struc
for (nr_underway = 0; nr_underway < idx; nr_underway++) {
bh = arr[nr_underway];
- if (buffer_async_write(bh))
- submit_bh(WRITE, bh);
+ BUG_ON(!buffer_async_write(bh));
+ submit_bh(WRITE, bh);
put_bh(bh);
}
@@ -1904,10 +1904,9 @@ recover:
unlock_page(page);
for (nr_underway = 0; nr_underway < idx; nr_underway++) {
bh = arr[nr_underway];
- if (buffer_async_write(bh)) {
- clear_buffer_dirty(bh);
- submit_bh(WRITE, bh);
- }
+ BUG_ON(!buffer_async_write(bh));
+ clear_buffer_dirty(bh);
+ submit_bh(WRITE, bh);
put_bh(bh);
}
goto done;