fs/mpage.c: fix mpage_writepage() for pages with buffers
[muen/linux.git] / fs / block_dev.c
index 93d088ffc05c679c7f0f35b847eb1d4341fc3761..789f55e851aeffb6b1212403188638d12a1d2540 100644 (file)
@@ -716,10 +716,12 @@ int bdev_write_page(struct block_device *bdev, sector_t sector,
 
        set_page_writeback(page);
        result = ops->rw_page(bdev, sector + get_start_sect(bdev), page, true);
 
        set_page_writeback(page);
        result = ops->rw_page(bdev, sector + get_start_sect(bdev), page, true);
-       if (result)
+       if (result) {
                end_page_writeback(page);
                end_page_writeback(page);
-       else
+       } else {
+               clean_page_buffers(page);
                unlock_page(page);
                unlock_page(page);
+       }
        blk_queue_exit(bdev->bd_queue);
        return result;
 }
        blk_queue_exit(bdev->bd_queue);
        return result;
 }