public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] minor bugfix agains ext2
@ 2003-03-12 15:57 Alex Tomas
  0 siblings, 0 replies; only message in thread
From: Alex Tomas @ 2003-03-12 15:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: ext2-devel, Andrew Morton, Alex Tomas


Hi!

looks like following code in 2.5.64 has bug:

        for (bit = 0; !group_alloc &&
                        bit < sbi->s_groups_count; bit++) {
                group_no++;
                if (group_no >= sbi->s_groups_count)
                        group_no = 0;
                desc = ext2_get_group_desc(sb, group_no, &gdp_bh);
                if (!desc)
                        goto io_error;
                group_alloc = group_reserve_blocks(desc, gdp_bh, es_alloc);
        }
        if (bit >= sbi->s_groups_count) {
                *err = -ENOSPC;
                goto out_release;
        }

if group_reserve_blocks() finds free blocks on last repeat then if (bit >= ...)
will be true, and ext2_new_block() will return -ENOSPC.


here is the patch:

--- linux/fs/ext2/balloc.c	Thu Feb 20 16:18:53 2003
+++ balloc.c	Wed Mar 12 18:47:21 2003
@@ -395,7 +395,7 @@
 			goto io_error;
 		group_alloc = group_reserve_blocks(desc, gdp_bh, es_alloc);
 	}
-	if (bit >= sbi->s_groups_count) {
+	if (!group_alloc) {
 		*err = -ENOSPC;
 		goto out_release;
 	}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-12 15:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-12 15:57 [PATCH] minor bugfix agains ext2 Alex Tomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox