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

Re: [lvm-devel] [PATCH] Calculate mirror log size instead of hardcoding 1 extent size.



Jun'ichi Nomura wrote:
> Milan Broz wrote:
>> +		if (!(r = _for_each_pv(cmd, seg->log_lv, 0, seg->log_lv->le_count?:1,
> 
> "seg->log_lv->le_count?:1" could be just "seg->log_lv->le_count",
> to avoid possible future confusion.
> (I.e. there is no explanation why we pass 1 when le_count is 0.)
> And if the seg->log_lv is empty, _for_each_pv() will just fail anyway
> by not finding a matching segment, regardless of len = 0 or 1.
> If it is possible to pass an empty seg->log_lv here in future,
> le_count check should be done in the above "if", I think.

Yes, thanks, I'll fix the commit.

Milan



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