diff options
author | Heinz Mauelshagen <heinzm@redhat.com> | 2023-08-14 14:01:15 +0200 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2023-08-17 21:11:31 -0700 |
commit | 6b2460e66ce6d483b5ff77227ac799d6e8a9ebd6 (patch) | |
tree | 1cfbe76638d20bcfa000d6303c6faab9c13db7f8 | |
parent | c069da449a13669ffa754fd971747e7e17e7d691 (diff) | |
download | lwn-6b2460e66ce6d483b5ff77227ac799d6e8a9ebd6.tar.gz lwn-6b2460e66ce6d483b5ff77227ac799d6e8a9ebd6.zip |
md raid1: allow writebehind to work on any leg device set WriteMostly
As the WriteMostly flag can be set on any component device of a RAID1
array, remove the constraint that it only works if set on the first one.
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Tested-by: Xiao Ni <xni@redhat.com>
Link: https://lore.kernel.org/r/2a9592bf3340f34bf588eec984b23ee219f3985e.1692013451.git.heinzm@redhat.com
Signed-off-by: Song Liu <song@kernel.org>
-rw-r--r-- | drivers/md/raid1.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 56f2725a996f..4b30a1742162 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1523,8 +1523,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio, * Not if there are too many, or cannot * allocate memory, or a reader on WriteMostly * is waiting for behind writes to flush */ - if (bitmap && - test_bit(WriteMostly, &rdev->flags) && + if (bitmap && write_behind && (atomic_read(&bitmap->behind_writes) < mddev->bitmap_info.max_write_behind) && !waitqueue_active(&bitmap->behind_wait)) { |