From: David Sterba <dsterba@suse.cz>
To: Liu Bo <bo.li.liu@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v3] Btrfs: avoid losing data raid profile when deleting a device
Date: Fri, 5 Jan 2018 19:14:01 +0100 [thread overview]
Message-ID: <20180105181401.GS3553@twin.jikos.cz> (raw)
In-Reply-To: <20171115232811.9756-1-bo.li.liu@oracle.com>
On Wed, Nov 15, 2017 at 04:28:11PM -0700, Liu Bo wrote:
> We've avoided data losing raid profile when doing balance, but it
> turns out that deleting a device could also result in the same
> problem.
>
> Say we have 3 disks, and they're created with '-d raid1' profile.
>
> - We have chunk P (the only data chunk on the empty btrfs).
>
> - Suppose that chunk P's two raid1 copies reside in disk A and disk B.
>
> - Now, 'btrfs device remove disk B'
> btrfs_rm_device()
> -> btrfs_shrink_device()
> -> btrfs_relocate_chunk() #relocate any chunk on disk B
> to other places.
>
> - Chunk P will be removed and a new chunk will be created to hold
> those data, but as chunk P is the only one holding raid1 profile,
> after it goes away, the new chunk will be created as single profile
> which is our default profile.
>
> This fixes the problem by creating an empty data chunk before
> relocating the data chunk.
>
> Metadata/System chunk are supposed to have non-zero bytes all the time
> so their raid profile is preserved.
>
> Reported-by: James Alandt <James.Alandt@wdc.com>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Added to 4.16 queue, thanks.
prev parent reply other threads:[~2018-01-05 18:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-09 18:01 [PATCH] Btrfs: avoid losing data raid profile when deleting a device Liu Bo
2017-10-10 6:57 ` Nikolay Borisov
2017-10-10 17:39 ` Liu Bo
2017-10-10 17:53 ` [PATCH v2] " Liu Bo
2017-10-11 7:38 ` Nikolay Borisov
2017-10-13 20:51 ` Liu Bo
2017-10-16 4:22 ` Anand Jain
2017-10-16 17:26 ` Liu Bo
2017-10-16 8:53 ` Nikolay Borisov
2017-10-30 18:43 ` Liu Bo
2017-11-15 23:28 ` [PATCH v3] " Liu Bo
2018-01-05 18:14 ` David Sterba [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=20180105181401.GS3553@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=bo.li.liu@oracle.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.