]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: queue cap or delayed check if we get unwanted WR|EXCL caps
authorSage Weil <sage@newdream.net>
Tue, 21 Apr 2009 22:12:06 +0000 (15:12 -0700)
committerSage Weil <sage@newdream.net>
Tue, 21 Apr 2009 23:27:10 +0000 (16:27 -0700)
This ensures we eventually release unwanted WR|EXCL caps.

src/kernel/caps.c

index 255f60b8362832e6e1bba9845392cf5da7440b38..6d7aa08caf867e989a0d60e1cbd83fa1ac1bd44b 100644 (file)
@@ -510,13 +510,16 @@ retry:
        }
 
        /*
-        * If we are issued caps we don't want, queue a check so we'll
-        * update the mds wanted value.
+        * If we are issued caps we don't want, or the mds' wanted
+        * value appears to be off, queue a check so we'll release
+        * later and/or update the mds wanted value.
         */
        actual_wanted = __ceph_caps_wanted(ci);
-       if (wanted & ~actual_wanted) {
-               dout(10, " mds wanted %s, actual wanted %s, queueing\n",
-                    ceph_cap_string(wanted), ceph_cap_string(actual_wanted));
+       if ((wanted & ~actual_wanted) ||
+           (issued & ~actual_wanted & CEPH_CAP_ANY_WR)) {
+               dout(10, " issued %s, mds wanted %s, actual %s, queueing\n",
+                    ceph_cap_string(issued), ceph_cap_string(wanted),
+                    ceph_cap_string(actual_wanted));
                __cap_set_timeouts(mdsc, ci);
                __cap_delay_requeue(mdsc, ci);
        }