public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Marc Thomas <marc@dragonfly.plus.com>, linux-ext4@vger.kernel.org
Subject: Re: e2fsck bug? - Sparse files corrupt after "e2fsck -E bmap2extent".
Date: Tue, 23 May 2017 09:25:21 -0700	[thread overview]
Message-ID: <20170523162521.GD4510@birch.djwong.org> (raw)
In-Reply-To: <20170523154152.glfcx7aryt5x4otj@thunk.org>

On Tue, May 23, 2017 at 11:41:52AM -0400, Theodore Ts'o wrote:
> On Tue, May 23, 2017 at 12:20:59AM +0100, Marc Thomas wrote:
> > Hi All,
> > 
> > Would you agree this is a bug? As I understand it, reading from an
> > "unpopulated" region of a sparse file should return all zeros - so the
> > md5sum should be the same before and after migration.
> 
> I agree that sparse files should be properly handled after bmap2extent
> conversion.  This code hasn't received that much use or testing, but
> I've tried to replicate the problem and I haven't succeeded.  This
> script works for me:
> 
> ----- cut here -----
> #!/bin/bash
> 
> rm -f /tmp/foo.img
> mke2fs -t ext3 -Fq /tmp/foo.img 65536
> 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
> lsattr /mnt/test*
> md5sum /mnt/test* > /mnt/MD5SUMS
> umount /mnt
> e2fsck -fy -E bmap2extent /tmp/foo.img
> mount -o loop /tmp/foo.img /mnt
> md5sum -c /mnt/MD5SUMS
> lsattr /mnt/test*
> umount /mnt
> ----- cut here -----
> 
> Maybe you can come up with a simple repro case that fails for you?

Or take an e2image of one of the affected filesystems so that the
developers can directly reproduce your error case. :)

e2image -Q /dev/sda1 /some/qcow/dump/file

(Preferably xz the dumpfile before uploading...)

--D

> 
> Thanks,
> 
> 						- Ted
> 						

  reply	other threads:[~2017-05-23 16:25 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 [this message]
2017-05-23 17:41   ` Marc Thomas
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=20170523162521.GD4510@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=marc@dragonfly.plus.com \
    --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