svn commit: r278479 - in head: etc sys/kern

Rui Paulo rpaulo at me.com
Tue Feb 10 02:36:19 UTC 2015


On Feb 9, 2015, at 15:28, Konstantin Belousov <kostikbel at gmail.com> wrote:
> Arguably, there should be a knob, probably sysctl, to turn the
> functionality off. I definitely do not want this on crash boxes used for
> userspace debugging.  Even despite the example handler is inactive.

OK, I can provide a sysctl knob.

>> +	len = MAXPATHLEN * 2 + 5 /* comm= */ + 5 /* core= */ + 1;
> It is much cleaner to use static const char arrays for the names,
> and use sizeof() - 1 instead of hard-coding commented constants.

OK.  I was trying to avoid allocating >2k on the stack.

>> +	data = malloc(len, M_TEMP, M_NOWAIT);
> Why is this allocation M_NOWAIT ?

That should be M_WAITOK.

>> +		freepath = NULL;
>> +	}
>> +	if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0)
>> +		goto out;
>> +	snprintf(data, len, "%s core=%s", data, fullpath);
> This is weird, and highly depends on the implementation details, supplying
> the same string as target and source.  IMO strcat(9) is enough there.

OK, I'll change it to strcat.

--
Rui Paulo





More information about the svn-src-all mailing list