Skip to content

Commit 3a31cf3

Browse files
Guoqing Jiangliu-song-6
authored andcommitted
raid5: don't duplicate code for different paths in handle_stripe
As we can see, R5_LOCKED is set and s.locked is increased whether R5_ReWrite is set or not, so move it to common path. Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com> Signed-off-by: Song Liu <songliubraving@fb.com>
1 parent 01b5d32 commit 3a31cf3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/md/raid5.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4966,14 +4966,11 @@ static void handle_stripe(struct stripe_head *sh)
49664966
if (!test_bit(R5_ReWrite, &dev->flags)) {
49674967
set_bit(R5_Wantwrite, &dev->flags);
49684968
set_bit(R5_ReWrite, &dev->flags);
4969-
set_bit(R5_LOCKED, &dev->flags);
4970-
s.locked++;
4971-
} else {
4969+
} else
49724970
/* let's read it back */
49734971
set_bit(R5_Wantread, &dev->flags);
4974-
set_bit(R5_LOCKED, &dev->flags);
4975-
s.locked++;
4976-
}
4972+
set_bit(R5_LOCKED, &dev->flags);
4973+
s.locked++;
49774974
}
49784975
}
49794976

0 commit comments

Comments
 (0)