From: Erez_Zadok Date: Tue, 31 Jul 2007 23:25:55 +0000 (-0400) Subject: Unionfs: mmap fixes to unionfs_writepage X-Git-Tag: unionfs-2.1.1~8 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=ee25eee7369a8222052193990656f1aef3b8ad65;p=unionfs-2.6.36.y.git Unionfs: mmap fixes to unionfs_writepage Don't call unlock_page on lower_page unless lower ->writepage failed. Signed-off-by: Erez Zadok --- diff --git a/fs/unionfs/mmap.c b/fs/unionfs/mmap.c index 145ba5becb5..8b04a462b81 100644 --- a/fs/unionfs/mmap.c +++ b/fs/unionfs/mmap.c @@ -110,8 +110,9 @@ static int unionfs_writepage(struct page *page, struct writeback_control *wbc) err = lower_inode->i_mapping->a_ops->writepage(lower_page, wbc); wbc->for_writepages = saved_for_writepages; /* restore value */ - /* b/c find_lock_page locked it */ - unlock_page(lower_page); + /* b/c find_lock_page locked it and ->writepage unlocks on success */ + if (err) + unlock_page(lower_page); /* b/c grab_cache_page increased refcnt */ page_cache_release(lower_page);