This change will propagate the errors that WNBD may return when
spinning up the IO workers.
Also, we'll avoid removing the registry record for failed
non-persistent mappings. Those will be cleaned up when the service
restarts or when explicitly unmapped.
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
g_conf().get_val<bool>("rbd_cache"),
cfg->io_req_workers,
cfg->io_reply_workers);
- handler->start();
+ r = handler->start();
+ if (r) {
+ r = r == ERROR_ALREADY_EXISTS ? -EEXIST : -EINVAL;
+ goto close_ret;
+ }
// We're informing the parent processes that the initialization
// was successful.
handler->wait();
handler->shutdown();
+ // The registry record shouldn't be removed for (already) running mappings.
if (!cfg->persistent) {
dout(5) << __func__ << ": cleaning up non-persistent mapping: "
<< cfg->devpath << dendl;