[Patch 3/10]: ext3 online resize: fix bh leak
From: Stephen Tweedie (sct_at_redhat.com)
Date: 09/30/04
- Previous message: Stephen Tweedie: "[Patch 0/10]: Cleanup online reservations for 2.6.9-rc2-mm4."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Sep 2004 14:23:29 +0100 To: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>, Andreas Dilger <adilger@clusterfs.com>, "Theodore Ts'o" <tytso@mit.edu>, ext2-devel@lists.sourceforge.net
Make sure that verify_group_input() brelse's the buffer we're verifying
in every case.
Signed-off-by: Stephen Tweedie <sct@redhat.com>
--- linux-2.6.9-rc2-mm4/fs/ext3/resize.c.=K0002=.orig
+++ linux-2.6.9-rc2-mm4/fs/ext3/resize.c
@@ -36,7 +36,7 @@ static int verify_group_input(struct sup
(1 + ext3_bg_num_gdb(sb, group) +
le16_to_cpu(es->s_reserved_gdt_blocks)) : 0;
unsigned metaend = start + overhead;
- struct buffer_head *bh;
+ struct buffer_head *bh = NULL;
int free_blocks_count;
int err = -EINVAL;
@@ -104,10 +104,9 @@ static int verify_group_input(struct sup
ext3_warning(sb, __FUNCTION__,
"Inode table (%u-%u) overlaps GDT table (%u-%u)",
input->inode_table, itend - 1, start, metaend - 1);
- else {
- brelse(bh);
+ else
err = 0;
- }
+ brelse(bh);
return err;
}
-
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/
- Previous message: Stephen Tweedie: "[Patch 0/10]: Cleanup online reservations for 2.6.9-rc2-mm4."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: [PATCH] speed up SATA
... write-cache-off queueing will be slightly slower than ... since most drives
have slightly stricter ... but an 8MB buffer doing 4K random-ops could ... 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/
... (Linux-Kernel) - Re: e1000 driver 2.6.18 - how to waste processor cycles
... if (skb already exists in ring buffer) ... send the line "unsubscribe linux-kernel"
in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please
read the FAQ at http://www.tux.org/lkml/ ... (Linux-Kernel) - Re: A problem about DIRECT IO on ext3
... fails if the offset or buffer is NOT filesystem blocksize ... So, its possible
that your buffer is atleast 512byte aligned, ... > soft/hard sector sizes. ...
send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: Lockless file reading
... > a 3-byte sequence to not be written when both ... > a buffer
of such data is controlled so a write ... writes aren't always in processor order (see
... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: x86, ARM, PARISC, PPC, MIPS and Sparc folks please run this
... write buffer and it isn't doing that. ... I'm saying that the bug can't
be that, because such a bug would affect ... > performance isn't viable in such many embedded
environments. ... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel)