From: Liu Bo <bo.li.liu@oracle.com>
To: fdmanana@kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/2] btrfs-progs: Fix restoring image from multi devices fs into single device
Date: Thu, 18 May 2017 17:11:35 -0700 [thread overview]
Message-ID: <20170519001135.GG23822@lim.localdomain> (raw)
In-Reply-To: <20170517014121.8499-1-fdmanana@kernel.org>
On Wed, May 17, 2017 at 02:41:21AM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> We correctly build an image from a multiple devices filesystem but when
> restoring the image into a single device we were missing updating the
> number of devices in the superblock to the value 1 (we already took care
> of setting the number of stripes to 1 for each chunk item and setting
> the device id for each chunk item to match the device id from the super
> block).
>
> This missing update of the number of devices makes it impossible to mount
> the restored filesystem on recent kernels, more specifically since the
> linux kernel commit 99e3ecfcb9f4ca35192d20a5bea158b81f600062
> ("Btrfs: add more validation checks for superblock"), that produce the
> following message in the dmesg/syslog:
>
> [21097.542047] BTRFS error (device sdi): super_num_devices 2 mismatch with num_devices 1 found here
> [21097.543972] BTRFS error (device sdi): failed to read chunk tree: -22
> [21097.720360] BTRFS error (device sdi): open_ctree failed
>
> So fix this by updating the number of devices to 1 in the superblock.
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Looks good.
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Thanks,
-liubo
next prev parent reply other threads:[~2017-05-19 0:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-17 1:41 [PATCH 1/2] btrfs-progs: Fix restoring image from multi devices fs into single device fdmanana
2017-05-19 0:11 ` Liu Bo [this message]
2017-05-29 16:48 ` David Sterba
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=20170519001135.GG23822@lim.localdomain \
--to=bo.li.liu@oracle.com \
--cc=fdmanana@kernel.org \
--cc=linux-btrfs@vger.kernel.org \
/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