Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 288331
b: refs/heads/master
c: 3aa3b2b
h: refs/heads/master
i:
  288329: c133e26
  288327: 9d2c61f
v: v3
  • Loading branch information
Jonathan E Brassow authored and Alasdair G Kergon committed Mar 7, 2012
1 parent 454a1cb commit b56a27c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af63bcb817cf708f53bcae6edc2e3fb7dd7d8051
refs/heads/master: 3aa3b2b2b1edb813dc5342d0108befc39541542d
16 changes: 10 additions & 6 deletions trunk/drivers/md/dm-raid.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,14 @@ static int super_load(struct md_rdev *rdev, struct md_rdev *refdev)
return ret;

sb = page_address(rdev->sb_page);
if (sb->magic != cpu_to_le32(DM_RAID_MAGIC)) {

/*
* Two cases that we want to write new superblocks and rebuild:
* 1) New device (no matching magic number)
* 2) Device specified for rebuild (!In_sync w/ offset == 0)
*/
if ((sb->magic != cpu_to_le32(DM_RAID_MAGIC)) ||
(!test_bit(In_sync, &rdev->flags) && !rdev->recovery_offset)) {
super_sync(rdev->mddev, rdev);

set_bit(FirstUse, &rdev->flags);
Expand Down Expand Up @@ -745,11 +752,8 @@ static int super_init_validation(struct mddev *mddev, struct md_rdev *rdev)
*/
rdev_for_each(r, t, mddev) {
if (!test_bit(In_sync, &r->flags)) {
if (!test_bit(FirstUse, &r->flags))
DMERR("Superblock area of "
"rebuild device %d should have been "
"cleared.", r->raid_disk);
set_bit(FirstUse, &r->flags);
DMINFO("Device %d specified for rebuild: "
"Clearing superblock", r->raid_disk);
rebuilds++;
} else if (test_bit(FirstUse, &r->flags))
new_devs++;
Expand Down

0 comments on commit b56a27c

Please sign in to comment.