OSDN Git Service

btrfs: Introduce mount time chunk <-> dev extent mapping check
authorQu Wenruo <wqu@suse.com>
Wed, 1 Aug 2018 02:37:19 +0000 (10:37 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:13:03 +0000 (13:13 +0200)
commitcf90d884b347c50a1e8c1effc4093e497dd68b4b
treeb9a7d161c2a7da88764dd3239966f90edacd56a3
parent7ef49515fa6727cb4b6f2f5b0ffbc5fc20a9f8c6
btrfs: Introduce mount time chunk <-> dev extent mapping check

This patch will introduce chunk <-> dev extent mapping check, to protect
us against invalid dev extents or chunks.

Since chunk mapping is the fundamental infrastructure of btrfs, extra
check at mount time could prevent a lot of unexpected behavior (BUG_ON).

Reported-by: Xu Wen <wen.xu@gatech.edu>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=200403
Link: https://bugzilla.kernel.org/show_bug.cgi?id=200407
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Su Yue <suy.fnst@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h