Re: [PATCH v4] ext3, ext4: make i signed in do_split()

From: Theodore Tso
Date: Fri Dec 05 2008 - 11:32:52 EST

On Tue, Dec 02, 2008 at 10:01:14PM +0100, Roel Kluin wrote:
> Andrew Morton wrote:
> > On Sat, 29 Nov 2008 04:40:42 -0500
> > roel kluin <roel.kluin@xxxxxxxxx> wrote:
> >
> >> unsigned i >= 0 is always true
> >> - for (i = count-1; i >= 0; i--) {
> >> + for (i = count-1; i < count; i--) {
> break;
> > A local variable called `i' should always have signed type. In fact,
> > it should have `int' type.
> You are right. although count is unsigned, dx_make_map() returns int, which is
> assigned to count, so this should fit in an int. (If you ack this, make sure to
> get this patch, and not one of the others.)

ACK. I'll take care of getting this into the patch queue. I'll
include both the ext3 and ext4 variants, since this one is simple
enough that it's highly unlikely to conflict with anything Andrew
might have in the -mm tree. This is also much more of a cleanup than
anything else, so I don't think we need to push it until the merge
window. (I *think* it might be possible for a 2k filesystems and
*very* long filenames we might possibly be able to trigger a
failure but it would be very hard to do, and it's been around for a
very long time without anyone complaining about an actual real-life
problem getting trigger.)

- Ted
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at