kdbus: fix 'canceled' typo

'canceled' -> 'cancelled'

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
connection: simplify cmd_conn_info()

We only have one path setting 'name'. There's no reason to split
name-handling, so merge them back together.

Also fix a bug where we access the name _before_ checking for strlen.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
handle notify messages in a bus list to preserve bus-global ordering
names: turn registry lock into rwsem

Imagine a racing name-acquire and msg-send. The msg-send might lookup the
destination name, which might be an activator. But before it can queue the
message, the racing name-acquire installs and implementor and moves all
pending messages from the activator to the implementor. If the original
msg-send afterwards continues, it will still queue the in-flight message
on the activator instead of the implementor.

After 1 day of discussion, we decided on turning the registry into a
read-write lock. This way, any msg-send will be locked against
name-changes. A name-change requires a writer lock, but any in-flight
message will hold a regsitry read-lock from the name-lookup until it
queued the message.

This patch only converts the lock, following patches will close the races.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
connection: keep names locked while sending messages

If we send messages and we look up well-known names, we must keep them
locked until we're done. Otherwise, the name might move to another
connection before we queue it on the resolved name.

This fixes the sending path to lock names for the entire function call.
Name-movements already lock the name-registry for the entire move, so we
should be fine now.

We also inline the lookup-helper, as it is only used once and will get
messy if we return kdbus_name_entry objects.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
names: take the registry write lock in kdbus_name_release()

Take the write lock in kdbus_name_release() instead of
kdbus_cmd_name_release() in order to reduce the lock hold time.

This change permits to convert the kdbus_bus_find_conn_by_id() call to
kdbus_conn_find_peer() since the bus lock will also be taken later in
kdbus_name_release().

Another advantage is that now kdbus_cmd_name_release() and
kdbus_name_release() have the same semantic of kdbus_cmd_name_acquire()
and kdbus_name_acquire()

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
remove no longer needed "on behalf" logic (ABI break)