Re: [PATCH] Linux Raid5/6 abover 2 Terabytes

From: Andreas Schwab
Date: Tue Apr 06 2004 - 18:07:24 EST


Evan Felix <evan.felix@xxxxxxx> writes:

> Here is a patch that fixes a major issue in the raid5/6 code. It seems
> that the code:
>
> logical_sector = bi->bi_sector & ~(STRIPE_SECTORS-1);
> (sector_t) = (sector_t) & (constant)
>
> that the right side of the & does not get extended correctly when the
> constant is promoted to the sector_t type. I have CONFIG_LBD turned on
> so sector_t should be 64bits wide. This fails to properly mask the
> value of 4294967296 (2TB/512) to 4294967296. in my case it was coming
> out 0. this cause the loop following this code to read from 0 to
> 4294967296 blocks so it could write one character.
>
> As you might imagine this makes a format of a 3.5TB filesystem take a
> very long time.
>
> Here is the patch:

Alternatively replace ~(STRIPE_SECTORS-1) by -STRIPE_SECTORS, which
doesn't need a cast.

Andreas.

--
Andreas Schwab, SuSE Labs, schwab@xxxxxxx
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/