Re: Fwd: Kernel crash trying to add an already removed disk from RAID 10

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Will try and report back!
Thanks!

2018-04-25 8:40 GMT+01:00 Guoqing Jiang <gqjiang@xxxxxxxx>:
>
>
> On 04/25/2018 02:52 PM, Guoqing Jiang wrote:
>>
>>
>> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
>> index 3c60774c8430..840360a29de0 100644
>> --- a/drivers/md/raid10.c
>> +++ b/drivers/md/raid10.c
>> @@ -249,10 +249,15 @@ static void r10buf_pool_free(void *__r10_bio, void
>> *data)
>>  {
>>         struct r10conf *conf = data;
>>         struct r10bio *r10bio = __r10_bio;
>> -       int j;
>> +       int j, nalloc;
>>         struct resync_pages *rp = NULL;
>>
>> -       for (j = conf->copies; j--; ) {
>> +       if (test_bit(MD_RECOVERY_SYNC, &conf->mddev->recovery) ||
>> +           test_bit(MD_RECOVERY_RESHAPE, &conf->mddev->recovery))
>> +               nalloc = conf->copies; /* resync */
>> +       else
>> +               nalloc = 2; /* recovery */
>> +       for (j = nalloc; j--; ) {
>>                 struct bio *bio = r10bio->devs[j].bio;
>>
>>                 rp = get_resync_pages(bio);
>
>
>  I guess it was caused by commit f0250618361db1447d66c494c6dd2df815f42c87
> ("md: raid10: don't use bio's vec table to manage resync pages").
>
> -               if (bio) {
> -                       for (i = 0; i < RESYNC_PAGES; i++) {
> - safe_put_page(bio->bi_io_vec[i].bv_page);
> -                               bio->bi_io_vec[i].bv_page = NULL;
> -                       }
> -                       bio_put(bio);
> -               }
> +
> +               rp = get_resync_pages(bio);
> +               resync_free_pages(rp);
> +               bio_put(bio);
>
> So another way is just check if bio  existed or not as before.
>
> Thanks,
> Guoqing
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux