[PATCH 3/9] lib/flash: Add support for platform versions

Stewart Smith stewart at linux.vnet.ibm.com
Wed Dec 16 23:03:30 AEDT 2015


Cyril Bur <cyril.bur at au1.ibm.com> writes:
>> +static struct flash_info *flash_setup(void *ctx, const char *partition,
>> +				      bool ecc)
>> +{
>> +	struct flash_info *info;
>> +	int rc = 0;
>> +	const char *filename = NULL;
>> +	//DEBUG: set filename/partition if local
>> +
>> +	info = talloc_zero(ctx, struct flash_info);
>
> General theme here, I assume you're cool with segfaults? I think we have this
> chat every time you send patches, I'm just obligated to point it out but
> yeah....

does talloc assert on failure? If not, perhaps we should make it do that :)

Odds are that would be 100% better than any other option.

All 15 people who run with memory overcommit disabled know what they're
doing or are going to re-enable it within a week - so if you ever see
userspace malloc failures you've either asked for 2**63 bytes of memory
or everything has gone pretty awfully and you've probably been
essentially thrashing for 35 minutes.

At least an assert is obviously correct, while every other option to
handling failure is tested a grand total of zero times, ever, and will
only work by accident.



More information about the Petitboot mailing list