]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: don't update flushing_cap_seq when there are flushing caps
authorYan, Zheng <zyan@redhat.com>
Wed, 27 May 2015 07:10:31 +0000 (15:10 +0800)
committerYan, Zheng <zyan@redhat.com>
Fri, 29 May 2015 02:03:01 +0000 (10:03 +0800)
Current code always updates flushing_cap_seq when marking dirty
caps as flushing. If there are old flushing caps, updating
flushing_cap_seq confuses Client::wait_sync_caps(uint64_t), make
it think that the old caps have been flushed.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/client/Client.cc

index 24e135cdeb1fefb484b263f0ad8a26ea2f5a42e4..57850db6d6b1b8b03688a5361307d4fb4e98f46b 100644 (file)
@@ -3711,8 +3711,9 @@ int Client::mark_caps_flushing(Inode *in)
   int flushing = in->dirty_caps;
   assert(flushing);
 
-  if (flushing && !in->flushing_caps) {
+  if (!in->flushing_caps) {
     ldout(cct, 10) << "mark_caps_flushing " << ccap_string(flushing) << " " << *in << dendl;
+    in->flushing_cap_seq = ++last_flush_seq;
     num_flushing_caps++;
   } else {
     ldout(cct, 10) << "mark_caps_flushing (more) " << ccap_string(flushing) << " " << *in << dendl;
@@ -3721,7 +3722,6 @@ int Client::mark_caps_flushing(Inode *in)
   in->flushing_caps |= flushing;
   in->dirty_caps = 0;
  
-  in->flushing_cap_seq = ++last_flush_seq;
 
   session->flushing_caps.push_back(&in->flushing_cap_item);