]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: make the osdmap wait under the mount_state reader check 36983/head
authorXiubo Li <xiubli@redhat.com>
Thu, 3 Sep 2020 23:52:10 +0000 (19:52 -0400)
committerXiubo Li <xiubli@redhat.com>
Fri, 4 Sep 2020 02:50:03 +0000 (22:50 -0400)
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 <xiubli@redhat.com>
src/client/Client.cc

index c042dee4609987800a8b1715e14b236f9cdd2127..87878b001e32519bdcdf27ddfd5d5011b37ef83f 100755 (executable)
@@ -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);