From b7d0293edc152526ae5689a39069ebec6d186fab Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Sun, 25 Nov 2007 18:32:31 -0500 Subject: [PATCH] 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 --- fs/unionfs/mmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/unionfs/mmap.c b/fs/unionfs/mmap.c index bfd2cadfdd0..9553dac4996 100644 --- a/fs/unionfs/mmap.c +++ b/fs/unionfs/mmap.c @@ -104,6 +104,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); wbc->for_writepages = saved_for_writepages; /* restore value */ if (err < 0) -- 2.43.0