btrfs: introduce mount option rescue=ignoredatacsums
authorJosef Bacik <josef@toxicpanda.com>
Fri, 16 Oct 2020 15:29:19 +0000 (11:29 -0400)
committerDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2020 14:53:42 +0000 (15:53 +0100)
commit882dbe0cec9651bf6a6df500178149453726c1e1
tree9e37e4f0081a984a96ad076ce5afbe1ef69ae224
parent42437a6386ffeaaf200731e73d723ea491f3fe7d
btrfs: introduce mount option rescue=ignoredatacsums

There are cases where you can end up with bad data csums because of
misbehaving applications.  This happens when an application modifies a
buffer in-flight when doing an O_DIRECT write.  In order to recover the
file we need a way to turn off data checksums so you can copy the file
off, and then you can delete the file and restore it properly later.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/super.c
fs/btrfs/sysfs.c