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

index beae41f0af8a5c1172801ba2a99b238a8ed00cff..a9d785c3ed358f1b0bbff9bfd8a21584db97fee7 100644 (file)
@@ -99,8 +99,8 @@ static int unionfs_writepage(struct page *page, struct writeback_control *wbc)
        }
 
        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);
        if (err < 0)
                goto out_release;