summaryrefslogtreecommitdiff
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-01-07 13:28:20 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2022-01-07 13:28:20 -0800
commit35632d92ef2daf36f75ddcd68d322c8ba7ad383c (patch)
tree727a5b58d06f9676cf1444a4f69c1ce74d877827 /drivers/md/raid1.c
parent494603e06b3c8c0b29086b72f0bc41abf102fe0d (diff)
parent26bc4f019c105234639068703186c01efcabe91e (diff)
Merge tag 'block-5.16-2022-01-07' of git://git.kernel.dk/linux-block
Pull block fix from Jens Axboe: "Just the md bitmap regression this time" * tag 'block-5.16-2022-01-07' of git://git.kernel.dk/linux-block: md/raid1: fix missing bitmap update w/o WriteMostly devices
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 7dc8026cf6ee..85505424f7a4 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1496,12 +1496,13 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
if (!r1_bio->bios[i])
continue;
- if (first_clone && test_bit(WriteMostly, &rdev->flags)) {
+ if (first_clone) {
/* do behind I/O ?
* 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) &&
(atomic_read(&bitmap->behind_writes)
< mddev->bitmap_info.max_write_behind) &&
!waitqueue_active(&bitmap->behind_wait)) {