]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: cast m->get_client_tid() to compare to 16-bit Inode::flushing_cap_tid 2786/head
authorGreg Farnum <greg@inktank.com>
Thu, 23 Oct 2014 00:16:31 +0000 (17:16 -0700)
committerGreg Farnum <gfarnum@redhat.com>
Mon, 27 Oct 2014 23:19:13 +0000 (16:19 -0700)
m->get_client_tid() is 64 bits (as it should be), but Inode::flushing_cap_tid
is only 16 bits. 16 bits should be plenty to let the cap flush updates
pipeline appropriately, but we need to cast in the proper direction when
comparing these differently-sized versions. So downcast the 64-bit one
to 16 bits.

Fixes: #9869
Backport: giant, firefly, dumpling

Signed-off-by: Greg Farnum <greg@inktank.com>
src/client/Client.cc

index 29b92d964c696848a3150cef329ee5a9ab8e670b..749e67d4e62ab3ca6d75a4a0d01ee80e658d06f9 100644 (file)
@@ -3860,9 +3860,10 @@ void Client::handle_cap_flush_ack(MetaSession *session, Inode *in, Cap *cap, MCl
   mds_rank_t mds = session->mds_num;
   int dirty = m->get_dirty();
   int cleaned = 0;
+  uint16_t flush_ack_tid = static_cast<uint16_t>(m->get_client_tid());
   for (int i = 0; i < CEPH_CAP_BITS; ++i) {
     if ((dirty & (1 << i)) &&
-       (m->get_client_tid() == in->flushing_cap_tid[i]))
+       (flush_ack_tid == in->flushing_cap_tid[i]))
       cleaned |= 1 << i;
   }