]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: rework Client::get_local_osd() return codes
authorJeff Layton <jlayton@redhat.com>
Fri, 25 Aug 2017 12:31:47 +0000 (08:31 -0400)
committerNathan Cutler <ncutler@suse.com>
Sun, 28 Jan 2018 21:32:14 +0000 (22:32 +0100)
It currently returns -1 when there isn't one, but the C wrapper can
also return -ENOTCONN if the cmount isn't mounted. Change it to return
-ENXIO (No such device or address) in the case of "no local osd".

Signed-off-by: Jeff Layton <jlayton@redhat.com>
(cherry picked from commit 4285b970cb57c88deae0317be24afcf21a95fdc0)

src/client/Client.cc

index 1b08b3c3a2febb62d8f1584935befb0308e843d9..60f3411370ecc05d09a3f0ec1e397b92909dbfed 100644 (file)
@@ -252,7 +252,7 @@ Client::Client(Messenger *m, MonClient *mc, Objecter *objecter_)
     last_tid(0), oldest_tid(0), last_flush_tid(1),
     initialized(false),
     mounted(false), unmounting(false), blacklisted(false),
-    local_osd(-1), local_osd_epoch(0),
+    local_osd(-ENXIO), local_osd_epoch(0),
     unsafe_sync_write(0),
     client_lock("Client::client_lock"),
     deleg_timeout(0)
@@ -13369,9 +13369,7 @@ int Client::enumerate_layout(int fd, vector<ObjectExtent>& result,
 }
 
 
-/*
- * find an osd with the same ip.  -1 if none.
- */
+/* find an osd with the same ip.  -ENXIO if none. */
 int Client::get_local_osd()
 {
   Mutex::Locker lock(client_lock);