All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] fix leak with bounced bio's
Date: Thu, 9 Sep 2004 10:42:04 +0200	[thread overview]
Message-ID: <20040909084204.GO1737@suse.de> (raw)

Hi,

This might fix the last leak of memory reported with cd writing, the
current highmem bounce code will leak n-1 pages for any n page bio where
n > 1. CD writing typically uses 16 pages bios, so it is affected.

===== mm/highmem.c 1.51 vs edited =====
--- 1.51/mm/highmem.c	2004-07-29 06:58:32 +02:00
+++ edited/mm/highmem.c	2004-09-08 21:18:57 +02:00
@@ -284,7 +284,7 @@
 	struct bio_vec *tovec, *fromvec;
 	int i;
 
-	bio_for_each_segment(tovec, to, i) {
+	__bio_for_each_segment(tovec, to, i, 0) {
 		fromvec = from->bi_io_vec + i;
 
 		/*
@@ -316,7 +316,7 @@
 	/*
 	 * free up bounce indirect pages used
 	 */
-	bio_for_each_segment(bvec, bio, i) {
+	__bio_for_each_segment(bvec, bio, i, 0) {
 		org_vec = bio_orig->bi_io_vec + i;
 		if (bvec->bv_page == org_vec->bv_page)
 			continue;

-- 
Jens Axboe


             reply	other threads:[~2004-09-09  8:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-09  8:42 Jens Axboe [this message]
2004-09-09 14:34 ` [PATCH] fix leak with bounced bio's Frank Steiner
2004-09-09 14:36   ` Jens Axboe

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=20040909084204.GO1737@suse.de \
    --to=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.