On 03/25, Anton Arapov wrote: > > On Sun, Mar 24, 2013 at 05:28:17PM +0100, Oleg Nesterov wrote: > > > > Ignoring the fact you need put_uprobe/kfree, it seems that we should > > do something like this, > > > > do { > > handler_uretprobe_chain(...); > > > > if (!ri->dirty) // not chained > > break; > > > > ri = ri->next; > > } while (ri); > > > > utask->return_instances = ri; > > No? > > Oleg, Do you mean > > do { > handler_uretprobe_chain(...); > > ri = ri->next; > > if (!ri->dirty) // not chained > break; > } while (ri); > > utask->return_instances = ri; > > otherwise we stuck with the first instance in stack.
Not sure I understand... but it is very possible I missed something. But the pseudo code I wrote is not correct, I meant utask->return_instances = ri->next; after the main loop. > ...and perhaps for(;;) would be 'more beautiful' here? Oh, I would not mind either way. In fact we do not really need ri != NULL check inside the loop (again, unless I am confused). We must see a non-chained entry in the stack unless we have a bug. Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/