Skip to content

Commit bbde525

Browse files
committed
client: make sure the callback is finished when returning ENOTCONN
when the client is not mounted Fixes: https://tracker.ceph.com/issues/63629 Signed-off-by: Dhairya Parmar <[email protected]>
1 parent a67d081 commit bbde525

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/client/Client.cc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15948,12 +15948,21 @@ int64_t Client::ll_preadv_pwritev(struct Fh *fh, const struct iovec *iov,
1594815948
bool do_fsync, bool syncdataonly)
1594915949
{
1595015950
RWRef_t mref_reader(mount_state, CLIENT_MOUNTING);
15951-
if (!mref_reader.is_state_satisfied())
15952-
return -CEPHFS_ENOTCONN;
15951+
if (!mref_reader.is_state_satisfied()) {
15952+
int64_t rc = -CEPHFS_ENOTCONN;
15953+
if (onfinish != nullptr) {
15954+
onfinish->complete(rc);
15955+
/* async call should always return zero to caller and allow the
15956+
caller to wait on callback for the actual errno. */
15957+
rc = 0;
15958+
}
15959+
return rc;
15960+
}
1595315961

1595415962
std::scoped_lock cl(client_lock);
1595515963
return _preadv_pwritev_locked(fh, iov, iovcnt, offset, write, true,
1595615964
onfinish, bl, do_fsync, syncdataonly);
15965+
1595715966
}
1595815967

1595915968
int Client::ll_flush(Fh *fh)

0 commit comments

Comments
 (0)