diff mbox

[1/4] btrfs: Disable raid56 readahead

Message ID 092e20dbfac092d4632f1fa04dbcd5f09f0066b7.1450177455.git.zhaolei@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zhaolei Dec. 15, 2015, 11:09 a.m. UTC
Raid56 readahead can not work in current code, reada_find_extent()
will show warning of bbio->num_stripes > BTRFS_MAX_MIRRORS, because
raid56 have parity strip, which makes more bbio->num_stripes.

The reason why we haven't see above error is because another bug
in __btrfs_map_block(), which make raid56 readahead do nothing.

Before we will fix bug in __btrfs_map_block(), we need to disable
raid56 temporary, to avoid above warning.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
 fs/btrfs/reada.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox

Patch

diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c
index 619f929..7bbd656 100644
--- a/fs/btrfs/reada.c
+++ b/fs/btrfs/reada.c
@@ -363,6 +363,11 @@  static struct reada_extent *reada_find_extent(struct btrfs_root *root,
 	if (ret || !bbio || length < blocksize)
 		goto error;
 
+	if (bbio->map_type & BTRFS_BLOCK_GROUP_RAID56_MASK) {
+		/* Current code can not support RAID56 yet */
+		goto error;
+	}
+
 	if (bbio->num_stripes > BTRFS_MAX_MIRRORS) {
 		btrfs_err(root->fs_info,
 			   "readahead: more than %d copies not supported",