From: Yan, Zheng Date: Thu, 16 Jan 2020 09:45:21 +0000 (+0800) Subject: mds: don't respond getattr with -EROFS when mds is readonly X-Git-Tag: v15.1.0~153^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=efcc49de79cac0724568df8192be0c104bbebdf5;p=ceph.git mds: don't respond getattr with -EROFS when mds is readonly Fixes: https://tracker.ceph.com/issues/43601 Signed-off-by: "Yan, Zheng" --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 35da262d408..da11f9d7d86 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -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 ||