linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3.1 0/7] Chunk level degradable check
@ 2017-03-09  1:34 Qu Wenruo
  2017-03-09  1:34 ` [PATCH v3.1 1/7] btrfs: Introduce a function to check if all chunks a OK for degraded rw mount Qu Wenruo
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Qu Wenruo @ 2017-03-09  1:34 UTC (permalink / raw)
  To: linux-btrfs, anand.jain

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 kernel
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 prevent btrfs to mount.
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.


Qu Wenruo (7):
  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: Introduce extra_rw_degrade_errors parameter for
    btrfs_check_rw_degradable
  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 |  87 ++++++-----------------------
 fs/btrfs/disk-io.h |   2 -
 fs/btrfs/super.c   |   5 +-
 fs/btrfs/volumes.c | 158 +++++++++++++++++++++++++++++++++++++++++++++--------
 fs/btrfs/volumes.h |  37 +++++++++++++
 6 files changed, 190 insertions(+), 101 deletions(-)

-- 
2.12.0




^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-06-27 12:22 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-09  1:34 [PATCH v3.1 0/7] Chunk level degradable check Qu Wenruo
2017-03-09  1:34 ` [PATCH v3.1 1/7] btrfs: Introduce a function to check if all chunks a OK for degraded rw mount Qu Wenruo
2017-03-13  7:29   ` Anand Jain
2017-03-13  7:25     ` Qu Wenruo
2017-05-01 10:21       ` Dmitrii Tcvetkov
2017-05-02  0:20         ` Qu Wenruo
2017-05-02  2:28           ` Anand Jain
2017-03-09  1:34 ` [PATCH v3.1 2/7] btrfs: Do chunk level rw degrade check at mount time Qu Wenruo
2017-03-09  1:34 ` [PATCH v3.1 3/7] btrfs: Do chunk level degradation check for remount Qu Wenruo
2017-03-09  1:34 ` [PATCH v3.1 4/7] btrfs: Introduce extra_rw_degrade_errors parameter for btrfs_check_rw_degradable Qu Wenruo
2017-03-09  1:34 ` [PATCH v3.1 5/7] btrfs: Allow barrier_all_devices to do chunk level device check Qu Wenruo
2017-03-13  8:00   ` Anand Jain
2017-03-09  1:34 ` [PATCH v3.1 6/7] btrfs: Cleanup num_tolerated_disk_barrier_failures Qu Wenruo
2017-03-09  1:34 ` [PATCH v3.1 7/7] btrfs: Enhance missing device kernel message Qu Wenruo
2017-06-26 18:59 ` [PATCH v3.1 0/7] Chunk level degradable check David Sterba
2017-06-27  1:05   ` Qu Wenruo
2017-06-27  1:59     ` Anand Jain
2017-06-27  2:49       ` Qu Wenruo
2017-06-27 11:20         ` Austin S. Hemmelgarn
2017-06-27 12:20           ` David Sterba

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).