2012-06-06 14:29:57

by Bob Sullivan

[permalink] [raw]
Subject: file corruption in loop device in 3.4.0

We have a EXT3 filesystem contained in a file
(a disk image mapped to a file using loop device).
Using diff, observed random differences between
files on the image and a backup copies of those files.
This problem is reproducible,
tried booting several times with 3.3.8 and 3.4.0.
No problems on 3.3.8.
But every time on 3.4.0, randomly a few files showed corruption.
Some files that were corrupt become ok again after rebooting/remounting.
About 5% of the file contents was garbage, rest was correct, the file size was correct.

Seems to be a memory problem in 3.4.0?
chkdsk never showed any problem (in the disk image file).

Using Debian 6.? Ran memtest86+, chkdsk, badblocks -- no errors.
Disk image was created mkfs.ext3 with the smallest inode/block size.


2012-06-06 14:48:42

by Ming Lei

[permalink] [raw]
Subject: Re: file corruption in loop device in 3.4.0

On Wed, Jun 6, 2012 at 10:24 PM, Bob Sullivan <[email protected]> wrote:
> We have a EXT3 filesystem contained in a file
> (a disk image mapped to a file using loop device).
> Using diff, observed random differences between
> files on the image and a backup copies of those files.
> This problem is reproducible,
> tried booting several times with 3.3.8 and 3.4.0.
> No problems on 3.3.8.

A bit different with me, no problems on 3.4, but have problems on 3.5-rc1.

I can easily reproduce the problem, just kernel boot and mount
rootfs(ext4), then
reboot again and found there are many rootfs errors as below, see attachment
for fsck check result.

[ 22.451385] EXT4-fs error (device mmcblk0p2):
ext4_mb_generate_buddy:741: group 2, 0 clusters in bitmap, 1 in gd
[ 23.263092] JBD2: Spotted dirty metadata buffer (dev = mmcblk0p2,
blocknr = 0). There's a risk of filesystem corruption in case of
system crash.


BTW: I use mmc card to store rootfs and test it on OMAP3 based beagle-xm board.

Thanks,
--
Ming Lei


Attachments:
ext4.txt (10.02 kB)