From: Vasily Averin <vvs@sw.ru>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
devel@openvz.org, linux-ext4@vger.kernel.org,
Stephen Tweedie <sct@redhat.com>,
adilger@clusterfs.com
Subject: [PATCH ext3/ext4] lost brelse in ext3_read_inode
Date: Sat, 02 Jun 2007 16:40:13 +0400 [thread overview]
Message-ID: <4661652D.9040404@sw.ru> (raw)
From: Kirill Korotaev <dev@openvz.org>
One of error path in ext3_read_inode() leaks bh since brelse is forgoten.
Signed-Off-By: Kirill Korotaev <dev@openvz.org>
Acked-by: Vasily Averin <vvs@sw.ru>
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index a6cb617..2a85dde 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -2677,8 +2677,10 @@ void ext3_read_inode(struct inode * inode)
*/
ei->i_extra_isize = le16_to_cpu(raw_inode->i_extra_isize);
if (EXT3_GOOD_OLD_INODE_SIZE + ei->i_extra_isize >
- EXT3_INODE_SIZE(inode->i_sb))
+ EXT3_INODE_SIZE(inode->i_sb)) {
+ brelse (bh);
goto bad_inode;
+ }
if (ei->i_extra_isize == 0) {
/* The extra space is currently unused. Use it. */
ei->i_extra_isize = sizeof(struct ext3_inode) -
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index b34182b..0cd7bc4 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2673,8 +2673,10 @@ void ext4_read_inode(struct inode * inode)
*/
ei->i_extra_isize = le16_to_cpu(raw_inode->i_extra_isize);
if (EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize >
- EXT4_INODE_SIZE(inode->i_sb))
+ EXT4_INODE_SIZE(inode->i_sb)) {
+ brelse (bh);
goto bad_inode;
+ }
if (ei->i_extra_isize == 0) {
/* The extra space is currently unused. Use it. */
ei->i_extra_isize = sizeof(struct ext4_inode) -
reply other threads:[~2007-06-02 12:40 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=4661652D.9040404@sw.ru \
--to=vvs@sw.ru \
--cc=adilger@clusterfs.com \
--cc=akpm@linux-foundation.org \
--cc=devel@openvz.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sct@redhat.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