diff options
author | Shaohua Li <shli@fb.com> | 2016-12-08 18:48:19 -0500 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-12-09 01:01:47 -0500 |
commit | 2953079c692da067aeb6345659875b97378f9b0a (patch) | |
tree | 06bec98f71114629966da122360fd38a6f8ec422 /drivers/md/raid1.c | |
parent | 82a301cb0ea2df8a5c88213094a01660067c7fb4 (diff) |
md: separate flags for superblock changes
The mddev->flags are used for different purposes. There are a lot of
places we check/change the flags without masking unrelated flags, we
could check/change unrelated flags. These usage are most for superblock
write, so spearate superblock related flags. This should make the code
clearer and also fix real bugs.
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index efc2e744cfd3..a1f3fbed9100 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1517,8 +1517,8 @@ static void raid1_error(struct mddev *mddev, struct md_rdev *rdev) | |||
1517 | * if recovery is running, make sure it aborts. | 1517 | * if recovery is running, make sure it aborts. |
1518 | */ | 1518 | */ |
1519 | set_bit(MD_RECOVERY_INTR, &mddev->recovery); | 1519 | set_bit(MD_RECOVERY_INTR, &mddev->recovery); |
1520 | set_mask_bits(&mddev->flags, 0, | 1520 | set_mask_bits(&mddev->sb_flags, 0, |
1521 | BIT(MD_CHANGE_DEVS) | BIT(MD_CHANGE_PENDING)); | 1521 | BIT(MD_SB_CHANGE_DEVS) | BIT(MD_SB_CHANGE_PENDING)); |
1522 | pr_crit("md/raid1:%s: Disk failure on %s, disabling device.\n" | 1522 | pr_crit("md/raid1:%s: Disk failure on %s, disabling device.\n" |
1523 | "md/raid1:%s: Operation continuing on %d devices.\n", | 1523 | "md/raid1:%s: Operation continuing on %d devices.\n", |
1524 | mdname(mddev), bdevname(rdev->bdev, b), | 1524 | mdname(mddev), bdevname(rdev->bdev, b), |
@@ -2464,10 +2464,10 @@ static void raid1d(struct md_thread *thread) | |||
2464 | md_check_recovery(mddev); | 2464 | md_check_recovery(mddev); |
2465 | 2465 | ||
2466 | if (!list_empty_careful(&conf->bio_end_io_list) && | 2466 | if (!list_empty_careful(&conf->bio_end_io_list) && |
2467 | !test_bit(MD_CHANGE_PENDING, &mddev->flags)) { | 2467 | !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags)) { |
2468 | LIST_HEAD(tmp); | 2468 | LIST_HEAD(tmp); |
2469 | spin_lock_irqsave(&conf->device_lock, flags); | 2469 | spin_lock_irqsave(&conf->device_lock, flags); |
2470 | if (!test_bit(MD_CHANGE_PENDING, &mddev->flags)) { | 2470 | if (!test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags)) { |
2471 | while (!list_empty(&conf->bio_end_io_list)) { | 2471 | while (!list_empty(&conf->bio_end_io_list)) { |
2472 | list_move(conf->bio_end_io_list.prev, &tmp); | 2472 | list_move(conf->bio_end_io_list.prev, &tmp); |
2473 | conf->nr_queued--; | 2473 | conf->nr_queued--; |
@@ -2521,7 +2521,7 @@ static void raid1d(struct md_thread *thread) | |||
2521 | generic_make_request(r1_bio->bios[r1_bio->read_disk]); | 2521 | generic_make_request(r1_bio->bios[r1_bio->read_disk]); |
2522 | 2522 | ||
2523 | cond_resched(); | 2523 | cond_resched(); |
2524 | if (mddev->flags & ~(1<<MD_CHANGE_PENDING)) | 2524 | if (mddev->sb_flags & ~(1<<MD_SB_CHANGE_PENDING)) |
2525 | md_check_recovery(mddev); | 2525 | md_check_recovery(mddev); |
2526 | } | 2526 | } |
2527 | blk_finish_plug(&plug); | 2527 | blk_finish_plug(&plug); |
@@ -2724,7 +2724,7 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, | |||
2724 | min_bad, 0 | 2724 | min_bad, 0 |
2725 | ) && ok; | 2725 | ) && ok; |
2726 | } | 2726 | } |
2727 | set_bit(MD_CHANGE_DEVS, &mddev->flags); | 2727 | set_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags); |
2728 | *skipped = 1; | 2728 | *skipped = 1; |
2729 | put_buf(r1_bio); | 2729 | put_buf(r1_bio); |
2730 | 2730 | ||