diff options
author | Jackie Liu <liuyun01@kylinos.cn> | 2022-07-07 11:08:34 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-08-03 01:22:46 +0200 |
commit | a20d636bee41ea67b382207bee216e70f7206752 (patch) | |
tree | 3f1ed84a79877e66076ec9ac8190c924a4d86f5d /drivers | |
parent | md: simplify md_open (diff) | |
download | linux-a20d636bee41ea67b382207bee216e70f7206752.tar.xz linux-a20d636bee41ea67b382207bee216e70f7206752.zip |
raid5: fix duplicate checks for rdev->saved_raid_disk
'first' will always be greater than or equal to 0, it is unnecessary to
repeat the 0 check, clean it up.
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/raid5.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 6a6f7d969198..9270a714cceb 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -8263,8 +8263,7 @@ static int raid5_add_disk(struct mddev *mddev, struct md_rdev *rdev) * find the disk ... but prefer rdev->saved_raid_disk * if possible. */ - if (rdev->saved_raid_disk >= 0 && - rdev->saved_raid_disk >= first && + if (rdev->saved_raid_disk >= first && rdev->saved_raid_disk <= last && conf->disks[rdev->saved_raid_disk].rdev == NULL) first = rdev->saved_raid_disk; |