From: Josef Bacik <jbacik@fusionio.com>
To: Stefan Behrens <sbehrens@giantdisaster.de>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH RESEND] Btrfs: fix wrong write offset when replacing a device
Date: Fri, 5 Jul 2013 08:32:41 -0400 [thread overview]
Message-ID: <20130705123241.GD2260@localhost.localdomain> (raw)
In-Reply-To: <1372947263-823-1-git-send-email-sbehrens@giantdisaster.de>
On Thu, Jul 04, 2013 at 04:14:23PM +0200, Stefan Behrens wrote:
> Miao Xie reported the following issue:
>
> The filesystem was corrupted after we did a device replace.
>
> Steps to reproduce:
> # mkfs.btrfs -f -m single -d raid10 <device0>..<device3>
> # mount <device0> <mnt>
> # btrfs replace start -rfB 1 <device4> <mnt>
> # umount <mnt>
> # btrfsck <device4>
>
> The reason for the issue is that we changed the write offset by mistake,
> introduced by commit 625f1c8dc.
>
> We read the data from the source device at first, and then write the
> data into the corresponding place of the new device. In order to
> implement the "-r" option, the source location is remapped using
> btrfs_map_block(). The read takes place on the mapped location, and
> the write needs to take place on the unmapped location. Currently
> the write is using the mapped location, and this commit changes it
> back by undoing the change to the write address that the aforementioned
> commit added by mistake.
>
I'd like to see a xfstest for this please so we can make sure something like
this doesn't happen in the future. You can use SCRATCH_DEV_POOL to have
multiple devices. Please cc linux-btrfs when you submit it so I can review it
and hopefully get it in faster. Thanks,
Josef
prev parent reply other threads:[~2013-07-05 12:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-04 14:14 [PATCH RESEND] Btrfs: fix wrong write offset when replacing a device Stefan Behrens
2013-07-05 8:57 ` Miao Xie
2013-07-05 12:32 ` Josef Bacik [this message]
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=20130705123241.GD2260@localhost.localdomain \
--to=jbacik@fusionio.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=sbehrens@giantdisaster.de \
/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;
as well as URLs for NNTP newsgroup(s).