linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Btrfs: Per-chunk degradable check
@ 2015-09-21  2:10 Qu Wenruo
  2015-09-21  2:10 ` [PATCH 1/5] btrfs: Introduce a new function to check if all chunks a OK for degraded mount Qu Wenruo
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Qu Wenruo @ 2015-09-21  2:10 UTC (permalink / raw)
  To: linux-btrfs; +Cc: 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.

Also, it provides the possibility for later enhancement, like
automatically add 'degraded' mount option if possible.

Cc: Anand Jain <anand.jain@oracle.com>

Qu Wenruo (5):
  btrfs: Introduce a new function to check if all chunks a OK for
    degraded     mount
  btrfs: Do per-chunk check for mount time check
  btrfs: Do per-chunk degraded check for remount
  btrfs: Allow barrier_all_devices to do per-chunk device check
  btrfs: Cleanup num_tolerated_disk_barrier_failures

 fs/btrfs/ctree.h   |  2 --
 fs/btrfs/disk-io.c | 87 ++++++++++--------------------------------------------
 fs/btrfs/disk-io.h |  2 --
 fs/btrfs/super.c   | 11 ++++---
 fs/btrfs/volumes.c | 84 +++++++++++++++++++++++++++++++++++++++++-----------
 fs/btrfs/volumes.h |  5 ++++
 6 files changed, 94 insertions(+), 97 deletions(-)

-- 
2.5.2


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

end of thread, other threads:[~2016-04-18  8:48 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-21  2:10 [PATCH 0/5] Btrfs: Per-chunk degradable check Qu Wenruo
2015-09-21  2:10 ` [PATCH 1/5] btrfs: Introduce a new function to check if all chunks a OK for degraded mount Qu Wenruo
2016-04-18  8:47   ` [PATCH] btrfs: fix btrfs_check_degradable() to free extent map Anand Jain
2015-09-21  2:10 ` [PATCH 2/5] btrfs: Do per-chunk check for mount time check Qu Wenruo
2015-09-25  7:05   ` Anand Jain
2015-09-21  2:10 ` [PATCH 3/5] btrfs: Do per-chunk degraded check for remount Qu Wenruo
2015-09-25  6:54   ` Anand Jain
2015-09-25  8:08     ` Qu Wenruo
2015-09-25  8:30       ` Anand Jain
2015-09-25  8:34         ` Qu Wenruo
2015-09-25  8:24   ` [PATCH 1/1] " Anand Jain
2015-09-21  2:10 ` [PATCH 4/5] btrfs: Allow barrier_all_devices to do per-chunk device check Qu Wenruo
2015-10-30  8:32   ` Anand Jain
2015-10-30 11:41     ` Qu Wenruo
2015-10-30 23:52       ` Anand Jain
2015-09-21  2:10 ` [PATCH 5/5] btrfs: Cleanup num_tolerated_disk_barrier_failures Qu Wenruo
2015-11-05  0:57 ` [PATCH 0/5] Btrfs: Per-chunk degradable check Qu Wenruo

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