1. 02 Nov, 2021 1 commit
    • Yu Kuai's avatar
      nbd: fix max value for 'first_minor' · e4c4871a
      Yu Kuai authored
      commit b1a81163 ("block: nbd: add sanity check for first_minor")
      checks that 'first_minor' should not be greater than 0xff, which is
      wrong. Whitout the commit, the details that when user pass 0x100000,
      it ends up create sysfs dir "/sys/block/43:0" are as follows:
      
      nbd_dev_add
       disk->first_minor = index << part_shift
        -> default part_shift is 5, first_minor is 0x2000000
        device_add_disk
         ddev->devt = MKDEV(disk->major, disk->first_minor)
          -> (0x2b << 20) | (0x2000000) = 0x2b00000
         device_add
          device_create_sys_dev_entry
      	 format_dev_t
      	  sprintf(buffer, "%u:%u", MAJOR(dev), MINOR(dev));
      	   -> got 43:0
      	  sysfs_create_link -> /sys/block/43:0
      
      By the way, with the wrong fix, when part_shift is the default value,
      only 8 ndb devices can be created since 8 << 5 is greater than 0xff.
      
      Since the max bits for 'first_minor' should be the same as what
      MKDEV() does, which is 20. Change the upper bound of 'first_minor'
      from 0xff to 0xfffff.
      
      Fixes: b1a81163 ("block: nbd: add sanity check for first_minor")
      Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
      Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Link: https://lore.kernel.org/r/20211102015237.2309763-2-yebin10@huawei.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
      e4c4871a
  2. 30 Oct, 2021 4 commits
  3. 29 Oct, 2021 4 commits
  4. 28 Oct, 2021 1 commit
  5. 27 Oct, 2021 4 commits
  6. 25 Oct, 2021 1 commit
    • Michael Schmitz's avatar
      block: ataflop: more blk-mq refactoring fixes · d28e4dff
      Michael Schmitz authored
      As it turns out, my earlier patch in commit 86d46fda (block:
      ataflop: fix breakage introduced at blk-mq refactoring) was
      incomplete. This patch fixes any remaining issues found during
      more testing and code review.
      
      Requests exceeding 4 k are handled in 4k segments but
      __blk_mq_end_request() is never called on these (still
      sectors outstanding on the request). With redo_fd_request()
      removed, there is no provision to kick off processing of the
      next segment, causing requests exceeding 4k to hang. (By
      setting /sys/block/fd0/queue/max_sectors_k <= 4 as workaround,
      this behaviour can be avoided).
      
      Instead of reintroducing redo_fd_request(), requeue the remainder
      of the request by calling blk_mq_requeue_request() on incomplete
      requests (i.e. when blk_update_request() still returns true), and
      rely on the block layer to queue the residual as new request.
      
      Both error handling and formatting needs to release the
      ST-DMA lock, so call finish_fdc() on these (this was previously
      handled by redo_fd_request()). finish_fdc() may be called
      legitimately without the ST-DMA lock held - make sure we only
      release the lock if we actually held it. In a similar way,
      early exit due to errors in ataflop_queue_rq() must release
      the lock.
      
      After minor errors, fd_error sets up to recalibrate the drive
      but never re-runs the current operation (another task handled by
      redo_fd_request() before). Call do_fd_action() to get the next
      steps (seek, retry read/write) underway.
      Signed-off-by: default avatarMichael Schmitz <schmitzmic@gmail.com>
      Fixes: 6ec3938c (ataflop: convert to blk-mq)
      CC: linux-block@vger.kernel.org
      Link: https://lore.kernel.org/r/20211024002013.9332-1-schmitzmic@gmail.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
      d28e4dff
  7. 22 Oct, 2021 1 commit
  8. 21 Oct, 2021 9 commits
  9. 20 Oct, 2021 15 commits