Revision 2754dc7d

b/src/Ganeti/Locking/Allocation.hs
39 39
  , opportunisticLockUnion
40 40
  ) where
41 41

  
42
import Control.Applicative (liftA2)
42
import Control.Applicative (liftA2, (<$>), (<*>))
43 43
import Control.Arrow (second, (***))
44 44
import Control.Monad
45 45
import Data.Foldable (for_, find)
......
240 240
                                   ++ " while holding " ++ show highest
241 241
    for_ reqs $ \req -> case req of
242 242
      LockRequest lock (Just OwnExclusive)
243
        | lock < highest && notHolding [ (lock, OwnExclusive) ]
243
        | lock < highest && notHolding ((,) <$> lock : lockImplications lock
244
                                            <*> [OwnExclusive])
244 245
        -> orderViolation lock
245 246
      LockRequest lock (Just OwnShared)
246
        | lock < highest && notHolding [ (lock, OwnShared)
247
                                       , (lock, OwnExclusive)]
247
        | lock < highest && notHolding ((,) <$> lock : lockImplications lock
248
                                            <*> [OwnExclusive, OwnShared])
248 249
        -> orderViolation lock
249 250
      _ -> Ok ()
250 251
  let sharedsHeld = M.keysSet $ M.filter (== OwnShared) current

Also available in: Unified diff