1. 08 4月, 2021 2 次提交
    • C
      md: factor out a mddev_find_locked helper from mddev_find · 8b57251f
      Christoph Hellwig 提交于
      Factor out a self-contained helper to just lookup a mddev by the dev_t
      "unit".
      
      Cc: stable@vger.kernel.org
      Reviewed-by: NHeming Zhao <heming.zhao@suse.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NSong Liu <song@kernel.org>
      8b57251f
    • Z
      md: md_open returns -EBUSY when entering racing area · 6a4db2a6
      Zhao Heming 提交于
      commit d3374825 ("md: make devices disappear when they are no longer
      needed.") introduced protection between mddev creating & removing. The
      md_open shouldn't create mddev when all_mddevs list doesn't contain
      mddev. With currently code logic, there will be very easy to trigger
      soft lockup in non-preempt env.
      
      This patch changes md_open returning from -ERESTARTSYS to -EBUSY, which
      will break the infinitely retry when md_open enter racing area.
      
      This patch is partly fix soft lockup issue, full fix needs mddev_find
      is split into two functions: mddev_find & mddev_find_or_alloc. And
      md_open should call new mddev_find (it only does searching job).
      
      For more detail, please refer with Christoph's "split mddev_find" patch
      in later commits.
      
      *** env ***
      kvm-qemu VM 2C1G with 2 iscsi luns
      kernel should be non-preempt
      
      *** script ***
      
      about trigger every time with below script
      
      ```
      1  node1="mdcluster1"
      2  node2="mdcluster2"
      3
      4  mdadm -Ss
      5  ssh ${node2} "mdadm -Ss"
      6  wipefs -a /dev/sda /dev/sdb
      7  mdadm -CR /dev/md0 -b clustered -e 1.2 -n 2 -l mirror /dev/sda \
         /dev/sdb --assume-clean
      8
      9  for i in {1..10}; do
      10    echo ==== $i ====;
      11
      12    echo "test  ...."
      13    ssh ${node2} "mdadm -A /dev/md0 /dev/sda /dev/sdb"
      14    sleep 1
      15
      16    echo "clean  ....."
      17    ssh ${node2} "mdadm -Ss"
      18 done
      ```
      
      I use mdcluster env to trigger soft lockup, but it isn't mdcluster
      speical bug. To stop md array in mdcluster env will do more jobs than
      non-cluster array, which will leave enough time/gap to allow kernel to
      run md_open.
      
      *** stack ***
      
      ```
      [  884.226509]  mddev_put+0x1c/0xe0 [md_mod]
      [  884.226515]  md_open+0x3c/0xe0 [md_mod]
      [  884.226518]  __blkdev_get+0x30d/0x710
      [  884.226520]  ? bd_acquire+0xd0/0xd0
      [  884.226522]  blkdev_get+0x14/0x30
      [  884.226524]  do_dentry_open+0x204/0x3a0
      [  884.226531]  path_openat+0x2fc/0x1520
      [  884.226534]  ? seq_printf+0x4e/0x70
      [  884.226536]  do_filp_open+0x9b/0x110
      [  884.226542]  ? md_release+0x20/0x20 [md_mod]
      [  884.226543]  ? seq_read+0x1d8/0x3e0
      [  884.226545]  ? kmem_cache_alloc+0x18a/0x270
      [  884.226547]  ? do_sys_open+0x1bd/0x260
      [  884.226548]  do_sys_open+0x1bd/0x260
      [  884.226551]  do_syscall_64+0x5b/0x1e0
      [  884.226554]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      ```
      
      *** rootcause ***
      
      "mdadm -A" (or other array assemble commands) will start a daemon "mdadm
      --monitor" by default. When "mdadm -Ss" is running, the stop action will
      wakeup "mdadm --monitor". The "--monitor" daemon will immediately get
      info from /proc/mdstat. This time mddev in kernel still exist, so
      /proc/mdstat still show md device, which makes "mdadm --monitor" to open
      /dev/md0.
      
      The previously "mdadm -Ss" is removing action, the "mdadm --monitor"
      open action will trigger md_open which is creating action. Racing is
      happening.
      
      ```
      <thread 1>: "mdadm -Ss"
      md_release
        mddev_put deletes mddev from all_mddevs
        queue_work for mddev_delayed_delete
        at this time, "/dev/md0" is still available for opening
      
      <thread 2>: "mdadm --monitor ..."
      md_open
       + mddev_find can't find mddev of /dev/md0, and create a new mddev and
       |    return.
       + trigger "if (mddev->gendisk != bdev->bd_disk)" and return
            -ERESTARTSYS.
      ```
      
      In non-preempt kernel, <thread 2> is occupying on current CPU. and
      mddev_delayed_delete which was created in <thread 1> also can't be
      schedule.
      
      In preempt kernel, it can also trigger above racing. But kernel doesn't
      allow one thread running on a CPU all the time. after <thread 2> running
      some time, the later "mdadm -A" (refer above script line 13) will call
      md_alloc to alloc a new gendisk for mddev. it will break md_open
      statement "if (mddev->gendisk != bdev->bd_disk)" and return 0 to caller,
      the soft lockup is broken.
      
      Cc: stable@vger.kernel.org
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NZhao Heming <heming.zhao@suse.com>
      Signed-off-by: NSong Liu <song@kernel.org>
      6a4db2a6
  2. 06 4月, 2021 15 次提交
    • L
      block: drbd: drbd_nl: Demote half-complete kernel-doc headers · a425711c
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       from drivers/block/drbd/drbd_nl.c:24:
       drivers/block/drbd/drbd_nl.c: In function ‘drbd_adm_attach’:
       drivers/block/drbd/drbd_nl.c:1968:10: warning: implicit conversion from ‘enum drbd_state_rv’ to ‘enum drbd_ret_code’ [-Wenum-conversion]
       drivers/block/drbd/drbd_nl.c:930: warning: Function parameter or member 'flags' not described in 'drbd_determine_dev_size'
       drivers/block/drbd/drbd_nl.c:930: warning: Function parameter or member 'rs' not described in 'drbd_determine_dev_size'
       drivers/block/drbd/drbd_nl.c:1148: warning: Function parameter or member 'dc' not described in 'drbd_check_al_size'
      
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Cc: Lars Ellenberg <lars.ellenberg@linbit.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: drbd-dev@lists.linbit.com
      Cc: linux-block@vger.kernel.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Link: https://lore.kernel.org/r/20210312105530.2219008-12-lee.jones@linaro.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
      a425711c
    • L
      block: xen-blkfront: Demote kernel-doc abuses · 5fdbd5bc
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       drivers/block/xen-blkfront.c:1960: warning: Function parameter or member 'dev' not described in 'blkfront_probe'
       drivers/block/xen-blkfront.c:1960: warning: Function parameter or member 'id' not described in 'blkfront_probe'
       drivers/block/xen-blkfront.c:1960: warning: expecting prototype for Allocate the basic(). Prototype was for blkfront_probe() instead
       drivers/block/xen-blkfront.c:2085: warning: Function parameter or member 'dev' not described in 'blkfront_resume'
       drivers/block/xen-blkfront.c:2085: warning: expecting prototype for or a backend(). Prototype was for blkfront_resume() instead
       drivers/block/xen-blkfront.c:2444: warning: wrong kernel-doc identifier on line:
      
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: "Roger Pau Monné" <roger.pau@citrix.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Stefano Stabellini <sstabellini@kernel.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: xen-devel@lists.xenproject.org
      Cc: linux-block@vger.kernel.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Acked-by: NRoger Pau Monné <roger.pau@citrix.com>
      Link: https://lore.kernel.org/r/20210312105530.2219008-11-lee.jones@linaro.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
      5fdbd5bc
    • L
      block: drbd: drbd_receiver: Demote less than half complete kernel-doc header · 6ec2a0f2
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       drivers/block/drbd/drbd_receiver.c:1641: warning: Function parameter or member 'op' not described in 'drbd_submit_peer_request'
       drivers/block/drbd/drbd_receiver.c:1641: warning: Function parameter or member 'op_flags' not described in 'drbd_submit_peer_request'
       drivers/block/drbd/drbd_receiver.c:1641: warning: Function parameter or member 'fault_type' not described in 'drbd_submit_peer_request'
      
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Cc: Lars Ellenberg <lars.ellenberg@linbit.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: drbd-dev@lists.linbit.com
      Cc: linux-block@vger.kernel.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Link: https://lore.kernel.org/r/20210312105530.2219008-10-lee.jones@linaro.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
      6ec2a0f2
    • L
      block: drbd: drbd_main: Fix a bunch of function documentation discrepancies · 584164c8
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       drivers/block/drbd/drbd_main.c:278: warning: Function parameter or member 'connection' not described in 'tl_clear'
       drivers/block/drbd/drbd_main.c:278: warning: Excess function parameter 'device' description in 'tl_clear'
       drivers/block/drbd/drbd_main.c:489: warning: Function parameter or member 'cpu_mask' not described in 'drbd_calc_cpu_mask'
       drivers/block/drbd/drbd_main.c:528: warning: Excess function parameter 'device' description in 'drbd_thread_current_set_cpu'
       drivers/block/drbd/drbd_main.c:549: warning: Function parameter or member 'connection' not described in 'drbd_header_size'
       drivers/block/drbd/drbd_main.c:1204: warning: Function parameter or member 'device' not described in 'send_bitmap_rle_or_plain'
       drivers/block/drbd/drbd_main.c:1204: warning: Function parameter or member 'c' not described in 'send_bitmap_rle_or_plain'
       drivers/block/drbd/drbd_main.c:1335: warning: Function parameter or member 'peer_device' not described in '_drbd_send_ack'
       drivers/block/drbd/drbd_main.c:1335: warning: Excess function parameter 'device' description in '_drbd_send_ack'
       drivers/block/drbd/drbd_main.c:1379: warning: Function parameter or member 'peer_device' not described in 'drbd_send_ack'
       drivers/block/drbd/drbd_main.c:1379: warning: Excess function parameter 'device' description in 'drbd_send_ack'
       drivers/block/drbd/drbd_main.c:1892: warning: Function parameter or member 'connection' not described in 'drbd_send_all'
       drivers/block/drbd/drbd_main.c:1892: warning: Function parameter or member 'sock' not described in 'drbd_send_all'
       drivers/block/drbd/drbd_main.c:1892: warning: Function parameter or member 'buffer' not described in 'drbd_send_all'
       drivers/block/drbd/drbd_main.c:1892: warning: Function parameter or member 'size' not described in 'drbd_send_all'
       drivers/block/drbd/drbd_main.c:1892: warning: Function parameter or member 'msg_flags' not described in 'drbd_send_all'
       drivers/block/drbd/drbd_main.c:3525: warning: Function parameter or member 'flags' not described in 'drbd_queue_bitmap_io'
       drivers/block/drbd/drbd_main.c:3563: warning: Function parameter or member 'flags' not described in 'drbd_bitmap_io'
      
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Cc: Lars Ellenberg <lars.ellenberg@linbit.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: drbd-dev@lists.linbit.com
      Cc: linux-block@vger.kernel.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Link: https://lore.kernel.org/r/20210312105530.2219008-9-lee.jones@linaro.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
      584164c8
    • L
      block: drbd: drbd_nl: Make conversion to 'enum drbd_ret_code' explicit · 1f1e87b4
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       from drivers/block/drbd/drbd_nl.c:24:
       drivers/block/drbd/drbd_nl.c: In function ‘drbd_adm_set_role’:
       drivers/block/drbd/drbd_nl.c:793:11: warning: implicit conversion from ‘enum drbd_state_rv’ to ‘enum drbd_ret_code’ [-Wenum-conversion]
       drivers/block/drbd/drbd_nl.c:795:11: warning: implicit conversion from ‘enum drbd_state_rv’ to ‘enum drbd_ret_code’ [-Wenum-conversion]
       drivers/block/drbd/drbd_nl.c: In function ‘drbd_adm_attach’:
       drivers/block/drbd/drbd_nl.c:1965:10: warning: implicit conversion from ‘enum drbd_state_rv’ to ‘enum drbd_ret_code’ [-Wenum-conversion]
       drivers/block/drbd/drbd_nl.c: In function ‘drbd_adm_connect’:
       drivers/block/drbd/drbd_nl.c:2690:10: warning: implicit conversion from ‘enum drbd_state_rv’ to ‘enum drbd_ret_code’ [-Wenum-conversion]
       drivers/block/drbd/drbd_nl.c: In function ‘drbd_adm_disconnect’:
       drivers/block/drbd/drbd_nl.c:2803:11: warning: implicit conversion from ‘enum drbd_state_rv’ to ‘enum drbd_ret_code’ [-Wenum-conversion]
      
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Cc: Lars Ellenberg <lars.ellenberg@linbit.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: drbd-dev@lists.linbit.com
      Cc: linux-block@vger.kernel.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Link: https://lore.kernel.org/r/20210312105530.2219008-8-lee.jones@linaro.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
      1f1e87b4
    • L
      block: drbd: drbd_main: Remove duplicate field initialisation · f58a0d18
      Lee Jones 提交于
      [P_RETRY_WRITE] is initialised more than once.
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/block/drbd/drbd_main.c: In function ‘cmdname’:
       drivers/block/drbd/drbd_main.c:3660:22: warning: initialized field overwritten [-Woverride-init]
       drivers/block/drbd/drbd_main.c:3660:22: note: (near initialization for ‘cmdnames[44]’)
      
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Cc: Lars Ellenberg <lars.ellenberg@linbit.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: drbd-dev@lists.linbit.com
      Cc: linux-block@vger.kernel.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Link: https://lore.kernel.org/r/20210312105530.2219008-7-lee.jones@linaro.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
      f58a0d18
    • L
      block: drbd: drbd_receiver: Demote non-conformant kernel-doc headers · 9b48ff07
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       drivers/block/drbd/drbd_receiver.c:265: warning: Function parameter or member 'peer_device' not described in 'drbd_alloc_pages'
       drivers/block/drbd/drbd_receiver.c:265: warning: Excess function parameter 'device' description in 'drbd_alloc_pages'
       drivers/block/drbd/drbd_receiver.c:1362: warning: Function parameter or member 'connection' not described in 'drbd_may_finish_epoch'
       drivers/block/drbd/drbd_receiver.c:1362: warning: Excess function parameter 'device' description in 'drbd_may_finish_epoch'
       drivers/block/drbd/drbd_receiver.c:1451: warning: Function parameter or member 'resource' not described in 'drbd_bump_write_ordering'
       drivers/block/drbd/drbd_receiver.c:1451: warning: Function parameter or member 'bdev' not described in 'drbd_bump_write_ordering'
       drivers/block/drbd/drbd_receiver.c:1451: warning: Excess function parameter 'connection' description in 'drbd_bump_write_ordering'
       drivers/block/drbd/drbd_receiver.c:1643: warning: Function parameter or member 'op' not described in 'drbd_submit_peer_request'
       drivers/block/drbd/drbd_receiver.c:1643: warning: Function parameter or member 'op_flags' not described in 'drbd_submit_peer_request'
       drivers/block/drbd/drbd_receiver.c:1643: warning: Function parameter or member 'fault_type' not described in 'drbd_submit_peer_request'
       drivers/block/drbd/drbd_receiver.c:1643: warning: Excess function parameter 'rw' description in 'drbd_submit_peer_request'
       drivers/block/drbd/drbd_receiver.c:3055: warning: Function parameter or member 'peer_device' not described in 'drbd_asb_recover_0p'
       drivers/block/drbd/drbd_receiver.c:3138: warning: Function parameter or member 'peer_device' not described in 'drbd_asb_recover_1p'
       drivers/block/drbd/drbd_receiver.c:3195: warning: Function parameter or member 'peer_device' not described in 'drbd_asb_recover_2p'
       drivers/block/drbd/drbd_receiver.c:4684: warning: Function parameter or member 'peer_device' not described in 'receive_bitmap_plain'
       drivers/block/drbd/drbd_receiver.c:4684: warning: Function parameter or member 'size' not described in 'receive_bitmap_plain'
       drivers/block/drbd/drbd_receiver.c:4684: warning: Function parameter or member 'p' not described in 'receive_bitmap_plain'
       drivers/block/drbd/drbd_receiver.c:4684: warning: Function parameter or member 'c' not described in 'receive_bitmap_plain'
       drivers/block/drbd/drbd_receiver.c:4738: warning: Function parameter or member 'peer_device' not described in 'recv_bm_rle_bits'
       drivers/block/drbd/drbd_receiver.c:4738: warning: Function parameter or member 'p' not described in 'recv_bm_rle_bits'
       drivers/block/drbd/drbd_receiver.c:4738: warning: Function parameter or member 'c' not described in 'recv_bm_rle_bits'
       drivers/block/drbd/drbd_receiver.c:4738: warning: Function parameter or member 'len' not described in 'recv_bm_rle_bits'
       drivers/block/drbd/drbd_receiver.c:4807: warning: Function parameter or member 'peer_device' not described in 'decode_bitmap_c'
       drivers/block/drbd/drbd_receiver.c:4807: warning: Function parameter or member 'p' not described in 'decode_bitmap_c'
       drivers/block/drbd/drbd_receiver.c:4807: warning: Function parameter or member 'c' not described in 'decode_bitmap_c'
       drivers/block/drbd/drbd_receiver.c:4807: warning: Function parameter or member 'len' not described in 'decode_bitmap_c'
      
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Cc: Lars Ellenberg <lars.ellenberg@linbit.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: drbd-dev@lists.linbit.com
      Cc: linux-block@vger.kernel.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Link: https://lore.kernel.org/r/20210312105530.2219008-6-lee.jones@linaro.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
      9b48ff07
    • L
      block: drbd: drbd_state: Fix some function documentation issues · 49ece311
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       drivers/block/drbd/drbd_state.c:913: warning: Function parameter or member 'connection' not described in 'is_valid_soft_transition'
       drivers/block/drbd/drbd_state.c:913: warning: Excess function parameter 'device' description in 'is_valid_soft_transition'
       drivers/block/drbd/drbd_state.c:1054: warning: Function parameter or member 'warn' not described in 'sanitize_state'
       drivers/block/drbd/drbd_state.c:1054: warning: Excess function parameter 'warn_sync_abort' description in 'sanitize_state'
       drivers/block/drbd/drbd_state.c:1703: warning: Function parameter or member 'state_change' not described in 'after_state_ch'
      
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Cc: Lars Ellenberg <lars.ellenberg@linbit.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: drbd-dev@lists.linbit.com
      Cc: linux-block@vger.kernel.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Link: https://lore.kernel.org/r/20210312105530.2219008-5-lee.jones@linaro.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
      49ece311
    • L
      block: mtip32xx: mtip32xx: Mark debugging variable 'start' as __maybe_unused · d0e0cb97
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       drivers/block/mtip32xx/mtip32xx.c: In function ‘mtip_standby_immediate’:
       drivers/block/mtip32xx/mtip32xx.c:1216:16: warning: variable ‘start’ set but not used [-Wunused-but-set-variable]
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: linux-block@vger.kernel.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Link: https://lore.kernel.org/r/20210312105530.2219008-4-lee.jones@linaro.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
      d0e0cb97
    • L
      block: drbd: drbd_interval: Demote some kernel-doc abuses and fix another header · b8b87103
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       drivers/block/drbd/drbd_interval.c:11: warning: Function parameter or member 'node' not described in 'interval_end'
       drivers/block/drbd/drbd_interval.c:26: warning: Function parameter or member 'root' not described in 'drbd_insert_interval'
       drivers/block/drbd/drbd_interval.c:26: warning: Function parameter or member 'this' not described in 'drbd_insert_interval'
       drivers/block/drbd/drbd_interval.c:70: warning: Function parameter or member 'root' not described in 'drbd_contains_interval'
       drivers/block/drbd/drbd_interval.c:96: warning: Function parameter or member 'root' not described in 'drbd_remove_interval'
       drivers/block/drbd/drbd_interval.c:96: warning: Function parameter or member 'this' not described in 'drbd_remove_interval'
       drivers/block/drbd/drbd_interval.c:113: warning: Function parameter or member 'root' not described in 'drbd_find_overlap'
      
      Cc: Philipp Reisner <philipp.reisner@linbit.com>
      Cc: Lars Ellenberg <lars.ellenberg@linbit.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: drbd-dev@lists.linbit.com
      Cc: linux-block@vger.kernel.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Link: https://lore.kernel.org/r/20210312105530.2219008-3-lee.jones@linaro.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
      b8b87103
    • J
      Merge tag 'nvme-5.13-2021-04-06' of git://git.infradead.org/nvme into for-5.13/drivers · 762d6bd2
      Jens Axboe 提交于
      Pull NVMe updates from Christoph:
      
      "nvme updates for Linux 5.13
      
       - fix handling of very large MDTS values (Bart Van Assche)
       - retrigger ANA log update if group descriptor isn't found
         (Hannes Reinecke)
       - fix locking contexts in nvme-tcp and nvmet-tcp (Sagi Grimberg)
       - return proper error code from discovery ctrl (Hou Pu)
       - verify the SGLS field in nvmet-tcp and nvmet-fc (Max Gurtovoy)
       - disallow passthru cmd from targeting a nsid != nsid of the block dev
         (Niklas Cassel)
       - do not allow model_number exceed 40 bytes in nvmet (Noam Gottlieb)
       - enable optional queue idle period tracking in nvmet-tcp
         (Mark Wunderlich)
       - various cleanups and optimizations (Chaitanya Kulkarni, Kanchan Joshi)
       - expose fast_io_fail_tmo in sysfs (Daniel Wagner)
       - implement non-MDTS command limits (Keith Busch)
       - reduce warnings for unhandled command effects (Keith Busch)
       - allocate storage for the SQE as part of the nvme_request (Keith Busch)"
      
      * tag 'nvme-5.13-2021-04-06' of git://git.infradead.org/nvme: (33 commits)
        nvme: fix handling of large MDTS values
        nvme: implement non-mdts command limits
        nvme: disallow passthru cmd from targeting a nsid != nsid of the block dev
        nvme: retrigger ANA log update if group descriptor isn't found
        nvme: export fast_io_fail_tmo to sysfs
        nvme: remove superfluous else in nvme_ctrl_loss_tmo_store
        nvme: use sysfs_emit instead of sprintf
        nvme-fc: check sgl supported by target
        nvme-tcp: check sgl supported by target
        nvmet-tcp: enable optional queue idle period tracking
        nvmet-tcp: fix incorrect locking in state_change sk callback
        nvme-tcp: block BH in sk state_change sk callback
        nvmet: return proper error code from discovery ctrl
        nvme: warn of unhandled effects only once
        nvme: use driver pdu command for passthrough
        nvme-pci: allocate nvme_command within driver pdu
        nvmet: do not allow model_number exceed 40 bytes
        nvmet: remove unnecessary ctrl parameter
        nvmet-fc: update function documentation
        nvme-fc: fix the function documentation comment
        ...
      762d6bd2
    • B
      nvme: fix handling of large MDTS values · 8609c63f
      Bart Van Assche 提交于
      Instead of triggering an integer overflow and undefined behavior if MDTS is
      large, set max_hw_sectors to UINT_MAX.
      Signed-off-by: NBart Van Assche <bvanassche@acm.org>
      Reviewed-by: NKeith Busch <kbusch@kernel.org>
      [hch: rebased to account for the new nvme_mps_to_sectors helper]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      8609c63f
    • K
      nvme: implement non-mdts command limits · 5befc7c2
      Keith Busch 提交于
      Commands that access LBA contents without a data transfer between the
      host historically have not had a spec defined upper limit. The driver
      set the queue constraints for such commands to the max data transfer
      size just to be safe, but this artificial constraint frequently limits
      devices below their capabilities.
      
      The NVMe Workgroup ratified TP4040 defines how a controller may
      advertise their non-MDTS limits. Use these if provided and default to
      the current constraints if not. Since the Dataset Management command
      limits are defined in logical blocks, but without a namespace to tell us
      the logical block size, the code defaults to the safe 512b size.
      Signed-off-by: NKeith Busch <kbusch@kernel.org>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      5befc7c2
    • N
      nvme: disallow passthru cmd from targeting a nsid != nsid of the block dev · c881a23f
      Niklas Cassel 提交于
      When a passthru command targets a specific namespace, the ns parameter to
      nvme_user_cmd()/nvme_user_cmd64() is set. However, there is currently no
      validation that the nsid specified in the passthru command targets the
      namespace/nsid represented by the block device that the ioctl was
      performed on.
      
      Add a check that validates that the nsid in the passthru command matches
      that of the supplied namespace.
      Signed-off-by: NNiklas Cassel <niklas.cassel@wdc.com>
      Reviewed-by: NJavier González <javier@javigon.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Reviewed-by: NKanchan Joshi <joshi.k@samsung.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      c881a23f
    • H
      nvme: retrigger ANA log update if group descriptor isn't found · dd8f7fa9
      Hannes Reinecke 提交于
      If ANA is enabled but no ANA group descriptor is found when creating
      a new namespace the ANA log is most likely out of date, so trigger
      a re-read. The namespace will be tagged with the NS_ANA_PENDING flag
      to exclude it from path selection until the ANA log has been re-read.
      
      Fixes: 32acab31 ("nvme: implement multipath access to nvme subsystems")
      Reported-by: NMartin George <marting@netapp.com>
      Signed-off-by: NHannes Reinecke <hare@suse.de>
      Reviewed-by: NKeith Busch <kbusch@kernel.org>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      dd8f7fa9
  3. 03 4月, 2021 23 次提交