From: Jeff Layton Date: Fri, 25 Aug 2017 12:31:47 +0000 (-0400) Subject: client: rework Client::get_local_osd() return codes X-Git-Tag: v12.2.3~94^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=20164df443795c4bde6bfdbb9eeda34e915c7557;p=ceph.git client: rework Client::get_local_osd() return codes 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 (cherry picked from commit 4285b970cb57c88deae0317be24afcf21a95fdc0) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 1b08b3c3a2fe..60f3411370ec 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -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& 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);