From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964976AbXBOHbr (ORCPT ); Thu, 15 Feb 2007 02:31:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964972AbXBOHb3 (ORCPT ); Thu, 15 Feb 2007 02:31:29 -0500 Received: from ns2.suse.de ([195.135.220.15]:45311 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964975AbXBOHb0 (ORCPT ); Thu, 15 Feb 2007 02:31:26 -0500 From: Nick Piggin To: Andrew Morton Cc: Linux Kernel , Nick Piggin , Linux Memory Management Message-Id: <20070215051842.7443.65926.sendpatchset@linux.site> In-Reply-To: <20070215051822.7443.30110.sendpatchset@linux.site> References: <20070215051822.7443.30110.sendpatchset@linux.site> Subject: [patch 2/3] fs: buffer don't PageUptodate without page locked Date: Thu, 15 Feb 2007 08:31:22 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org __block_write_full_page is calling SetPageUptodate without the page locked. This is unusual, but not incorrect, as PG_writeback is still set. However the next patch will require that SetPageUptodate always be called with the page locked. Simply don't bother setting the page uptodate in this case (it is unusual that the write path does such a thing anyway). Instead just leave it to the read side to bring the page uptodate when it notices that all buffers are uptodate. Signed-off-by: Nick Piggin fs/buffer.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) Index: linux-2.6/fs/buffer.c =================================================================== --- linux-2.6.orig/fs/buffer.c +++ linux-2.6/fs/buffer.c @@ -1698,17 +1698,8 @@ done: * clean. Someone wrote them back by hand with * ll_rw_block/submit_bh. A rare case. */ - int uptodate = 1; - do { - if (!buffer_uptodate(bh)) { - uptodate = 0; - break; - } - bh = bh->b_this_page; - } while (bh != head); - if (uptodate) - SetPageUptodate(page); end_page_writeback(page); + /* * The page and buffer_heads can be released at any time from * here on. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Message-Id: <20070215051842.7443.65926.sendpatchset@linux.site> In-Reply-To: <20070215051822.7443.30110.sendpatchset@linux.site> References: <20070215051822.7443.30110.sendpatchset@linux.site> Subject: [patch 2/3] fs: buffer don't PageUptodate without page locked Date: Thu, 15 Feb 2007 08:31:22 +0100 (CET) Sender: owner-linux-mm@kvack.org Return-Path: To: Andrew Morton Cc: Linux Kernel , Nick Piggin , Linux Memory Management List-ID: __block_write_full_page is calling SetPageUptodate without the page locked. This is unusual, but not incorrect, as PG_writeback is still set. However the next patch will require that SetPageUptodate always be called with the page locked. Simply don't bother setting the page uptodate in this case (it is unusual that the write path does such a thing anyway). Instead just leave it to the read side to bring the page uptodate when it notices that all buffers are uptodate. Signed-off-by: Nick Piggin fs/buffer.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) Index: linux-2.6/fs/buffer.c =================================================================== --- linux-2.6.orig/fs/buffer.c +++ linux-2.6/fs/buffer.c @@ -1698,17 +1698,8 @@ done: * clean. Someone wrote them back by hand with * ll_rw_block/submit_bh. A rare case. */ - int uptodate = 1; - do { - if (!buffer_uptodate(bh)) { - uptodate = 0; - break; - } - bh = bh->b_this_page; - } while (bh != head); - if (uptodate) - SetPageUptodate(page); end_page_writeback(page); + /* * The page and buffer_heads can be released at any time from * here on. -- 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