]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: don't respond getattr with -EROFS when mds is readonly 32676/head
authorYan, Zheng <zyan@redhat.com>
Thu, 16 Jan 2020 09:45:21 +0000 (17:45 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 16 Jan 2020 09:45:21 +0000 (17:45 +0800)
Fixes: https://tracker.ceph.com/issues/43601
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/mds/Server.cc

index 35da262d408a17aa4c4f3a938eadb274b51c98e7..da11f9d7d8622e47820c690544254cc8fe176b61 100644 (file)
@@ -2435,12 +2435,16 @@ void Server::dispatch_client_request(MDRequestRef& mdr)
 
   dout(7) << "dispatch_client_request " << *req << dendl;
 
-  if (mdcache->is_readonly() ||
-      (mdr->has_more() && mdr->more()->slave_error == -EROFS)) {
+  if (req->may_write() && mdcache->is_readonly()) {
     dout(10) << " read-only FS" << dendl;
     respond_to_request(mdr, -EROFS);
     return;
   }
+  if (mdr->has_more() && mdr->more()->slave_error) {
+    dout(10) << " got error from slaves" << dendl;
+    respond_to_request(mdr, mdr->more()->slave_error);
+    return;
+  }
   
   if (is_full) {
     if (req->get_op() == CEPH_MDS_OP_SETLAYOUT ||