]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: eliminate OP_CREATE; make open O_TRUNC|O_CREAT retry behave
authorSage Weil <sage@newdream.net>
Tue, 13 May 2008 14:39:42 +0000 (07:39 -0700)
committerSage Weil <sage@newdream.net>
Tue, 13 May 2008 14:39:42 +0000 (07:39 -0700)
src/TODO
src/include/ceph_fs.h
src/mds/Server.cc

index a3c8d024bdabaa08c385c732cda4a9033b280f06..88d0c292d8b64e7cc23870c85b84bf652a0d976b 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -25,14 +25,12 @@ userspace client
   - also needs cope with mds failures
 
 kernel client
-- direct mds requests intelligently
 - flush caps on sync, fsync, etc.
   - do we need to block?
 - timeout mds session close on umount
 - deal with CAP_RDCACHE properly: invalidate cache pages?
 - what happens after reconnect when we get successful reply but no trace (!) on e.g. rename, unlink, link, open+O_CREAT, etc...
   - fallback in each case (in ceph_unlink, _rename, etc.) when reply has no trace?
-  - what about open(O_WR or O_CREAT)?  pbly needs fix in mds... tho it's racey now...
 - procfs/debugfs
   - adjust granular debug levels too
     - should we be using debugfs?
index 0853d276f6aaf8deb89f85e8038a741f42b6be28..e2f21de01897dd79258b03dabf5eb7606394e8c0 100644 (file)
@@ -483,7 +483,6 @@ enum {
        CEPH_MDS_OP_RMDIR     = 0x01221,
        CEPH_MDS_OP_SYMLINK   = 0x01222,
 
-       CEPH_MDS_OP_CREATE    = 0x10301,
        CEPH_MDS_OP_OPEN      = 0x10302,
        CEPH_MDS_OP_TRUNCATE  = 0x11303,
        CEPH_MDS_OP_LTRUNCATE = 0x01303,
index 060f385739894fe2bbdb23a28b568ad1c36f44dc..c5a5e0b847f5fe097bb22d263ec62560cde27531 100644 (file)
@@ -683,7 +683,8 @@ void Server::handle_client_request(MClientRequest *req)
   }
 
   // retry?
-  if (req->get_retry_attempt()) {
+  if (req->get_retry_attempt() &&
+      req->get_op() != CEPH_MDS_OP_OPEN) {
     assert(session);
     if (session->have_completed_request(req->get_reqid().tid)) {
       dout(5) << "already completed " << req->get_reqid() << dendl;
@@ -758,12 +759,12 @@ void Server::dispatch_client_request(MDRequest *mdr)
 
     // funky.
   case CEPH_MDS_OP_OPEN:
-    if ((req->head.args.open.flags & O_CREAT) == 0) {
+    if ((req->head.args.open.flags & O_CREAT) &&
+       !(req->get_retry_attempt() &&
+         mdr->session->have_completed_request(req->get_reqid().tid)))
+      handle_client_openc(mdr);
+    else 
       handle_client_open(mdr);
-      break;
-    }
-  case CEPH_MDS_OP_CREATE:
-    handle_client_openc(mdr);
     break;
 
     // namespace.
@@ -3988,7 +3989,9 @@ void Server::handle_client_open(MDRequest *mdr)
   // hmm, check permissions or something.
 
   // O_TRUNC
-  if (flags & O_TRUNC) {
+  if ((flags & O_TRUNC) &&
+      !(req->get_retry_attempt() &&
+       mdr->session->have_completed_request(req->get_reqid().tid))) {
     assert(cur->is_auth());
 
     // xlock file size