From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sat, 14 Jul 2007 12:24:41 +0200 From: Nick Piggin Subject: [patch 4/4] hostfs convert to new aops fix Message-ID: <20070714102441.GD12215@wotan.suse.de> References: <20070714102111.GA12215@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070714102111.GA12215@wotan.suse.de> Sender: owner-linux-mm@kvack.org Return-Path: To: Andrew Morton Cc: Linux Memory Management List , Hugh Dickins List-ID: Fix lock ordering for hostfs. It seems that this filesystem may not be vulnerable to the bug, given that it implements its own writepage, but it is better to retain the safe ordering. Signed-off-by: Hugh Dickins Signed-off-by: Nick Piggin Index: linux-2.6/fs/hostfs/hostfs_kern.c =================================================================== --- linux-2.6.orig/fs/hostfs/hostfs_kern.c +++ linux-2.6/fs/hostfs/hostfs_kern.c @@ -16,6 +16,7 @@ #include #include #include +#include /* mark_page_accessed */ #include #include "hostfs.h" #include "kern_util.h" @@ -493,14 +494,15 @@ int hostfs_write_end(struct file *file, if (!PageUptodate(page) && err == PAGE_CACHE_SIZE) SetPageUptodate(page); - unlock_page(page); - page_cache_release(page); /* If err > 0, write_file has added err to pos, so we are comparing * i_size against the last byte written. */ if (err > 0 && (pos > inode->i_size)) inode->i_size = pos; + unlock_page(page); + mark_page_accessed(page); + page_cache_release(page); return err; } -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org