From: jing zhang <zj.barak@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: Xu Chang Ming <xcmhit@gmail.com>
Subject: [PATCH] memory leakage in ext4_ext_zeroout
Date: Sat, 13 Mar 2010 14:33:28 +0800 [thread overview]
Message-ID: <ac8f92701003122233i6e673351p692dbc2a452b2514@mail.gmail.com> (raw)
In-Reply-To: <1268402132.32032.13.camel@norville.austin.ibm.com>
From: Jing Zhang <zj.barak@gmail.com>
Date: Sat Mar 13 14:05:27 2010
When EIO occurs after bio is submitted, there is no memory free
operation for bio, which results in memory leakage. And there is also
no check against bio_alloc() for bio.
Cc: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Jing Zhang <zj.barak@gmail.com>
---
--- o/fs/ext4/extents.c 2010-03-13 13:47:22.000000000 +0800
+++ c/fs/ext4/extents.c 2010-03-13 13:54:36.000000000 +0800
@@ -2568,6 +2568,10 @@ static int ext4_ext_zeroout(struct inode
len = ee_len;
bio = bio_alloc(GFP_NOIO, len);
+ if (! bio) {
+ ret = -ENOMEM;
+ break;
+ }
bio->bi_sector = ee_pblock;
bio->bi_bdev = inode->i_sb->s_bdev;
@@ -2598,6 +2602,7 @@ static int ext4_ext_zeroout(struct inode
if (test_bit(BIO_UPTODATE, &bio->bi_flags))
ret = 0;
else {
+ bio_put(bio);
ret = -EIO;
break;
}
next parent reply other threads:[~2010-03-13 6:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <ac8f92701003110542p6c11ad77l285091cf28928660@mail.gmail.com>
[not found] ` <1268402132.32032.13.camel@norville.austin.ibm.com>
2010-03-13 6:33 ` jing zhang [this message]
2010-03-22 1:02 ` [PATCH] memory leakage in ext4_ext_zeroout tytso
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=ac8f92701003122233i6e673351p692dbc2a452b2514@mail.gmail.com \
--to=zj.barak@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=xcmhit@gmail.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;
as well as URLs for NNTP newsgroup(s).