]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: always release snap cap after flushsnap
authorSage Weil <sage@newdream.net>
Fri, 7 May 2010 18:58:16 +0000 (11:58 -0700)
committerSage Weil <sage@newdream.net>
Fri, 7 May 2010 18:59:23 +0000 (11:59 -0700)
The old condition makes no sense.  It appears to have been broken since
2008, commit a5d5e679?  Yikes.

The problem is that a flushsnap will 'release' the caps, but still leave
an open Capability on the CInode.  Then, CInode::encode_inodestat() would
& issued() when issuing caps, and a client ceph_open() would get no
caps.  The kclient is fixed up to at least not crash in that case, but even
with the fix it deadlocked.

src/mds/Locker.cc

index 30b8af039a34cb1eb332dbf55a903ad35241cc1b..c0942557a83cc8dc6f95ff606ac17bc9b4c6ac94 100644 (file)
@@ -1732,7 +1732,7 @@ void Locker::handle_client_caps(MClientCaps *m)
       }
 
       // remove cap _after_ do_cap_update() (which takes the Capability*)
-      if (in->last <= follows) {
+      if (in->last < CEPH_NOSNAP) {
        dout(10) << "  flushsnap releasing cloned cap" << dendl;
        in->remove_client_cap(client);
       } else {