]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/admin_socket: return int from hook call()
authorSage Weil <sage@redhat.com>
Fri, 6 Sep 2019 15:36:31 +0000 (10:36 -0500)
committerSage Weil <sage@redhat.com>
Tue, 1 Oct 2019 21:30:53 +0000 (16:30 -0500)
commit9d772b8ea9e582075009cea6b8a6b6868e8e531a
tree72223ef5529d6370e1499e6c7c77541314a5b9ba
parent42823a092c9568d07c1188930aa0828db359876b
common/admin_socket: return int from hook call()

Previously, call() returned a bool.  Return an int instead so we can
wire this up to tell command return values.

The admin socket 'ceph daemon ...' unix domain socket protocol does not
pass a return code, only data, so we cannot pass these errors that way.
We have two choices: make error codes silently succeed when accessed via
asok (so that we get an error string etc), or make them fail without any
specific error code or string.

Unfortunately, there are several cases where an exception was caught and
what() returned as a string, or where error strings are returned.  These
would "blindly" fail if we took the latter approach.

So, for the asok interface, -ENOSYS means a "hard" error that gives the
user no data and makes the 'ceph daemon ...' command return an error code.
Other error codes are interpreted as a success.  This is ONLY for the
asok interface; the tell interface has full fidelity with error codes and
error strings.

Note that this means that 'net new' tell-style commands that we move over
to this handler will also appear to succeed via the 'ceph daemon'
interface when they return error codes.

Signed-off-by: Sage Weil <sage@redhat.com>
27 files changed:
src/client/Client.cc
src/client/Client.h
src/common/admin_socket.cc
src/common/admin_socket.h
src/common/ceph_context.cc
src/librbd/LibrbdAdminSocketHook.cc
src/librbd/LibrbdAdminSocketHook.h
src/mds/MDSDaemon.cc
src/mds/MDSDaemon.h
src/mds/MDSRank.cc
src/mds/MDSRank.h
src/mgr/ClusterState.cc
src/mon/Monitor.cc
src/os/bluestore/Allocator.cc
src/os/bluestore/BlueFS.cc
src/osd/OSD.cc
src/osdc/Objecter.cc
src/rgw/rgw_coroutine.cc
src/rgw/rgw_coroutine.h
src/rgw/rgw_sync_trace.cc
src/rgw/rgw_sync_trace.h
src/rgw/services/svc_sys_obj_cache.cc
src/test/admin_socket.cc
src/tools/rbd_mirror/ImageDeleter.cc
src/tools/rbd_mirror/ImageReplayer.cc
src/tools/rbd_mirror/Mirror.cc
src/tools/rbd_mirror/PoolReplayer.cc