Hannes Reinecke <hare@xxxxxxx> wrote:Problem with your patch is that call_usermodehelper might block on down() regardless whether it is called async or sync.
Patch (for the semaphore version) is attached.
err, what on earth is this patch trying to do? It adds tons more
complexity then I expected to see. Are the async (wait=0) semantics for
call_usermodehelper() preserved?
Why is the code now doingAs I said; down() might block. Unless we accept that the caller will only return after all down()s have been executed successfully we need something like that.
if (stored_info.wait > 0) {
and
if (stored_info.wait >= 0) {
? `wait' is a boolean. Or did its semantics get secretly changed somewhere?
Why is a new kernel thread needed to up and down a semaphore?
Sorry, but I've completely lost the plot on what you're trying to do here!Sorry for this. I've probably pushed too hard for this.
Indeed, but only if we accept that any call to call_usermodehelper might block if not enough resources are available.
I'd have though that something like the below (untested, slightly hacky)
patch would suit.