On Thu, Mar 27, 2014 at 9:30 PM, Alex Elder <elder@xxxxxxxx> wrote: > On 03/27/2014 01:17 PM, Ilya Dryomov wrote: >> Assert length of osd_state, osd_weight and osd_addr arrays. They >> should all have exactly max_osd elements after the call to >> osdmap_set_max_osd(). > > Since this function is allowed to fail, could these > conditions lead to returning an error code rather than > killing the machine? > > Your testing incoming data (which you can't necessarily > trust), not a fundamental assumption of the code, so > a BUG() seems harsh. > > Checking is absolutely the right thing to do. > > Switch it to return an error if you can. If you feel > BUG() is right, so be it. Either way: Changed to returning -EINVAL. Thanks, Ilya -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html