From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Alan Cox <alan@redhat.com>, Linus Torvalds <torvalds@transmeta.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
NFS maillist <nfs@lists.sourceforge.net>
Subject: [2.4.5]Patch - fix page leak in nfs_prepare_write()
Date: Sat, 23 Jun 2001 01:53:20 +0200 [thread overview]
Message-ID: <15155.55920.648446.700067@charged.uio.no> (raw)
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;
reply other threads:[~2001-06-22 23:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15155.55920.648446.700067@charged.uio.no \
--to=trond.myklebust@fys.uio.no \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nfs@lists.sourceforge.net \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®