Re: [RFC] [PATCH 2.6.37-rc5-tip 5/20] 5: Uprobes:register/unregister probes.

From: Srikar Dronamraju
Date: Wed Jan 26 2011 - 03:01:32 EST


* Peter Zijlstra <peterz@xxxxxxxxxxxxx> [2011-01-25 13:15:45]:

> > +
> > + if (atomic_read(&uprobe->ref) == 1) {
> > + synchronize_sched();
> > + rb_erase(&uprobe->rb_node, &uprobes_tree);
>
> How is that safe without holding the treelock?

Right,
Something like this should be good enuf right?

if (atomic_read(&uprobe->ref) == 1) {
synchronize_sched();
spin_lock_irqsave(&treelock, flags);
rb_erase(&uprobe->rb_node, &uprobes_tree);
spin_lock_irqrestore(&treelock, flags);
iput(uprobe->inode);
}

--
Thanks and Regards
Srikar

PS: Last time I had goofed up with Linux-mm mailing alias.
Hopefully this time it goes to the right list.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/