Inspired by ffc72591b1f5 (Don't worry if a module is already loaded when looking ...) .
MFC after: 1 week
Differential D44633
ng_socket: Treat EEXIST from kern_kldload() as success in case there is a race condition zlei on Apr 4 2024, 1:25 AM. Authored by Tags None Referenced Files
Details Inspired by ffc72591b1f5 (Don't worry if a module is already loaded when looking ...) . MFC after: 1 week
Diff Detail
Event TimelineComment Actions @olce Comment Actions Why do we really want to lose a meaningful error code and reduce all errors into one value? IMHO, it is counterproductive. And if we got a new error code type, why can't we propagate it to userland, too? Comment Actions I agree with you that user want meaningful error code. But for the underlaying error (for this case errors from kernel linkers) would make more confusion rather than be meaningful to users, especially the newbies. I'm not going to argue how to classify experienced users, and I do not want to argue how experienced users will do when they reach misleading error code. From my option those users who are familiar / or able to be familiar with kernel parts are developers rather than plain users, so most time we are making plain users happy.
Why ? The root cause is: For this case, how can plain users distinguish errors from kernel linkers and those from netgraph ? And if we're going to document errors of ngctl mkpeer, should we document all errors from kernel linkers ? I think both answers are NO. FYI, D42327 and D44552 are good examples which do the translating for underlaying errors. That is another question. If the new error code type ( EUNSDEP in D44581 ) is not kernel-only, then Yes it can be propagate to userland, but still NO for netgraph. Comment Actions Reducing multiple error codes to one is losing information and it is confusing regardless of how experienced a user is. Even in case of the least experienced user, they would file a problem report or ask on mailing lists, forums, or whatever, they will come asking for help with reduced information. First thing to help such a user would be to write a dtrace script or ask him to patch kernel with printfs to get the actual error. If the whole problem is with EUNSDEP, there are two ways to solve it:
Comment Actions If the concern is losing information then we can fulfill by emitting logs either from the caller ngc_send() or from the callee kern_kldload() / linker_load_module ().
This is not all about EUNSDEP. But the introduction of kernel-only EUNSDEP reveals this problem. Comment Actions Bite out the translation for errors from kernel linker. If that is needed, do it in separate CR. |