]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds/server: clean up handle_client_open()
authorhuanwen ren <ren.huanwen@zte.com.cn>
Mon, 19 Sep 2016 00:50:47 +0000 (08:50 +0800)
committerhuanwen ren <ren.huanwen@zte.com.cn>
Mon, 19 Sep 2016 00:50:47 +0000 (08:50 +0800)
Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
src/mds/Server.cc

index 40d9fd8db3f7ce2cf14dcc38f9abb1cf7c106111..98c8070969e54b5fa40eb8e5a9c0c1a73f06181d 100644 (file)
@@ -2889,18 +2889,16 @@ void Server::_lookup_ino_2(MDRequestRef& mdr, int r)
 void Server::handle_client_open(MDRequestRef& mdr)
 {
   MClientRequest *req = mdr->client_request;
+  dout(7) << "open on " << req->get_filepath() << dendl;
 
   int flags = req->head.args.open.flags;
   int cmode = ceph_flags_to_mode(flags);
-
-  bool need_auth = !file_mode_is_readonly(cmode) || (flags & O_TRUNC);
-
-  dout(7) << "open on " << req->get_filepath() << dendl;
-
   if (cmode < 0) {
     respond_to_request(mdr, -EINVAL);
     return;
   }
+  
+  bool need_auth = !file_mode_is_readonly(cmode) || (flags & O_TRUNC);
 
   if ((cmode & CEPH_FILE_MODE_WR) && mdcache->is_readonly()) {
     dout(7) << "read-only FS" << dendl;