Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262946AbUJ1K37 (ORCPT ); Thu, 28 Oct 2004 06:29:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262891AbUJ1K3v (ORCPT ); Thu, 28 Oct 2004 06:29:51 -0400 Received: from sv1.valinux.co.jp ([210.128.90.2]:38632 "EHLO sv1.valinux.co.jp") by vger.kernel.org with ESMTP id S262946AbUJ1K3f (ORCPT ); Thu, 28 Oct 2004 06:29:35 -0400 Date: Thu, 28 Oct 2004 19:29:25 +0900 From: IWAMOTO Toshihiro To: akpm@osdl.org Cc: linux-kernel@vger.kernel.org Subject: direct IO write memory leak? User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Message-Id: <20041028102933.E99BE7046C@sv1.valinux.co.jp> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 844 Lines: 28 Hi, It seems that O_DIRECT write sometimes leaks memory. Is the following patch okay? It fixes the problem under my test environment, but I haven't checked the direct IO code in detail. --- linux-2.6.9/fs/direct-io.c 2004-10-19 06:54:32.000000000 +0900 +++ new/direct-io.c 2004-10-28 19:26:57.000000000 +0900 @@ -844,8 +844,10 @@ do_holes: char *kaddr; /* AKPM: eargh, -ENOTBLK is a hack */ - if (dio->rw == WRITE) + if (dio->rw == WRITE) { + page_cache_release(page); return -ENOTBLK; + } if (dio->block_in_file >= i_size_read(dio->inode)>>blkbits) { - 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/