From 22d2987972a3ca7eaccd30df2260dfa347b6ca7d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 21 Apr 2009 15:12:06 -0700 Subject: [PATCH] kclient: queue cap or delayed check if we get unwanted WR|EXCL caps This ensures we eventually release unwanted WR|EXCL caps. --- src/kernel/caps.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/kernel/caps.c b/src/kernel/caps.c index 255f60b836283..6d7aa08caf867 100644 --- a/src/kernel/caps.c +++ b/src/kernel/caps.c @@ -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); } -- 2.39.5