From: Erez Zadok Date: Sun, 25 Nov 2007 19:51:56 +0000 (-0500) Subject: Unionfs: prevent multiple writers to lower_page X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=6355ac7cb3f0f107c5a21a3529ce3fada244e383;p=unionfs-3.8.y.git Unionfs: prevent multiple writers to lower_page Without this patch, the LTP fs test "rwtest04" triggers a BUG_ON(PageWriteback(page)) in fs/buffer.c:1706. CC: Hugh Dickins Signed-off-by: Erez Zadok --- diff --git a/fs/unionfs/mmap.c b/fs/unionfs/mmap.c index 623a91362ff..ea5ef3d5901 100644 --- a/fs/unionfs/mmap.c +++ b/fs/unionfs/mmap.c @@ -73,6 +73,7 @@ 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 */ err = lower_mapping->a_ops->writepage(lower_page, wbc); if (err < 0) goto out_release;