public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Thomas <marc@dragonfly.plus.com>
To: linux-ext4@vger.kernel.org
Cc: "Theodore Ts'o" <tytso@mit.edu>
Subject: Re: e2fsck bug? - Sparse files corrupt after "e2fsck -E bmap2extent".
Date: Tue, 23 May 2017 18:41:48 +0100	[thread overview]
Message-ID: <67373dc3-46e1-33e5-ea6f-940b82ad86b6@dragonfly.plus.com> (raw)
In-Reply-To: <20170523154152.glfcx7aryt5x4otj@thunk.org>

Hi Ted,

Firstly, thank-you for taking the time to look into this.

I have modified your script with a "test-case" which fails for me every
time, as I noticed there is a file created by a Linux kernel build which
exhibits the problem (arch/x86/realmode/rm/realmode.bin) I think any
kernel version 3.10.x on x86_64 ought to work. I've also included a few
extra steps which I'm doing as part of the ext3 to ext4 conversion, and
added the "-b" (binary) flag to md5sum.

Here's the script. I'm not sure if it counts as a "simple" repro! :)


----- cut here -----
#!/bin/bash

rm -f /tmp/foo.img
mke2fs -t ext3 -Fq /tmp/foo.img 5G
mount -o loop /tmp/foo.img /mnt
dd if=/etc/motd of=/mnt/test bs=4k >& /dev/null
dd if=/etc/motd of=/mnt/test conv=notrunc seek=32 bs=4k >& /dev/null
dd if=/etc/motd of=/mnt/test2 bs=4k >& /dev/null
dd if=/etc/motd of=/mnt/test2 conv=notrunc seek=1024 bs=4k >& /dev/null
md5sum -b /mnt/test* > /mnt/MD5SUMS
lsattr /mnt/test*
( cd /mnt
xz -dc ~marc/LinuxStuff/Linux4.x/linux-4.11.1.tar.xz | tar xvf -
cd linux-4.11.1
make defconfig
time make -j 15 ) > /dev/null 2>&1
md5sum -b /mnt/linux-4.11.1/arch/x86/realmode/rm/realmode.bin >>
/mnt/MD5SUMS
lsattr /mnt/linux-4.11.1/arch/x86/realmode/rm/realmode.bin
umount /mnt
tune2fs -O extents,uninit_bg,dir_index /tmp/foo.img
e2fsck -fy /tmp/foo.img
e2fsck -fy -E bmap2extent /tmp/foo.img
mount -o loop /tmp/foo.img /mnt
md5sum -c /mnt/MD5SUMS
lsattr /mnt/test*
lsattr /mnt/linux-4.11.1/arch/x86/realmode/rm/realmode.bin
umount /mnt
----- cut here -----


The output of the script is:

time ./marc2.sh
------------------- /mnt/test
------------------- /mnt/test2
------------------- /mnt/linux-4.11.1/arch/x86/realmode/rm/realmode.bin
tune2fs 1.43.4 (31-Jan-2017)
e2fsck 1.43.4 (31-Jan-2017)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/tmp/foo.img: 71184/327680 files (6.4% non-contiguous), 338237/1310720
blocks
e2fsck 1.43.4 (31-Jan-2017)
Pass 1: Checking inodes, blocks, and sizes
Pass 1E: Optimizing extent trees
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/tmp/foo.img: ***** FILE SYSTEM WAS MODIFIED *****
/tmp/foo.img: 71184/327680 files (6.4% non-contiguous), 334994/1310720
blocks
/mnt/test: OK
/mnt/test2: OK
/mnt/linux-4.11.1/arch/x86/realmode/rm/realmode.bin: FAILED
md5sum: WARNING: 1 computed checksum did NOT match
--------------e---- /mnt/test
--------------e---- /mnt/test2
--------------e---- /mnt/linux-4.11.1/arch/x86/realmode/rm/realmode.bin

real    1m46.829s
user    17m41.611s
sys     1m39.268s

Thanks & Kind Regards,
Marc

  parent reply	other threads:[~2017-05-23 17:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22 23:20 e2fsck bug? - Sparse files corrupt after "e2fsck -E bmap2extent" Marc Thomas
2017-05-23 15:41 ` Theodore Ts'o
2017-05-23 16:25   ` Darrick J. Wong
2017-05-23 17:41   ` Marc Thomas [this message]
2017-05-23 18:42     ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=67373dc3-46e1-33e5-ea6f-940b82ad86b6@dragonfly.plus.com \
    --to=marc@dragonfly.plus.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox