1. 20 Jul, 2016 2 commits
    • Joe Thornber's avatar
      dm thin: fix a race condition between discarding and provisioning a block · 2a0fbffb
      Joe Thornber authored
      The discard passdown was being issued after the block was unmapped,
      which meant the block could be reprovisioned whilst the passdown discard
      was still in flight.
      We can only identify unshared blocks (safe to do a passdown a discard
      to) once they're unmapped and their ref count hits zero.  Block ref
      counts are now used to guard against concurrent allocation of these
      blocks that are being discarded.  So now we unmap the block, issue
      passdown discards, and the immediately increment ref counts for regions
      that have been discarded via passed down (this is safe because
      allocation occurs within the same thread).  We then decrement ref counts
      once the passdown discard IO is complete -- signaling these blocks may
      now be allocated.
      This fixes the potential for corruption that was reported here:
      Reported-by: default avatarDennis Yang <dennisyang@qnap.com>
      Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    • Joe Thornber's avatar
      dm btree: fix a bug in dm_btree_find_next_single() · e7e0f730
      Joe Thornber authored
      dm_btree_find_next_single() can short-circuit the search for a block
      with a return of -ENODATA if all entries are higher than the search key
      passed to lower_bound().
      This hasn't been a problem because of the way the btree has been used by
      DM thinp.  But it must be fixed now in preparation for fixing the race
      in DM thinp's handling of simultaneous block discard vs allocation.
      Otherwise, once that fix is in place, some of the blocks in a discard
      would not be unmapped as expected.
      Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
  2. 19 Jul, 2016 2 commits
  3. 18 Jul, 2016 27 commits
  4. 06 Jul, 2016 1 commit
  5. 02 Jul, 2016 1 commit
  6. 01 Jul, 2016 2 commits
  7. 16 Jun, 2016 1 commit
  8. 14 Jun, 2016 4 commits