Skip to content

Commit 6b2460e

Browse files
mauelshaliu-song-6
authored andcommitted
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 <[email protected]> Tested-by: Xiao Ni <[email protected]> Link: https://lore.kernel.org/r/2a9592bf3340f34bf588eec984b23ee219f3985e.1692013451.git.heinzm@redhat.com Signed-off-by: Song Liu <[email protected]>
1 parent c069da4 commit 6b2460e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/md/raid1.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,8 +1523,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
15231523
* Not if there are too many, or cannot
15241524
* allocate memory, or a reader on WriteMostly
15251525
* is waiting for behind writes to flush */
1526-
if (bitmap &&
1527-
test_bit(WriteMostly, &rdev->flags) &&
1526+
if (bitmap && write_behind &&
15281527
(atomic_read(&bitmap->behind_writes)
15291528
< mddev->bitmap_info.max_write_behind) &&
15301529
!waitqueue_active(&bitmap->behind_wait)) {

0 commit comments

Comments
 (0)