Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 13493
b: refs/heads/master
c: ba22dcb
h: refs/heads/master
i:
  13491: 75cf5a6
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Nov 9, 2005
1 parent 47cd2f5 commit 93c7c45
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 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: 007583c9253fed363a0bd71b039e9b40a0f6855e
refs/heads/master: ba22dcbf106338a5c46d6979f9b19564faae3d49
1 change: 1 addition & 0 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,7 @@ static mdk_rdev_t *md_import_device(dev_t newdev, int super_format, int super_mi
rdev->in_sync = 0;
rdev->data_offset = 0;
atomic_set(&rdev->nr_pending, 0);
atomic_set(&rdev->read_errors, 0);

size = rdev->bdev->bd_inode->i_size >> BLOCK_SIZE_BITS;
if (!size) {
Expand Down
25 changes: 17 additions & 8 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,21 +420,29 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done,
clear_bit(R5_ReadError, &sh->dev[i].flags);
clear_bit(R5_ReWrite, &sh->dev[i].flags);
}
if (atomic_read(&conf->disks[i].rdev->read_errors))
atomic_set(&conf->disks[i].rdev->read_errors, 0);
} else {
int retry = 0;
clear_bit(R5_UPTODATE, &sh->dev[i].flags);
if (conf->mddev->degraded) {
atomic_inc(&conf->disks[i].rdev->read_errors);
if (conf->mddev->degraded)
printk("R5: read error not correctable.\n");
clear_bit(R5_ReadError, &sh->dev[i].flags);
clear_bit(R5_ReWrite, &sh->dev[i].flags);
md_error(conf->mddev, conf->disks[i].rdev);
} else if (test_bit(R5_ReWrite, &sh->dev[i].flags)) {
else if (test_bit(R5_ReWrite, &sh->dev[i].flags))
/* Oh, no!!! */
printk("R5: 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");
else
retry = 1;
if (retry)
set_bit(R5_ReadError, &sh->dev[i].flags);
else {
clear_bit(R5_ReadError, &sh->dev[i].flags);
clear_bit(R5_ReWrite, &sh->dev[i].flags);
md_error(conf->mddev, conf->disks[i].rdev);
} else
set_bit(R5_ReadError, &sh->dev[i].flags);
}
}
rdev_dec_pending(conf->disks[i].rdev, conf->mddev);
#if 0
Expand Down Expand Up @@ -1328,7 +1336,8 @@ static void handle_stripe(struct stripe_head *sh)
/* If the failed drive is just a ReadError, then we might need to progress
* the repair/check process
*/
if (failed == 1 && test_bit(R5_ReadError, &sh->dev[failed_num].flags)
if (failed == 1 && ! conf->mddev->ro &&
test_bit(R5_ReadError, &sh->dev[failed_num].flags)
&& !test_bit(R5_LOCKED, &sh->dev[failed_num].flags)
&& test_bit(R5_UPTODATE, &sh->dev[failed_num].flags)
) {
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/raid/md_k.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ struct mdk_rdev_s
* only maintained for arrays that
* support hot removal
*/
atomic_t read_errors; /* number of consecutive read errors that
* we have tried to ignore.
*/
};

typedef struct mdk_personality_s mdk_personality_t;
Expand Down

0 comments on commit 93c7c45

Please sign in to comment.