]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: never complete a gather on a flushing lock
authorSage Weil <sage@newdream.net>
Sat, 6 Nov 2010 18:02:13 +0000 (11:02 -0700)
committerSage Weil <sage@newdream.net>
Sun, 7 Nov 2010 04:00:46 +0000 (21:00 -0700)
The scatter_writebehind() takes a wrlock, but that may still allow the lock
to complete a gather to LOCK and even move to say MIX before the data is
committed.  Bad news!

Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/Locker.cc
src/mds/SimpleLock.h

index 7f8e2344921158fed318a959e633906b37d1b609..ee1ccdc32575b8e2d57d1a6d62d88d07efb9e45c 100644 (file)
@@ -476,6 +476,7 @@ void Locker::eval_gather(SimpleLock *lock, bool first, bool *pneed_issue, list<C
       (IS_TRUE_AND_LT_AUTH(lock->get_sm()->states[next].can_wrlock, auth) || !lock->is_wrlocked()) &&
       (IS_TRUE_AND_LT_AUTH(lock->get_sm()->states[next].can_xlock, auth) || !lock->is_xlocked()) &&
       (IS_TRUE_AND_LT_AUTH(lock->get_sm()->states[next].can_lease, auth) || !lock->is_leased()) &&
+      (!lock->is_flushing()) &&  // i.e. wait for scatter_writebehind!
       (!caps || ((~lock->gcaps_allowed(CAP_ANY, next) & other_issued) == 0 &&
                 (~lock->gcaps_allowed(CAP_LONER, next) & loner_issued) == 0 &&
                 (~lock->gcaps_allowed(CAP_XLOCKER, next) & xlocker_issued) == 0)) &&
index 74a36d6fa525849f8646a4c841dd9c5ea40c2fe7..70507f792c40014240aa1a5c5293500e15c25e6b 100644 (file)
@@ -382,7 +382,7 @@ public:
 
   virtual bool is_dirty() const { return false; }
   virtual bool is_stale() const { return false; }
-
+  virtual bool is_flushing() const { return false; }
 
   // can_*
   bool can_lease(client_t client) const {