diff options
-rw-r--r-- | fs/ext4/page-io.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 74cd1f7f1f88..dcdeef169a69 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -60,6 +60,7 @@ void ext4_ioend_wait(struct inode *inode) static void put_io_page(struct ext4_io_page *io_page) { if (atomic_dec_and_test(&io_page->p_count)) { + end_page_writeback(io_page->p_page); put_page(io_page->p_page); kmem_cache_free(io_page_cachep, io_page); } @@ -233,9 +234,9 @@ static void ext4_end_bio(struct bio *bio, int error) } while (bh != head); } - if (atomic_read(&io_end->pages[i]->p_count) == 1) - end_page_writeback(io_end->pages[i]->p_page); + put_io_page(io_end->pages[i]); } + io_end->num_io_pages = 0; inode = io_end->inode; if (error) { @@ -427,8 +428,6 @@ int ext4_bio_write_page(struct ext4_io_submit *io, * PageWriteback bit from the page to prevent the system from * wedging later on. */ - if (atomic_read(&io_page->p_count) == 1) - end_page_writeback(page); put_io_page(io_page); return ret; } |