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.