2008-12-28 10:00:15

by Christian Kujau

[permalink] [raw]
Subject: Free blocks count wrong following shrink with resize2fs

Since I'm not *entirely* sure if this is related to the the extent header
issue[0], I thought I just report it:

When shrinking a filesystem with resize2fs, fsck.ext4 (1.41.3,
12-Oct-2008) reports:

------------
Pass 5: Checking group summary information
Block bitmap differences: -(2488--2493) -(149959--151395)
Fix<y>? yes
Free blocks count wrong for group #0 (3188, counted=3194).
Fix<y>? yes
Free blocks count wrong for group #4 (10182, counted=11619).
Fix<y>? yes
Free blocks count wrong (26225, counted=27668).
Fix<y>? yes
-----------

After this, the filesystem is perfectly fine though, no corruptions have
been noticed yet. I'm even able to mount it without running fsck after the
resize2fs. I've put a few more details here:

http://nerdbynature.de/bits/2.6.28/

Thanks,
Christian.
[0] http://thread.gmane.org/gmane.comp.file-systems.ext4/10736


PS: As my rootfs is also on ext4, I noticed another, completely unrelated oddity:

[ 1.604198] Using IPI Shortcut mode
[ 1.608394] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
[ 1.737198] EXT3-fs: hda1: couldn't mount because of unsupported optional features (240).
[ 1.754302] EXT4-fs: barriers enabled
[ 1.773267] kjournald2 starting. Commit interval 5 seconds

...this is befor INIT starts, so who's trying to mount "/" as ext3 first?

--
BOFH excuse #55:

Plumber mistook routing panel for decorative wall fixture


2008-12-28 22:17:17

by Theodore Ts'o

[permalink] [raw]
Subject: Re: Free blocks count wrong following shrink with resize2fs

On Sun, Dec 28, 2008 at 11:00:11AM +0100, Christian Kujau wrote:
> Since I'm not *entirely* sure if this is related to the the extent header
> issue[0], I thought I just report it:
>
> When shrinking a filesystem with resize2fs, fsck.ext4 (1.41.3,
> 12-Oct-2008) reports:
>
> ------------
> Pass 5: Checking group summary information
> Block bitmap differences: -(2488--2493) -(149959--151395)
> Fix<y>? yes
> Free blocks count wrong for group #0 (3188, counted=3194).
> Fix<y>? yes
> Free blocks count wrong for group #4 (10182, counted=11619).
> Fix<y>? yes
> Free blocks count wrong (26225, counted=27668).
> Fix<y>? yes
> -----------

It's a separate problem, but thanks, I know about it. This one is
relatively harmless; it's caused by resize2fs assuming that the
metadata blocks for block group N are in block group N, which is not
true if flex_bg is enabled. It's very much related to the bug which
causes resize2fs -M to not function correctly.

The net result is the blocks that should be released as being free
aren't, which is what causes the e2fsck errors, which can be easily
corrected. It doesn't cause any other problems, though.

> PS: As my rootfs is also on ext4, I noticed another, completely unrelated oddity:
>
> [ 1.604198] Using IPI Shortcut mode
> [ 1.608394] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
> [ 1.737198] EXT3-fs: hda1: couldn't mount because of unsupported optional features (240).
> [ 1.754302] EXT4-fs: barriers enabled
> [ 1.773267] kjournald2 starting. Commit interval 5 seconds
>
> ...this is befor INIT starts, so who's trying to mount "/" as ext3 first?

This is normal; the kernel simply tries to mount the filesystem using
ext3 first, so that the ext4 code only gets used for filesystems that
enable the new ext4 features. The kernel isn't particularly smart
about doing filesystem type detection; it simply tries to mount the
root filesystem using a ordered list of filesystem until one of them
works.

- Ted

2008-12-29 06:23:51

by Christian Kujau

[permalink] [raw]
Subject: Re: Free blocks count wrong following shrink with resize2fs

On Sun, 28 Dec 2008, Theodore Tso wrote:
> The net result is the blocks that should be released as being free
> aren't, which is what causes the e2fsck errors, which can be easily
> corrected. It doesn't cause any other problems, though.

Aha, thanks for the explanation. I was just playing around with resize2fs,
so no real data was at stake in this case anyway...

>> [ 1.737198] EXT3-fs: hda1: couldn't mount because of unsupported optional features (240).
>> [ 1.754302] EXT4-fs: barriers enabled
>
> This is normal; the kernel simply tries to mount the filesystem using
> ext3 first, so that the ext4 code only gets used for filesystems that

Ah, I see. When I disabled EXT3* in my .config, the kernel starts with
EXT4 and the "error" goes away...

Btw, ext4 feels pretty neat already, with vanilla kernel and userland
tools, no patches applied ...just like a *real* filesystem - great! :-)

Christian.
--
BOFH excuse #259:

Someone's tie is caught in the printer, and if anything else gets printed, he'll be in it too.