diff options
author | Oleg Nesterov <oleg@redhat.com> | 2012-11-25 21:48:37 (GMT) |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2013-02-08 16:47:10 (GMT) |
commit | 66d06dffa5ef6f3544997440af63a91ef36a2171 (patch) | |
tree | a95c81e492b5c714caa7f24f48fdb20fe0a33024 /kernel/modsign_pubkey.c | |
parent | 06b7bcd8cbd7eb1af331e437ec3d8f5182ae1b7e (diff) | |
download | linux-66d06dffa5ef6f3544997440af63a91ef36a2171.tar.xz |
uprobes: Kill uprobes_mutex[], separate alloc_uprobe() and __uprobe_register()
uprobe_register() and uprobe_unregister() are the only users of
mutex_lock(uprobes_hash(inode)), and the only reason why we can't
simply remove it is that we need to ensure that delete_uprobe() is
not possible after alloc_uprobe() and before consumer_add().
IOW, we need to ensure that when we take uprobe->register_rwsem
this uprobe is still valid and we didn't race with _unregister()
which called delete_uprobe() in between.
With this patch uprobe_register() simply checks uprobe_is_active()
and retries if it hits this very unlikely race. uprobes_mutex[] is
no longer needed and can be removed.
There is another reason for this change, prepare_uprobe() should be
folded into alloc_uprobe() and we do not want to hold the extra locks
around read_mapping_page/etc.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Anton Arapov <anton@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/modsign_pubkey.c')
0 files changed, 0 insertions, 0 deletions