All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhao Lei <zhaolei@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Cc: Zhao Lei <zhaolei@cn.fujitsu.com>
Subject: [PATCH 2/4] btrfs: return all mirror whether need_raid_map set or not
Date: Tue, 15 Dec 2015 19:09:50 +0800	[thread overview]
Message-ID: <77a0296e8261fa89dba93cc2d9bc39ebf3a19770.1450177455.git.zhaolei@cn.fujitsu.com> (raw)
In-Reply-To: <cover.1450177455.git.zhaolei@cn.fujitsu.com>

__btrfs_map_block() should return all mirror on WRITE,
REQ_GET_READ_MIRRORS, and RECOVERY case, whether need_raid_map set
or not.

need_raid_map only used to control is to set bbio->raid_map.

Current code works right because there is only one caller can
trigger above bug, which is readahead, and this function happened
to bypass on less mirror.

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

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index a6df8fd..4ee429b 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -5464,9 +5464,8 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
 		}
 
 	} else if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) {
-		if (need_raid_map &&
-		    ((rw & (REQ_WRITE | REQ_GET_READ_MIRRORS)) ||
-		     mirror_num > 1)) {
+		if ((rw & (REQ_WRITE | REQ_GET_READ_MIRRORS)) ||
+		    mirror_num > 1) {
 			/* push stripe_nr back to the start of the full stripe */
 			stripe_nr = div_u64(raid56_full_stripe_start,
 					stripe_len * nr_data_stripes(map));
-- 
1.8.5.1




  parent reply	other threads:[~2015-12-15 11:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15 11:09 [PATCH 0/4] btrfs: return all mirror whether need_raid_map set or not Zhao Lei
2015-12-15 11:09 ` [PATCH 1/4] btrfs: Disable raid56 readahead Zhao Lei
2015-12-15 11:09 ` Zhao Lei [this message]
2015-12-15 11:09 ` [PATCH 3/4] btrfs: Small cleanup for get index_srcdev loop Zhao Lei
2015-12-15 11:09 ` [PATCH 4/4] btrfs: Use direct way to determine raid56 write/recover mode Zhao Lei
2016-06-06  8:21 ` [PATCH 0/4] btrfs: return all mirror whether need_raid_map set or not David Sterba
2016-06-06  8:43   ` Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=77a0296e8261fa89dba93cc2d9bc39ebf3a19770.1450177455.git.zhaolei@cn.fujitsu.com \
    --to=zhaolei@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.