Commit 3a31cf3d authored by Guoqing Jiang's avatar Guoqing Jiang Committed by Song Liu
Browse files

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: default avatarGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
parent 01b5d32a
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -4966,16 +4966,13 @@ static void handle_stripe(struct stripe_head *sh)
				if (!test_bit(R5_ReWrite, &dev->flags)) {
					set_bit(R5_Wantwrite, &dev->flags);
					set_bit(R5_ReWrite, &dev->flags);
					set_bit(R5_LOCKED, &dev->flags);
					s.locked++;
				} else {
				} else
					/* let's read it back */
					set_bit(R5_Wantread, &dev->flags);
				set_bit(R5_LOCKED, &dev->flags);
				s.locked++;
			}
		}
		}

	/* Finish reconstruct operations initiated by the expansion process */
	if (sh->reconstruct_state == reconstruct_state_result) {