direct IO write memory leak?

From: IWAMOTO Toshihiro
Date: Thu Oct 28 2004 - 05:36:56 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/