Skip to content

Commit

Permalink
Merge tag 'md-3.3-fixes' of git://neil.brown.name/md
Browse files Browse the repository at this point in the history
Some simple md-related fixes.

1/ two small fixes to ensure we handle an interrupted resync properly.
2/ avoid loading the bitmap multiple times in dm-raid

* tag 'md-3.3-fixes' of git://neil.brown.name/md:
  md: two small fixes to handling interrupt resync.
  Prevent DM RAID from loading bitmap twice.
  • Loading branch information
Linus Torvalds committed Feb 9, 2012
2 parents 4a68d54 + db91ff5 commit 4d39aa1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
12 changes: 9 additions & 3 deletions drivers/md/dm-raid.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ struct raid_dev {
struct raid_set {
struct dm_target *ti;

uint64_t print_flags;
uint32_t bitmap_loaded;
uint32_t print_flags;

struct mddev md;
struct raid_type *raid_type;
Expand Down Expand Up @@ -1085,7 +1086,7 @@ static int raid_status(struct dm_target *ti, status_type_t type,
raid_param_cnt += 2;
}

raid_param_cnt += (hweight64(rs->print_flags & ~DMPF_REBUILD) * 2);
raid_param_cnt += (hweight32(rs->print_flags & ~DMPF_REBUILD) * 2);
if (rs->print_flags & (DMPF_SYNC | DMPF_NOSYNC))
raid_param_cnt--;

Expand Down Expand Up @@ -1197,7 +1198,12 @@ static void raid_resume(struct dm_target *ti)
{
struct raid_set *rs = ti->private;

bitmap_load(&rs->md);
if (!rs->bitmap_loaded) {
bitmap_load(&rs->md);
rs->bitmap_loaded = 1;
} else
md_wakeup_thread(rs->md.thread);

mddev_resume(&rs->md);
}

Expand Down
5 changes: 3 additions & 2 deletions drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -7333,7 +7333,8 @@ void md_do_sync(struct mddev *mddev)
printk(KERN_INFO
"md: checkpointing %s of %s.\n",
desc, mdname(mddev));
mddev->recovery_cp = mddev->curr_resync;
mddev->recovery_cp =
mddev->curr_resync_completed;
}
} else
mddev->recovery_cp = MaxSector;
Expand All @@ -7351,9 +7352,9 @@ void md_do_sync(struct mddev *mddev)
rcu_read_unlock();
}
}
skip:
set_bit(MD_CHANGE_DEVS, &mddev->flags);

skip:
if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
/* We completed so min/max setting can be forgotten if used. */
if (test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery))
Expand Down

0 comments on commit 4d39aa1

Please sign in to comment.