Unionfs: mmap fixes to unionfs_writepage
authorErez_Zadok <ezk@cs.sunysb.edu>
Tue, 31 Jul 2007 23:25:55 +0000 (19:25 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Wed, 6 Jan 2010 03:43:04 +0000 (22:43 -0500)
Don't call unlock_page on lower_page unless lower ->writepage failed.

Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/mmap.c

index 145ba5becb57e0bded9ea9220055804eb794a169..8b04a462b81772884aebfe45a3dba36f67817790 100644 (file)
@@ -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);