]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/Server: clean up code for handle_client_open. 5553/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Tue, 11 Aug 2015 08:27:26 +0000 (16:27 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Thu, 13 Aug 2015 09:04:03 +0000 (17:04 +0800)
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/mds/Server.cc

index 875a26d42e20208df434c419eb3f4df51e44ab6e..22ab5c082621660fff447d06e387675771fc32f6 100644 (file)
@@ -2780,7 +2780,7 @@ void Server::handle_client_open(MDRequestRef& mdr)
   MClientRequest *req = mdr->client_request;
 
   int flags = req->head.args.open.flags;
-  int cmode = ceph_flags_to_mode(req->head.args.open.flags);
+  int cmode = ceph_flags_to_mode(flags);
 
   bool need_auth = !file_mode_is_readonly(cmode) || (flags & O_TRUNC);
 
@@ -2809,7 +2809,7 @@ void Server::handle_client_open(MDRequestRef& mdr)
       return;
   }
 
-  if (mdr->snapid != CEPH_NOSNAP && mdr->client_request->may_write()) {
+  if (mdr->snapid != CEPH_NOSNAP && req->may_write()) {
     respond_to_request(mdr, -EROFS);
     return;
   }
@@ -2829,7 +2829,7 @@ void Server::handle_client_open(MDRequestRef& mdr)
     respond_to_request(mdr, -ENXIO);                 // FIXME what error do we want?
     return;
     }*/
-  if ((req->head.args.open.flags & O_DIRECTORY) && !cur->inode.is_dir()) {
+  if ((flags & O_DIRECTORY) && !cur->inode.is_dir()) {
     dout(7) << "specified O_DIRECTORY on non-directory " << *cur << dendl;
     respond_to_request(mdr, -EINVAL);
     return;