1. 16 11月, 2020 15 次提交
  2. 13 11月, 2020 1 次提交
  3. 10 11月, 2020 1 次提交
  4. 07 11月, 2020 1 次提交
    • D
      null_blk: Fix scheduling in atomic with zoned mode · e1777d09
      Damien Le Moal 提交于
      Commit aa1c09cb ("null_blk: Fix locking in zoned mode") changed
      zone locking to using the potentially sleeping wait_on_bit_io()
      function. This is acceptable when memory backing is enabled as the
      device queue is in that case marked as blocking, but this triggers a
      scheduling while in atomic context with memory backing disabled.
      
      Fix this by relying solely on the device zone spinlock for zone
      information protection without temporarily releasing this lock around
      null_process_cmd() execution in null_zone_write(). This is OK to do
      since when memory backing is disabled, command processing does not
      block and the memory backing lock nullb->lock is unused. This solution
      avoids the overhead of having to mark a zoned null_blk device queue as
      blocking when memory backing is unused.
      
      This patch also adds comments to the zone locking code to explain the
      unusual locking scheme.
      
      Fixes: aa1c09cb ("null_blk: Fix locking in zoned mode")
      Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      e1777d09
  5. 29 10月, 2020 4 次提交
    • A
      xsysace: use platform_get_resource() and platform_get_irq_optional() · 7cb6e22b
      Andy Shevchenko 提交于
      Use platform_get_resource() to fetch the memory resource and
      platform_get_irq_optional() to get optional IRQ instead of
      open-coded variants.
      
      IRQ is not supposed to be changed at runtime, so there is
      no functional change in ace_fsm_yieldirq().
      
      On the other hand we now take first resources instead of last ones
      to proceed. I can't imagine how broken should be firmware to have
      a garbage in the first resource slots. But if it the case, it needs
      to be documented.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: NMichal Simek <michal.simek@xilinx.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      7cb6e22b
    • D
      null_blk: Fix locking in zoned mode · aa1c09cb
      Damien Le Moal 提交于
      When the zoned mode is enabled in null_blk, Serializing read, write
      and zone management operations for each zone is necessary to protect
      device level information for managing zone resources (zone open and
      closed counters) as well as each zone condition and write pointer
      position. Commit 35bc10b2 ("null_blk: synchronization fix for
      zoned device") introduced a spinlock to implement this serialization.
      However, when memory backing is also enabled, GFP_NOIO memory
      allocations are executed under the spinlock, resulting in might_sleep()
      warnings. Furthermore, the zone_lock spinlock is locked/unlocked using
      spin_lock_irq/spin_unlock_irq, similarly to the memory backing code with
      the nullb->lock spinlock. This nested use of irq locks wrecks the irq
      enabled/disabled state.
      
      Fix all this by introducing a bitmap for per-zone lock, with locking
      implemented using wait_on_bit_lock_io() and clear_and_wake_up_bit().
      This locking mechanism allows keeping a zone locked while executing
      null_process_cmd(), serializing all operations to the zone while
      allowing to sleep during memory backing allocation with GFP_NOIO.
      Device level zone resource management information is protected using
      a spinlock which is not held while executing null_process_cmd();
      
      Fixes: 35bc10b2 ("null_blk: synchronization fix for zoned device")
      Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      aa1c09cb
    • D
      null_blk: Fix zone reset all tracing · f9c91042
      Damien Le Moal 提交于
      In the cae of the REQ_OP_ZONE_RESET_ALL operation, the command sector is
      ignored and the operation is applied to all sequential zones. For these
      commands, tracing the effect of the command using the command sector to
      determine the target zone is thus incorrect.
      
      Fix null_zone_mgmt() zone condition tracing in the case of
      REQ_OP_ZONE_RESET_ALL to apply tracing to all sequential zones that are
      not already empty.
      
      Fixes: 766c3297 ("null_blk: add trace in null_blk_zoned.c")
      Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      f9c91042
    • M
      nbd: don't update block size after device is started · b40813dd
      Ming Lei 提交于
      Mounted NBD device can be resized, one use case is rbd-nbd.
      
      Fix the issue by setting up default block size, then not touch it
      in nbd_size_update() any more. This kind of usage is aligned with loop
      which has same use case too.
      
      Cc: stable@vger.kernel.org
      Fixes: c8a83a6b ("nbd: Use set_blocksize() to set device blocksize")
      Reported-by: Nlining <lining2020x@163.com>
      Signed-off-by: NMing Lei <ming.lei@redhat.com>
      Cc: Josef Bacik <josef@toxicpanda.com>
      Cc: Jan Kara <jack@suse.cz>
      Tested-by: Nlining <lining2020x@163.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      b40813dd
  6. 28 10月, 2020 1 次提交
  7. 23 10月, 2020 1 次提交
  8. 21 10月, 2020 2 次提交
  9. 20 10月, 2020 1 次提交
  10. 19 10月, 2020 1 次提交
  11. 17 10月, 2020 2 次提交
  12. 15 10月, 2020 1 次提交
  13. 14 10月, 2020 3 次提交
  14. 12 10月, 2020 1 次提交
  15. 06 10月, 2020 1 次提交
  16. 03 10月, 2020 3 次提交
  17. 29 9月, 2020 1 次提交
    • N
      null_blk: add support for max open/active zone limit for zoned devices · dc4d137e
      Niklas Cassel 提交于
      Add support for user space to set a max open zone and a max active zone
      limit via configfs. By default, the default values are 0 == no limit.
      
      Call the block layer API functions used for exposing the configured
      limits to sysfs.
      
      Add accounting in null_blk_zoned so that these new limits are respected.
      Performing an operation that would exceed these limits results in a
      standard I/O error.
      
      A max open zone limit exists in the ZBC standard.
      While null_blk_zoned is used to test the Zoned Block Device model in
      Linux, when it comes to differences between ZBC and ZNS, null_blk_zoned
      mostly follows ZBC.
      
      Therefore, implement the manage open zone resources function from ZBC,
      but additionally add support for max active zones.
      This enables user space not only to test against a device with an open
      zone limit, but also to test against a device with an active zone limit.
      Signed-off-by: NNiklas Cassel <niklas.cassel@wdc.com>
      Reviewed-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Reviewed-by: NJohannes Thumshirn <johannes.thumshirn@wdc.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      dc4d137e