Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932476AbWJ3UEA (ORCPT ); Mon, 30 Oct 2006 15:04:00 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932478AbWJ3UEA (ORCPT ); Mon, 30 Oct 2006 15:04:00 -0500 Received: from mail.parknet.jp ([210.171.160.80]:44039 "EHLO parknet.jp") by vger.kernel.org with ESMTP id S932476AbWJ3UD7 (ORCPT ); Mon, 30 Oct 2006 15:03:59 -0500 X-AuthUser: hirofumi@parknet.jp To: akpm@osdl.org, Trond.Myklebust@netapp.com, miklos@szeredi.hu, sfrench@us.ibm.com, cluster-devel@redhat.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/4] Cleanup read_pages() From: OGAWA Hirofumi Date: Tue, 31 Oct 2006 05:03:48 +0900 Message-ID: <8764e1muzf.fsf@duaron.myhome.or.jp> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1055 Lines: 30 Current read_pages() assume ->readpages() frees the passed pages. This patch free the pages in ->read_pages(), if those were remaining in the pages_list. So, readpages() just can ignore the remaining pages in pages_list. Signed-off-by: OGAWA Hirofumi --- mm/readahead.c | 2 ++ 1 file changed, 2 insertions(+) diff -puN mm/readahead.c~readpages-fixes mm/readahead.c --- linux-2.6/mm/readahead.c~readpages-fixes 2006-10-31 04:45:38.000000000 +0900 +++ linux-2.6-hirofumi/mm/readahead.c 2006-10-31 04:46:37.000000000 +0900 @@ -167,6 +167,8 @@ static int read_pages(struct address_spa if (mapping->a_ops->readpages) { ret = mapping->a_ops->readpages(filp, mapping, pages, nr_pages); + /* Clean up the remaining pages */ + put_pages_list(pages); goto out; } _ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/