Re: [PATCH v2] md/raid10: initialize r10_bio->read_slot before use.

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

 



On Fri, Nov 6, 2020 at 5:25 PM Kevin Vigor <kvigor@xxxxxxxxx> wrote:
>
> > How about we initialize read_slot to 0, and get rid of this check?
>
> That will definitely work properly since we memset the rdev to null in __make_request. But the read_slot is truly invalid until we call read_balance() successfully and it feels wrong to set it to a valid value even if it os harmless by accident. So I prefer to give it an explicitly invalid value.
>
> But your solution saves one test in the issue path and a line of diff, so I will happily change if you prefer the zero solution.

I think initialized to -1 is safer in long run.

Thanks for the fix! Applied to md-next.




[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