Unionfs: call wait_on_page_writeback before clear_page_dirty_for_io
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 27 Nov 2007 00:16:22 +0000 (19:16 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 27 Nov 2007 00:16:22 +0000 (19:16 -0500)
CC: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/mmap.c

index 21d0a55313c7dc9a266b3a0505da3af037b277d4..a37381111240b534c63eef27234f058cfffdb9e9 100644 (file)
@@ -103,8 +103,8 @@ static int unionfs_writepage(struct page *page, struct writeback_control *wbc)
                wbc->for_writepages = 0;
 
        BUG_ON(!lower_mapping->a_ops->writepage);
-       clear_page_dirty_for_io(lower_page); /* emulate VFS behavior */
        wait_on_page_writeback(lower_page); /* prevent multiple writers */
+       clear_page_dirty_for_io(lower_page); /* emulate VFS behavior */
        err = lower_mapping->a_ops->writepage(lower_page, wbc);
        wbc->for_writepages = saved_for_writepages; /* restore value */
        if (err < 0)