Question about handle_failed_sync()
In function handle_failed_sync():
Quoted 11 lines
Quoted 11 lines
/* During recovery devices cannot be removed, so locking and
* refcounting of rdevs is not needed */ for (i = 0; i < conf->raid_disks; i++) { struct md_rdev *rdev = conf->disks[i].rdev; if (rdev && !test_bit(Faulty, &rdev->flags) && !test_bit(In_sync, &rdev->flags) && !rdev_set_badblocks(rdev, sh->sector, STRIPE_SECTORS, 0)) abort = 1;
I have two questions:
1:if raid have two or more spare disks, it wil set bad block on all spare disk. Is it worth it?
2:If raid have two or more spare disks,I can remove spare disks which not working for recovery.Then you shold add locking
and refconting.
--------------
majianpeng
2012-03-14
Quoted 13 lines · On Wed, 14 Mar 2012 15:16:45 +0800 "majianpeng" <[email protected]> wrote:
In function
handle_failed_sync():Quoted 11 lines
Quoted 11 lines
/* During recovery devices cannot be removed, so locking and
* refcounting of rdevs is not needed */ for (i = 0; i < conf->raid_disks; i++) { struct md_rdev *rdev = conf->disks[i].rdev; if (rdev && !test_bit(Faulty, &rdev->flags) && !test_bit(In_sync, &rdev->flags) && !rdev_set_badblocks(rdev, sh->sector, STRIPE_SECTORS, 0)) abort = 1;
Quoted 2 lines
I have two questions:
1:if raid have two or more spare disks, it wil set bad block on all spare disk. Is it worth it?
This is not looking at spare disks exactly. Rather it is looking at devices that are being recovered - they were spares by now they are member of the array that are being recovered.
So there will only be 2 in RAID6 and never more.
And yes, it is worth it.
Quoted 2 lines
2:If raid have two or more spare disks,I can remove spare disks which not working for recovery.Then you shold add locking
and refconting.
I'm not iterating through the list of disks (mddev->disks) here - just through the list of devices that are active members of the array (conf->disks).
You cannot remove those while recovery is happening.
Thanks,
NeilBrown
Quoted 9 lines
--------------
majianpeng
2012-03-14--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html