linux_dsm_epyc7002/fs/btrfs
Qu Wenruo 21634a19f6 btrfs: Introduce a function to check if all chunks a OK for degraded rw mount
Introduce a new function, btrfs_check_rw_degradable(), to check if all
chunks in btrfs is OK for degraded rw mount.

It provides the new basis for accurate btrfs mount/remount and even
runtime degraded mount check other than old one-size-fit-all method.

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.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ copied text from cover letter with more details about the problem being
  solved ]
Signed-off-by: David Sterba <dsterba@suse.com>
2017-08-16 16:12:02 +02:00
..
tests btrfs: remove unused sectorsize member 2017-08-16 14:19:53 +02:00
acl.c
async-thread.c btrfs: constify tracepoint arguments 2017-08-16 14:19:53 +02:00
async-thread.h btrfs: constify tracepoint arguments 2017-08-16 14:19:53 +02:00
backref.c btrfs: clean up extraneous computations in add_delayed_refs 2017-08-16 16:12:01 +02:00
backref.h btrfs: backref, add tracepoints for prelim_ref insertion and merging 2017-08-16 16:12:01 +02:00
btrfs_inode.h btrfs: constify tracepoint arguments 2017-08-16 14:19:53 +02:00
check-integrity.c
check-integrity.h
compression.c Merge branch 'for-4.13-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux 2017-07-14 22:55:52 -07:00
compression.h
ctree.c
ctree.h btrfs: struct-funcs, constify readers 2017-08-16 14:19:53 +02:00
dedupe.h
delayed-inode.c
delayed-inode.h
delayed-ref.c
delayed-ref.h
dev-replace.c
dev-replace.h
dir-item.c
disk-io.c Merge branch 'for-4.13-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux 2017-07-14 22:55:52 -07:00
disk-io.h
export.c
export.h
extent_io.c btrfs: btrfs_check_shared should manage its own transaction 2017-08-16 14:19:53 +02:00
extent_io.h btrfs: struct-funcs, constify readers 2017-08-16 14:19:53 +02:00
extent_map.c
extent_map.h
extent-tree.c btrfs: Remove redundant checks from btrfs_alloc_data_chunk_ondemand 2017-08-16 16:12:02 +02:00
file-item.c
file.c Merge branch 'nowait-aio-btrfs-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux 2017-07-10 10:27:48 -07:00
free-space-cache.c
free-space-cache.h
free-space-tree.c
free-space-tree.h
hash.c
hash.h
inode-item.c
inode-map.c
inode-map.h
inode.c Btrfs: report errors when checksum is not found 2017-08-16 16:12:02 +02:00
ioctl.c
Kconfig
locking.c
locking.h
lzo.c
Makefile
math.h
ordered-data.c
ordered-data.h
orphan.c
print-tree.c
print-tree.h
props.c
props.h
qgroup.c
qgroup.h
raid56.c Merge branch 'for-4.13-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux 2017-07-14 22:55:52 -07:00
raid56.h
rcu-string.h
reada.c
relocation.c
root-tree.c
scrub.c
send.c Btrfs: incremental send, fix invalid memory access 2017-07-06 23:02:30 +01:00
send.h
struct-funcs.c btrfs: struct-funcs, constify readers 2017-08-16 14:19:53 +02:00
super.c btrfs: resume qgroup rescan on rw remount 2017-08-16 16:12:01 +02:00
sysfs.c
sysfs.h
transaction.c
transaction.h
tree-defrag.c
tree-log.c Btrfs: fix dir item validation when replaying xattr deletes 2017-07-19 20:38:16 +02:00
tree-log.h
ulist.c
ulist.h
uuid-tree.c
volumes.c btrfs: Introduce a function to check if all chunks a OK for degraded rw mount 2017-08-16 16:12:02 +02:00
volumes.h btrfs: Introduce a function to check if all chunks a OK for degraded rw mount 2017-08-16 16:12:02 +02:00
xattr.c
xattr.h
zlib.c