1. 03 4月, 2021 1 次提交
  2. 02 3月, 2021 1 次提交
  3. 22 2月, 2021 1 次提交
  4. 12 2月, 2021 1 次提交
  5. 10 2月, 2021 1 次提交
    • D
      block: introduce zone_write_granularity limit · a805a4fa
      Damien Le Moal 提交于
      Per ZBC and ZAC specifications, host-managed SMR hard-disks mandate that
      all writes into sequential write required zones be aligned to the device
      physical block size. However, NVMe ZNS does not have this constraint and
      allows write operations into sequential zones to be aligned to the
      device logical block size. This inconsistency does not help with
      software portability across device types.
      
      To solve this, introduce the zone_write_granularity queue limit to
      indicate the alignment constraint, in bytes, of write operations into
      zones of a zoned block device. This new limit is exported as a
      read-only sysfs queue attribute and the helper
      blk_queue_zone_write_granularity() introduced for drivers to set this
      limit.
      
      The function blk_queue_set_zoned() is modified to set this new limit to
      the device logical block size by default. NVMe ZNS devices as well as
      zoned nullb devices use this default value as is. The scsi disk driver
      is modified to execute the blk_queue_zone_write_granularity() helper to
      set the zone write granularity of host-managed SMR disks to the disk
      physical block size.
      
      The accessor functions queue_zone_write_granularity() and
      bdev_zone_write_granularity() are also introduced.
      Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Reviewed-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      Reviewed-by: NJohannes Thumshirn <johannes.thumshirn@edc.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      a805a4fa
  6. 28 1月, 2021 1 次提交
  7. 27 1月, 2021 1 次提交
  8. 25 1月, 2021 4 次提交
  9. 10 12月, 2020 2 次提交
  10. 05 12月, 2020 2 次提交
    • M
      block: fix incorrect branching in blk_max_size_offset() · 65f33b35
      Mike Snitzer 提交于
      If non-zero 'chunk_sectors' is passed in to blk_max_size_offset() that
      override will be incorrectly ignored.
      
      Old blk_max_size_offset() branching, prior to commit 3ee16db3,
      must be used only if passed 'chunk_sectors' override is zero.
      
      Fixes: 3ee16db3 ("dm: fix IO splitting")
      Cc: stable@vger.kernel.org # 5.9
      Reported-by: NJohn Dorminy <jdorminy@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      65f33b35
    • M
      dm: fix IO splitting · 3ee16db3
      Mike Snitzer 提交于
      Commit 882ec4e6 ("dm table: stack 'chunk_sectors' limit to account
      for target-specific splitting") caused a couple regressions:
      1) Using lcm_not_zero() when stacking chunk_sectors was a bug because
         chunk_sectors must reflect the most limited of all devices in the
         IO stack.
      2) DM targets that set max_io_len but that do _not_ provide an
         .iterate_devices method no longer had there IO split properly.
      
      And commit 5091cdec ("dm: change max_io_len() to use
      blk_max_size_offset()") also caused a regression where DM no longer
      supported varied (per target) IO splitting. The implication being the
      potential for severely reduced performance for IO stacks that use a DM
      target like dm-cache to hide performance limitations of a slower
      device (e.g. one that requires 4K IO splitting).
      
      Coming full circle: Fix all these issues by discontinuing stacking
      chunk_sectors up using ti->max_io_len in dm_calculate_queue_limits(),
      add optional chunk_sectors override argument to blk_max_size_offset()
      and update DM's max_io_len() to pass ti->max_io_len to its
      blk_max_size_offset() call.
      
      Passing in an optional chunk_sectors override to blk_max_size_offset()
      allows for code reuse of block's centralized calculation for max IO
      size based on provided offset and split boundary.
      
      Fixes: 882ec4e6 ("dm table: stack 'chunk_sectors' limit to account for target-specific splitting")
      Fixes: 5091cdec ("dm: change max_io_len() to use blk_max_size_offset()")
      Cc: stable@vger.kernel.org
      Reported-by: NJohn Dorminy <jdorminy@redhat.com>
      Reported-by: NBruce Johnston <bjohnsto@redhat.com>
      Reported-by: NKirill Tkhai <ktkhai@virtuozzo.com>
      Reviewed-by: NJohn Dorminy <jdorminy@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Reviewed-by: NJens Axboe <axboe@kernel.dk>
      3ee16db3
  11. 02 12月, 2020 7 次提交
  12. 16 11月, 2020 2 次提交
  13. 17 10月, 2020 1 次提交
  14. 07 10月, 2020 2 次提交
  15. 06 10月, 2020 4 次提交
  16. 25 9月, 2020 4 次提交
  17. 24 9月, 2020 2 次提交
  18. 16 9月, 2020 1 次提交
  19. 12 9月, 2020 1 次提交
  20. 08 9月, 2020 1 次提交
    • J
      block: Do not discard buffers under a mounted filesystem · 384d87ef
      Jan Kara 提交于
      Discarding blocks and buffers under a mounted filesystem is hardly
      anything admin wants to do. Usually it will confuse the filesystem and
      sometimes the loss of buffer_head state (including b_private field) can
      even cause crashes like:
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
      PGD 0 P4D 0
      Oops: 0002 [#1] SMP PTI
      CPU: 4 PID: 203778 Comm: jbd2/dm-3-8 Kdump: loaded Tainted: G O     --------- -  - 4.18.0-147.5.0.5.h126.eulerosv2r9.x86_64 #1
      Hardware name: Huawei RH2288H V3/BC11HGSA0, BIOS 1.57 08/11/2015
      RIP: 0010:jbd2_journal_grab_journal_head+0x1b/0x40 [jbd2]
      ...
      Call Trace:
       __jbd2_journal_insert_checkpoint+0x23/0x70 [jbd2]
       jbd2_journal_commit_transaction+0x155f/0x1b60 [jbd2]
       kjournald2+0xbd/0x270 [jbd2]
      
      So if we don't have block device open with O_EXCL already, claim the
      block device while we truncate buffer cache. This makes sure any
      exclusive block device user (such as filesystem) cannot operate on the
      device while we are discarding buffer cache.
      Reported-by: NYe Bin <yebin10@huawei.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      [axboe: fix !CONFIG_BLOCK error in truncate_bdev_range()]
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      384d87ef