]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: expose projected values for all locks to loner (not just filelock)
authorSage Weil <sage@newdream.net>
Tue, 24 Aug 2010 17:38:21 +0000 (10:38 -0700)
committerSage Weil <sage@newdream.net>
Tue, 24 Aug 2010 19:13:53 +0000 (12:13 -0700)
There is nothing special about filelock in this case.  If the client is
the loner, we should use the projected values.  This is important when
we are looking at a snapid on the head (see snaptest-authwb.sh).

src/mds/CInode.cc

index d248a1ffd4a9c79e91f8ffc2afb99973654d7388..82a3db44e28bfed48e9c5c959b5603442a298d65 100644 (file)
@@ -1688,9 +1688,9 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session,
   Capability *cap = get_client_cap(client);
   bool pfile = filelock.is_xlocked_by_client(client) || get_loner() == client;
   //(cap && (cap->issued() & CEPH_CAP_FILE_EXCL));
-  bool pauth = authlock.is_xlocked_by_client(client);
-  bool plink = linklock.is_xlocked_by_client(client);
-  bool pxattr = xattrlock.is_xlocked_by_client(client);
+  bool pauth = authlock.is_xlocked_by_client(client) || get_loner() == client;
+  bool plink = linklock.is_xlocked_by_client(client) || get_loner() == client;
+  bool pxattr = xattrlock.is_xlocked_by_client(client) || get_loner() == client;
 
   bool plocal = versionlock.get_last_wrlock_client() == client;