]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: non-head requests always rdlock as_anon
authorSage Weil <sage@newdream.net>
Thu, 5 Aug 2010 23:05:46 +0000 (16:05 -0700)
committerSage Weil <sage@newdream.net>
Thu, 5 Aug 2010 23:05:46 +0000 (16:05 -0700)
This ensures we can't do a snapped GETATTR and rdlock with EXCL on a
directory and miss out on cap metadata still with the client.

src/mds/Locker.cc

index 7af1406d43bc50ebd24ad0199397fe09710d3a6b..ed6936225a9dc24b2b3a71830b6d5f2e0c3ed6d6 100644 (file)
@@ -754,6 +754,9 @@ bool Locker::rdlock_start(SimpleLock *lock, MDRequest *mut, bool as_anon)
   dout(7) << "rdlock_start  on " << *lock << " on " << *lock->get_parent() << dendl;  
 
   // client may be allowed to rdlock the same item it has xlocked.
+  //  UNLESS someone passes in as_anon, or we're reading snapped version here.
+  if (mut->snapid != CEPH_NOSNAP)
+    as_anon = true;
   client_t client = as_anon ? -1 : mut->get_client();
 
   if (!lock->get_parent()->is_auth() &&