From: Dmitrii Tcvetkov <demfloro@demfloro.ru>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: <linux-btrfs@vger.kernel.org>, <dsterba@suse.cz>,
<ahferroin7@gmail.com>, <kilobyte@angband.pl>
Subject: Re: [PATCH v4 0/6] Chunk level degradable check
Date: Mon, 10 Jul 2017 21:11:50 +0300 [thread overview]
Message-ID: <20170710211150.7210ac36@fire> (raw)
In-Reply-To: <20170628054335.18806-1-quwenruo@cn.fujitsu.com>
On Wed, 28 Jun 2017 13:43:29 +0800
Qu Wenruo <quwenruo@cn.fujitsu.com> wrote:
> The patchset can be fetched from my github repo:
> https://github.com/adam900710/linux/tree/degradable
>
> The patchset is based on David's for-4.13-part1 branch.
>
> Btrfs currently uses num_tolerated_disk_barrier_failures to do global
> check for tolerated missing device.
>
> Although the one-size-fit-all solution is quite safe, it's too strict
> if data and metadata has different duplication level.
>
> For example, if one use Single data and RAID1 metadata for 2 disks, it
> means any missing device will make the fs unable to be degraded
> mounted.
>
> But in fact, some times all single chunks may be in the existing
> device and in that case, we should allow it to be rw degraded mounted.
>
> Such case can be easily reproduced using the following script:
> # mkfs.btrfs -f -m raid1 -d sing /dev/sdb /dev/sdc
> # wipefs -f /dev/sdc
> # mount /dev/sdb -o degraded,rw
>
> If using btrfs-debug-tree to check /dev/sdb, one should find that the
> data chunk is only in sdb, so in fact it should allow degraded mount.
>
> This patchset will introduce a new per-chunk degradable check for
> btrfs, allow above case to succeed, and it's quite small anyway.
>
> And enhance kernel error message for missing device, at least user
> can know what's making mount failed, other than meaningless
> "failed to read system chunk/chunk tree -5".
>
> v2:
> Update after almost 2 years.
> Add the last patch to enhance the kernel output, so user can know
> it's missing devices that prevents btrfs to be mounted.
> v3:
> Remove one duplicated missing device output
> Use the advice from Anand Jain, not to add new members in
> btrfs_device, but use a new structure extra_rw_degrade_errors, to
> record error when sending down/waiting device.
> v3.1:
> Reduce the critical section in btrfs_check_rw_degradable(), follow
> other caller to only acquire the lock when searching, as extent_map
> has refcount to avoid concurrency already.
> The modification itself won't affect the behavior, so tested-by
> tags are added to each patch.
> v4:
> Thanks Anand for this dev flush work, which makes us more easier to
> detect flush error in previous transaction.
> Now this patchset won't need to alloc memory, and can just use
> btrfs_device->last_flush_error to check if last flush finished
> correctly.
> New rebase, so old tested by tags are all removed, sorry guys.
>
> Qu Wenruo (6):
> btrfs: Introduce a function to check if all chunks a OK for degraded
> rw mount
> btrfs: Do chunk level rw degrade check at mount time
> btrfs: Do chunk level degradation check for remount
> btrfs: Allow barrier_all_devices to do chunk level device check
> btrfs: Cleanup num_tolerated_disk_barrier_failures
> btrfs: Enhance missing device kernel message
>
> fs/btrfs/ctree.h | 2 --
> fs/btrfs/disk-io.c | 81 ++++----------------------------------------
> fs/btrfs/disk-io.h | 2 --
> fs/btrfs/super.c | 3 +-
> fs/btrfs/volumes.c | 99
> +++++++++++++++++++++++++++++++++++++++++-------------
> fs/btrfs/volumes.h | 3 ++ 6 files changed, 85 insertions(+), 105
> deletions(-)
>
Tested on top of current mainline master (commit af3c8d98508d37541d4bf57f13a984a7f73a328c). Didn't find any regressions.
next prev parent reply other threads:[~2017-07-10 18:45 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-28 5:43 [PATCH v4 0/6] Chunk level degradable check Qu Wenruo
2017-06-28 5:43 ` [PATCH v4 1/6] btrfs: Introduce a function to check if all chunks a OK for degraded rw mount Qu Wenruo
2017-07-14 7:44 ` Nikolay Borisov
2017-07-14 8:19 ` Qu Wenruo
2017-07-18 16:29 ` David Sterba
2017-06-28 5:43 ` [PATCH v4 2/6] btrfs: Do chunk level rw degrade check at mount time Qu Wenruo
2017-06-28 5:43 ` [PATCH v4 3/6] btrfs: Do chunk level degradation check for remount Qu Wenruo
2017-06-28 5:43 ` [PATCH v4 4/6] btrfs: Allow barrier_all_devices to do chunk level device check Qu Wenruo
2017-06-28 5:43 ` [PATCH v4 5/6] btrfs: Cleanup num_tolerated_disk_barrier_failures Qu Wenruo
2017-06-28 5:43 ` [PATCH v4 6/6] btrfs: Enhance missing device kernel message Qu Wenruo
2017-06-28 13:54 ` [PATCH v4 0/6] Chunk level degradable check David Sterba
2017-07-10 18:11 ` Dmitrii Tcvetkov [this message]
2017-07-13 0:50 ` David Sterba
2017-07-13 1:09 ` Adam Borowski
2017-07-13 12:12 ` Austin S. Hemmelgarn
2017-07-12 15:24 ` David Sterba
2017-07-12 23:53 ` Qu Wenruo
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=20170710211150.7210ac36@fire \
--to=demfloro@demfloro.ru \
--cc=ahferroin7@gmail.com \
--cc=dsterba@suse.cz \
--cc=kilobyte@angband.pl \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo@cn.fujitsu.com \
/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).