Commit 53b56386 authored by Toshihiro Iwamoto's avatar Toshihiro Iwamoto Committed by Linus Torvalds

[PATCH] direct IO write memory leak fix

It seems that O_DIRECT write sometimes leaks memory.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent eec2e667
...@@ -844,8 +844,10 @@ static int do_direct_IO(struct dio *dio) ...@@ -844,8 +844,10 @@ static int do_direct_IO(struct dio *dio)
char *kaddr; char *kaddr;
/* AKPM: eargh, -ENOTBLK is a hack */ /* AKPM: eargh, -ENOTBLK is a hack */
if (dio->rw == WRITE) if (dio->rw == WRITE) {
page_cache_release(page);
return -ENOTBLK; return -ENOTBLK;
}
if (dio->block_in_file >= if (dio->block_in_file >=
i_size_read(dio->inode)>>blkbits) { i_size_read(dio->inode)>>blkbits) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment