1. 26 Jul, 2011 3 commits
    • NeilBrown's avatar
      md/raid5: replace sh->lock with an 'active' flag. · c4c1663b
      NeilBrown authored
      sh->lock is now mainly used to ensure that two threads aren't running
      in the locked part of handle_stripe[56] at the same time.
      
      That can more neatly be achieved with an 'active' flag which we set
      while running handle_stripe.  If we find the flag is set, we simply
      requeue the stripe for later by setting STRIPE_HANDLE.
      
      For safety we take ->device_lock while examining the state of the
      stripe and creating a summary in 'stripe_head_state / r6_state'.
      This possibly isn't needed but as shared fields like ->toread,
      ->towrite are checked it is safer for now at least.
      
      We leave the label after the old 'unlock' called "unlock" because it
      will disappear in a few patches, so renaming seems pointless.
      
      This leaves the stripe 'locked' for longer as we clear STRIPE_ACTIVE
      later, but that is not a problem.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Reviewed-by: default avatarNamhyung Kim <namhyung@gmail.com>
      c4c1663b
    • NeilBrown's avatar
      md/raid5: Protect some more code with ->device_lock. · cbe47ec5
      NeilBrown authored
      Other places that change or follow dev->towrite and dev->written take
      the device_lock as well as the sh->lock.
      So it should really be held in these places too.
      Also, doing so will allow sh->lock to be discarded.
      
      with merged fixes by: Namhyung Kim <namhyung@gmail.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Reviewed-by: default avatarNamhyung Kim <namhyung@gmail.com>
      cbe47ec5
    • NeilBrown's avatar
      md/raid5: Remove use of sh->lock in sync_request · 83206d66
      NeilBrown authored
      This is the start of a series of patches to remove sh->lock.
      
      sync_request takes sh->lock before setting STRIPE_SYNCING to ensure
      there is no race with testing it in handle_stripe[56].
      
      Instead, use a new flag STRIPE_SYNC_REQUESTED and test it early
      in handle_stripe[56] (after getting the same lock) and perform the
      same set/clear operations if it was set.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Reviewed-by: default avatarNamhyung Kim <namhyung@gmail.com>
      83206d66
  2. 18 Jul, 2011 5 commits
  3. 16 Jul, 2011 2 commits
  4. 15 Jul, 2011 10 commits
  5. 14 Jul, 2011 2 commits
  6. 13 Jul, 2011 11 commits
  7. 12 Jul, 2011 7 commits