From 4c47df35c38eb6065f1a8ca7d97126f605d10701 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 24 Jun 2011 10:46:32 -0700 Subject: [PATCH] client: prefer auth cap in caps_issued_mask() If we have an auth cap, prefer to touch that one. This helps consolidate caps on a single mds and allows mds replicas to eventually recall their state. Signed-off-by: Sage Weil --- src/client/Client.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/client/Client.h b/src/client/Client.h index cd5ba72e28471..292bac5d0d498 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -601,6 +601,14 @@ class Inode { int c = exporting_issued | snap_caps; if ((c & mask) == mask) return true; + // prefer auth cap + if (auth_cap && + cap_is_valid(auth_cap) && + (auth_cap->issued & mask) == mask) { + touch_cap(auth_cap); + return true; + } + // try any cap for (map::iterator it = caps.begin(); it != caps.end(); it++) { -- 2.39.5