1. 15 2月, 2017 1 次提交
    • T
      block: do not allow updates through sysfs until registration completes · b410aff2
      Tahsin Erdogan 提交于
      When a new disk shows up, sysfs queue directory is created before elevator
      is registered. This allows a user to attempt a scheduler switch even though
      the initial registration hasn't completed yet.
      
      In one scenario, blk_register_queue() calls elv_register_queue() and
      right before cfq_registered_queue() is called, another process executes
      elevator_switch() and replaces q->elevator with deadline scheduler. When
      cfq_registered_queue() executes it interprets e->elevator_data as struct
      cfq_data even though it is actually struct deadline_data.
      
      Grab q->sysfs_lock in blk_register_queue() to synchronize with sysfs
      callers.
      Signed-off-by: NTahsin Erdogan <tahsin@google.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      b410aff2
  2. 11 2月, 2017 3 次提交
  3. 09 2月, 2017 5 次提交
  4. 07 2月, 2017 1 次提交
  5. 05 2月, 2017 1 次提交
  6. 04 2月, 2017 2 次提交
    • J
      block: free merged request in the caller · e4d750c9
      Jens Axboe 提交于
      If we end up doing a request-to-request merge when we have completed
      a bio-to-request merge, we free the request from deep down in that
      path. For blk-mq-sched, the merge path has to hold the appropriate
      lock, but we don't need it for freeing the request. And in fact
      holding the lock is problematic, since we are now calling the
      mq sched put_rq_private() hook with the lock held. Other call paths
      do not hold this lock.
      
      Fix this inconsistency by ensuring that the caller frees a merged
      request. Then we can do it outside of the lock, making it both more
      efficient and fixing the blk-mq-sched problem of invoking parts of
      the scheduler with an unknown lock state.
      Reported-by: NPaolo Valente <paolo.valente@linaro.org>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      Reviewed-by: NOmar Sandoval <osandov@fb.com>
      e4d750c9
    • J
      blk-merge: return the merged request · b973cb7e
      Jens Axboe 提交于
      When we attempt to merge request-to-request, we return a 0/1 if we
      ended up merging or not. Change that to return the pointer to the
      request that we freed. We will use this to move the freeing of
      that request out of the merge logic, so that callers can drop
      locks before freeing the request.
      
      There should be no functional changes in this patch.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      Reviewed-by: NOmar Sandoval <osandov@fb.com>
      b973cb7e
  7. 03 2月, 2017 9 次提交
  8. 02 2月, 2017 12 次提交
  9. 01 2月, 2017 6 次提交