diff options
-rw-r--r-- | fs/ext4/page-io.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index ddb3d401543c..05795f10e55a 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/workqueue.h> | 23 | #include <linux/workqueue.h> |
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/mm.h> | ||
26 | 27 | ||
27 | #include "ext4_jbd2.h" | 28 | #include "ext4_jbd2.h" |
28 | #include "xattr.h" | 29 | #include "xattr.h" |
@@ -434,7 +435,7 @@ int ext4_bio_write_page(struct ext4_io_submit *io, | |||
434 | 435 | ||
435 | io_page = kmem_cache_alloc(io_page_cachep, GFP_NOFS); | 436 | io_page = kmem_cache_alloc(io_page_cachep, GFP_NOFS); |
436 | if (!io_page) { | 437 | if (!io_page) { |
437 | set_page_dirty(page); | 438 | redirty_page_for_writepage(wbc, page); |
438 | unlock_page(page); | 439 | unlock_page(page); |
439 | return -ENOMEM; | 440 | return -ENOMEM; |
440 | } | 441 | } |
@@ -466,7 +467,6 @@ int ext4_bio_write_page(struct ext4_io_submit *io, | |||
466 | set_buffer_uptodate(bh); | 467 | set_buffer_uptodate(bh); |
467 | continue; | 468 | continue; |
468 | } | 469 | } |
469 | clear_buffer_dirty(bh); | ||
470 | ret = io_submit_add_bh(io, io_page, inode, wbc, bh); | 470 | ret = io_submit_add_bh(io, io_page, inode, wbc, bh); |
471 | if (ret) { | 471 | if (ret) { |
472 | /* | 472 | /* |
@@ -474,9 +474,10 @@ int ext4_bio_write_page(struct ext4_io_submit *io, | |||
474 | * we can do but mark the page as dirty, and | 474 | * we can do but mark the page as dirty, and |
475 | * better luck next time. | 475 | * better luck next time. |
476 | */ | 476 | */ |
477 | set_page_dirty(page); | 477 | redirty_page_for_writepage(wbc, page); |
478 | break; | 478 | break; |
479 | } | 479 | } |
480 | clear_buffer_dirty(bh); | ||
480 | } | 481 | } |
481 | unlock_page(page); | 482 | unlock_page(page); |
482 | /* | 483 | /* |