1. 17 Feb, 2017 4 commits
  2. 15 Feb, 2017 1 commit
    • Tahsin Erdogan's avatar
      block: do not allow updates through sysfs until registration completes · b410aff2
      Tahsin Erdogan authored
      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: default avatarTahsin Erdogan <tahsin@google.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      b410aff2
  3. 10 Feb, 2017 3 commits
  4. 08 Feb, 2017 5 commits
  5. 06 Feb, 2017 1 commit
  6. 04 Feb, 2017 1 commit
  7. 03 Feb, 2017 3 commits
    • Jens Axboe's avatar
      block: free merged request in the caller · e4d750c9
      Jens Axboe authored
      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: default avatarPaolo Valente <paolo.valente@linaro.org>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      Reviewed-by: default avatarOmar Sandoval <osandov@fb.com>
      e4d750c9
    • Jens Axboe's avatar
      blk-merge: return the merged request · b973cb7e
      Jens Axboe authored
      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: default avatarJens Axboe <axboe@fb.com>
      Reviewed-by: default avatarOmar Sandoval <osandov@fb.com>
      b973cb7e
    • Hou Tao's avatar
      blkcg: fix double free of new_blkg in blkcg_init_queue · 9b54d816
      Hou Tao authored
      If blkg_create fails, new_blkg passed as an argument will
      be freed by blkg_create, so there is no need to free it again.
      Signed-off-by: default avatarHou Tao <houtao1@huawei.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      9b54d816
  8. 02 Feb, 2017 14 commits
  9. 01 Feb, 2017 6 commits
  10. 31 Jan, 2017 2 commits
    • Jens Axboe's avatar
      block: move internal_tag to same cache line as tag · d486f1f2
      Jens Axboe authored
      Since we removed cmd_type, we now have a hole in the struct. Move
      the internal_tag member to the same cacheline as tag, since we
      use them at the same time.
      
      This doesn't fix the hole, just moves it elsewhere.
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      d486f1f2
    • Christoph Hellwig's avatar
      block: fold cmd_type into the REQ_OP_ space · aebf526b
      Christoph Hellwig authored
      Instead of keeping two levels of indirection for requests types, fold it
      all into the operations.  The little caveat here is that previously
      cmd_type only applied to struct request, while the request and bio op
      fields were set to plain REQ_OP_READ/WRITE even for passthrough
      operations.
      
      Instead this patch adds new REQ_OP_* for SCSI passthrough and driver
      private requests, althought it has to add two for each so that we
      can communicate the data in/out nature of the request.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      aebf526b