]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
check mdr->ls before trying to write to it 4218/head
authorJohn Spray <john.spray@redhat.com>
Thu, 2 Apr 2015 15:45:13 +0000 (16:45 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 2 Apr 2015 15:45:13 +0000 (16:45 +0100)
Not all may_write operations actually log anything (e.g. setfilelock)

squash into: mds: persist completed_requests reliably

src/mds/Server.cc

index 8dfa36bc576706c4964e4a8b47edff5a933a299d..bd30f065469ac2133f8ddbcbb86668d8494a3d3d 100644 (file)
@@ -1081,7 +1081,9 @@ void Server::reply_client_request(MDRequestRef& mdr, MClientReply *reply)
   if (req->may_write() && mdr->session && reply->get_result() == 0) {
     inodeno_t created = mdr->alloc_ino ? mdr->alloc_ino : mdr->used_prealloc_ino;
     mdr->session->add_completed_request(mdr->reqid.tid, created);
-    mdr->ls->touched_sessions.insert(mdr->session->info.inst.name);
+    if (mdr->ls) {
+      mdr->ls->touched_sessions.insert(mdr->session->info.inst.name);
+    }
   }
 
   // give any preallocated inos to the session