Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16528
b: refs/heads/master
c: 14f8d26
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jan 6, 2006
1 parent 719de52 commit b3f8e61
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 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: 0a27ec96b6fb1abf867e36d7b0b681d67588767a
refs/heads/master: 14f8d26b8ea3413b28f2cac208c9a93600fe3a80
41 changes: 21 additions & 20 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done,
set_bit(R5_UPTODATE, &sh->dev[i].flags);
#endif
if (test_bit(R5_ReadError, &sh->dev[i].flags)) {
printk("R5: read error corrected!!\n");
printk(KERN_INFO "raid5: read error corrected!!\n");
clear_bit(R5_ReadError, &sh->dev[i].flags);
clear_bit(R5_ReWrite, &sh->dev[i].flags);
}
Expand All @@ -428,13 +428,14 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done,
clear_bit(R5_UPTODATE, &sh->dev[i].flags);
atomic_inc(&conf->disks[i].rdev->read_errors);
if (conf->mddev->degraded)
printk("R5: read error not correctable.\n");
printk(KERN_WARNING "raid5: read error not correctable.\n");
else if (test_bit(R5_ReWrite, &sh->dev[i].flags))
/* Oh, no!!! */
printk("R5: read error NOT corrected!!\n");
printk(KERN_WARNING "raid5: read error NOT corrected!!\n");
else if (atomic_read(&conf->disks[i].rdev->read_errors)
> conf->max_nr_stripes)
printk("raid5: Too many read errors, failing device.\n");
printk(KERN_WARNING
"raid5: Too many read errors, failing device.\n");
else
retry = 1;
if (retry)
Expand Down Expand Up @@ -604,7 +605,7 @@ static sector_t raid5_compute_sector(sector_t r_sector, unsigned int raid_disks,
*dd_idx = (*pd_idx + 1 + *dd_idx) % raid_disks;
break;
default:
printk("raid5: unsupported algorithm %d\n",
printk(KERN_ERR "raid5: unsupported algorithm %d\n",
conf->algorithm);
}

Expand Down Expand Up @@ -645,7 +646,7 @@ static sector_t compute_blocknr(struct stripe_head *sh, int i)
i -= (sh->pd_idx + 1);
break;
default:
printk("raid5: unsupported algorithm %d\n",
printk(KERN_ERR "raid5: unsupported algorithm %d\n",
conf->algorithm);
}

Expand All @@ -654,7 +655,7 @@ static sector_t compute_blocknr(struct stripe_head *sh, int i)

check = raid5_compute_sector (r_sector, raid_disks, data_disks, &dummy1, &dummy2, conf);
if (check != sh->sector || dummy1 != dd_idx || dummy2 != sh->pd_idx) {
printk("compute_blocknr: map not correct\n");
printk(KERN_ERR "compute_blocknr: map not correct\n");
return 0;
}
return r_sector;
Expand Down Expand Up @@ -737,7 +738,7 @@ static void compute_block(struct stripe_head *sh, int dd_idx)
if (test_bit(R5_UPTODATE, &sh->dev[i].flags))
ptr[count++] = p;
else
printk("compute_block() %d, stripe %llu, %d"
printk(KERN_ERR "compute_block() %d, stripe %llu, %d"
" not present\n", dd_idx,
(unsigned long long)sh->sector, i);

Expand Down Expand Up @@ -1005,7 +1006,7 @@ static void handle_stripe(struct stripe_head *sh)
if (dev->written) written++;
rdev = conf->disks[i].rdev; /* FIXME, should I be looking rdev */
if (!rdev || !test_bit(In_sync, &rdev->flags)) {
/* The ReadError flag wil just be confusing now */
/* The ReadError flag will just be confusing now */
clear_bit(R5_ReadError, &dev->flags);
clear_bit(R5_ReWrite, &dev->flags);
}
Expand Down Expand Up @@ -1288,7 +1289,7 @@ static void handle_stripe(struct stripe_head *sh)
* is available
*/
if (syncing && locked == 0 &&
!test_bit(STRIPE_INSYNC, &sh->state) && failed <= 1) {
!test_bit(STRIPE_INSYNC, &sh->state)) {
set_bit(STRIPE_HANDLE, &sh->state);
if (failed == 0) {
char *pagea;
Expand All @@ -1306,21 +1307,20 @@ static void handle_stripe(struct stripe_head *sh)
if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))
/* don't try to repair!! */
set_bit(STRIPE_INSYNC, &sh->state);
else {
compute_block(sh, sh->pd_idx);
uptodate++;
}
}
}
if (!test_bit(STRIPE_INSYNC, &sh->state)) {
/* either failed parity check, or recovery is happening */
if (failed==0)
failed_num = sh->pd_idx;
/* should be able to compute the missing block and write it to spare */
if (!test_bit(R5_UPTODATE, &sh->dev[failed_num].flags)) {
if (uptodate+1 != disks)
BUG();
compute_block(sh, failed_num);
uptodate++;
}
if (uptodate != disks)
BUG();
dev = &sh->dev[failed_num];
BUG_ON(!test_bit(R5_UPTODATE, &dev->flags));
BUG_ON(uptodate != disks);

set_bit(R5_LOCKED, &dev->flags);
set_bit(R5_Wantwrite, &dev->flags);
clear_bit(STRIPE_DEGRADED, &sh->state);
Expand Down Expand Up @@ -1822,7 +1822,8 @@ static int run(mddev_t *mddev)
struct list_head *tmp;

if (mddev->level != 5 && mddev->level != 4) {
printk("raid5: %s: raid level not set to 4/5 (%d)\n", mdname(mddev), mddev->level);
printk(KERN_ERR "raid5: %s: raid level not set to 4/5 (%d)\n",
mdname(mddev), mddev->level);
return -EIO;
}

Expand Down

0 comments on commit b3f8e61

Please sign in to comment.