From: Greg Farnum Date: Thu, 23 Oct 2014 00:16:31 +0000 (-0700) Subject: client: cast m->get_client_tid() to compare to 16-bit Inode::flushing_cap_tid X-Git-Tag: v0.80.8~40^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c20a2421f4a5b33407d7f31806dd4587b4e9077c;p=ceph.git client: cast m->get_client_tid() to compare to 16-bit Inode::flushing_cap_tid 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 (cherry picked from commit a5184cf46a6e867287e24aeb731634828467cd98) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 47d1c1d4620b..6b19a7a35584 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -3659,9 +3659,10 @@ void Client::handle_cap_flush_ack(MetaSession *session, Inode *in, Cap *cap, MCl int mds = session->mds_num; int dirty = m->get_dirty(); int cleaned = 0; + uint16_t flush_ack_tid = static_cast(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; }