Suhas Athani has uploaded this change for review.

View Change

QoS D-Bus: status replies, client refs, Get packing, crash fixes

Fixes several bugs in the QoS D-Bus methods on /org/ganesha/nfsd/QosMgr
(org.ganesha.nfsd.qos) for Per_Export, Per_Client, and
Per_Export_Per_Client. Failures now return structured status replies
(boolean false + message) instead of generic D-Bus errors or hangs.
Client lookups drop their gsh_client ref. Get replies are packed on
the reply iterator.

Status replies

- CHECK_DBUS_*_OR_return and CHECK_ARG_OR_return now return true
after gsh_dbus_status_reply(). Returning false made
dbus_message_entrypoint() discard the status body and substitute
Error org.ganesha.nfsd.qos: <MethodName>
- Per_Client handlers add missing else branches when qos_class is
NULL so callers get "check config values" instead of a silent
generic error. Handlers return true after cleanup.

Iterator / lock bugs

- GetExportTokens and GetExportDefaultClientBandwidth: call
dbus_message_iter_init_append() before argument validation and
export lookup. It previously ran only on the success path, leaving
the reply iterator uninitialized on invalid export id (hang or
corrupt reply).
- SetExportIOPS: use check_dbus_next_arg() for read_iops and
write_iops. After consuming export_id, check_dbus_arg() re-read
the same slot and never advanced, so SetExportIOPS always failed.
- EnableExportQosBwControl: drop g_qos_config_lock before
qos_perexport_insert(), which takes the same non-recursive mutex.
Holding the lock across that call deadlocked the D-Bus thread.
Config/precondition failures return a status reply and true.

Client lookup refs (put_gsh_client)

lookup_client() takes a ref via get_gsh_client(). QoS D-Bus never
called put_gsh_client(). Per-client Set methods also used
CHECK_DBUS_NEXT_ARG_OR_return after lookup, which returned without
dropping the ref.

Now every successful lookup is paired with put_gsh_client(),
including argument-error paths after lookup (Set methods use
check_dbus_* + goto out instead of the early-return macros).
Aligns with ClientMgr D-Bus.

GetClient reply packing

GetClientBandwidth, GetClientIOPS, and GetClientTokens appended onto
the inbound args iterator. That iterator is read-only; once qos_class
exists (after NFSv4 I/O) libdbus aborted in
dbus_message_iter_append_basic(). Pack those fields on the reply
iterator.

Change-Id: I5b3f0738827aea50a619c9604d75cf6a3c991183
Signed-off-by: Suhas Athani <Suhas.Athani@ibm.com>
---
M src/support/nfs_qosmgr.c
1 file changed, 157 insertions(+), 135 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/36/1247836/1

To view, visit change 1247836. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I5b3f0738827aea50a619c9604d75cf6a3c991183
Gerrit-Change-Number: 1247836
Gerrit-PatchSet: 1
Gerrit-Owner: Suhas Athani <Suhas.Athani@ibm.com>