lkml.org 
[lkml]   [2022]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 11/12] md/raid5: Check all disks in a stripe_head for reshape progress


On 2022-04-26 19:53, Guoqing Jiang wrote:
>> +static bool stripe_ahead_of_reshape(struct mddev *mddev, struct
>> r5conf *conf,
>> +                    struct stripe_head *sh)
>> +{
>> +    sector_t max_sector = 0, min_sector = MaxSector;
>> +    bool ret = false;
>> +    int dd_idx;
>> +
>> +    for (dd_idx = 0; dd_idx < sh->disks; dd_idx++) {
>> +        if (dd_idx == sh->pd_idx)
>> +            continue;
>> +
>> +        min_sector = min(min_sector, sh->dev[dd_idx].sector);
>> +        max_sector = min(max_sector, sh->dev[dd_idx].sector);
>> +    }
>> +
>> +    spin_lock_irq(&conf->device_lock);
>> +
>> +    if (!range_ahead_of_reshape(mddev, min_sector, max_sector,
>> +                     conf->reshape_progress))
>> +        /* mismatch, need to try again */
>> +        ret = true;
>
> I think we can just open code range_ahead_of_reshape.

I think this way is much easier to read. GCC is much

> And seems the above is not same as below original checking which compare
> logical_sector with reshape_progress. Is it intentional or am I miss
> something?

Yes, this was intentional, the change is necessary for the next patch to
ensure that all pages in a stripe are ahead of the reshape. This was not
intended as just a cleanup patch.

Logan

\
 
 \ /
  Last update: 2022-04-27 18:17    [W:0.085 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site