From: Xiubo Li Date: Thu, 3 Sep 2020 23:52:10 +0000 (-0400) Subject: client: make the osdmap wait under the mount_state reader check X-Git-Tag: v16.1.0~1188^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F36983%2Fhead;p=ceph.git client: make the osdmap wait under the mount_state reader check It will make no sense to check this if the unmouting is already going on. https://tracker.ceph.com/issues/47293 Signed-off-by: Xiubo Li --- diff --git a/src/client/Client.cc b/src/client/Client.cc index c042dee46099..87878b001e32 100755 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -11616,12 +11616,12 @@ int Client::fremovexattr(int fd, const char *name, const UserPerm& perms) int Client::setxattr(const char *path, const char *name, const void *value, size_t size, int flags, const UserPerm& perms) { - _setxattr_maybe_wait_for_osdmap(name, value, size); - RWRef_t mref_reader(mount_state, CLIENT_MOUNTING); if (!mref_reader.is_state_satisfied()) return -ENOTCONN; + _setxattr_maybe_wait_for_osdmap(name, value, size); + std::scoped_lock lock(client_lock); InodeRef in; @@ -11634,12 +11634,12 @@ int Client::setxattr(const char *path, const char *name, const void *value, int Client::lsetxattr(const char *path, const char *name, const void *value, size_t size, int flags, const UserPerm& perms) { - _setxattr_maybe_wait_for_osdmap(name, value, size); - RWRef_t mref_reader(mount_state, CLIENT_MOUNTING); if (!mref_reader.is_state_satisfied()) return -ENOTCONN; + _setxattr_maybe_wait_for_osdmap(name, value, size); + std::scoped_lock lock(client_lock); InodeRef in; @@ -11652,12 +11652,12 @@ int Client::lsetxattr(const char *path, const char *name, const void *value, int Client::fsetxattr(int fd, const char *name, const void *value, size_t size, int flags, const UserPerm& perms) { - _setxattr_maybe_wait_for_osdmap(name, value, size); - RWRef_t mref_reader(mount_state, CLIENT_MOUNTING); if (!mref_reader.is_state_satisfied()) return -ENOTCONN; + _setxattr_maybe_wait_for_osdmap(name, value, size); + std::scoped_lock lock(client_lock); Fh *f = get_filehandle(fd);