lkml.org 
[lkml]   [2001]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[2.4.5]Patch - fix page leak in nfs_prepare_write()
From

Hi,

The following patch fixes a leak in high memory in case a
process is signalled while in nfs_prepare_write().

Cheers,
Trond

diff -u --recursive --new-file linux-2.4.6-mmap/fs/nfs/file.c linux-2.4.6-file/fs/nfs/file.c
--- linux-2.4.6-mmap/fs/nfs/file.c Tue May 22 18:26:06 2001
+++ linux-2.4.6-file/fs/nfs/file.c Fri Jun 22 18:43:34 2001
@@ -162,9 +162,18 @@
*/
static int nfs_prepare_write(struct file *file, struct page *page, unsigned offset, unsigned to)
{
+ int status;
+
kmap(page);
- return nfs_flush_incompatible(file, page);
+ status = nfs_flush_incompatible(file, page);
+ if (status)
+ goto out_err;
+ return 0;
+ out_err:
+ kunmap(page);
+ return status;
}
+
static int nfs_commit_write(struct file *file, struct page *page, unsigned offset, unsigned to)
{
long status;
-
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/
\
 
 \ /
  Last update: 2005-03-22 12:55    [W:0.030 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site