Merge tag 'block-6.2-2022-12-29' of git://git.kernel.dk/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 30 Dec 2022 00:57:29 +0000 (16:57 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 30 Dec 2022 00:57:29 +0000 (16:57 -0800)
Pull block fixes from Jens Axboe:
 "Mostly just NVMe, but also a single fixup for BFQ for a regression
  that happened during the merge window. In detail:

   - NVMe pull requests via Christoph:
      - Fix doorbell buffer value endianness (Klaus Jensen)
      - Fix Linux vs NVMe page size mismatch (Keith Busch)
      - Fix a potential use memory access beyong the allocation limit
        (Keith Busch)
      - Fix a multipath vs blktrace NULL pointer dereference (Yanjun
        Zhang)
      - Fix various problems in handling the Command Supported and
        Effects log (Christoph Hellwig)
      - Don't allow unprivileged passthrough of commands that don't
        transfer data but modify logical block content (Christoph
        Hellwig)
      - Add a features and quirks policy document (Christoph Hellwig)
      - Fix some really nasty code that was correct but made smatch
        complain (Sagi Grimberg)

   - Use-after-free regression in BFQ from this merge window (Yu)"

* tag 'block-6.2-2022-12-29' of git://git.kernel.dk/linux:
  nvme-auth: fix smatch warning complaints
  nvme: consult the CSE log page for unprivileged passthrough
  nvme: also return I/O command effects from nvme_command_effects
  nvmet: don't defer passthrough commands with trivial effects to the workqueue
  nvmet: set the LBCC bit for commands that modify data
  nvmet: use NVME_CMD_EFFECTS_CSUPP instead of open coding it
  nvme: fix the NVME_CMD_EFFECTS_CSE_MASK definition
  docs, nvme: add a feature and quirk policy document
  nvme-pci: update sqsize when adjusting the queue depth
  nvme: fix setting the queue depth in nvme_alloc_io_tag_set
  block, bfq: fix uaf for bfqq in bfq_exit_icq_bfqq
  nvme: fix multipath crash caused by flush request when blktrace is enabled
  nvme-pci: fix page size checks
  nvme-pci: fix mempool alloc size
  nvme-pci: fix doorbell buffer value endianness

1  2 
MAINTAINERS
drivers/nvme/host/core.c

diff --combined MAINTAINERS
index 7ba3be035565c97ff4c473386d9c3ca9181867af,d53b3a6cdc67d278d051f5e4045bb0c831bcbb97..7f86d02cb427ab3b70937af638f8bc5c2f4d232f
@@@ -312,13 -312,6 +312,13 @@@ L:       linux-iio@vger.kernel.or
  S:    Maintained
  F:    drivers/counter/104-quad-8.c
  
 +ACCES IDIO-16 GPIO LIBRARY
 +M:    William Breathitt Gray <william.gray@linaro.org>
 +L:    linux-gpio@vger.kernel.org
 +S:    Maintained
 +F:    drivers/gpio/gpio-idio-16.c
 +F:    drivers/gpio/gpio-idio-16.h
 +
  ACCES PCI-IDIO-16 GPIO DRIVER
  M:    William Breathitt Gray <william.gray@linaro.org>
  L:    linux-gpio@vger.kernel.org
@@@ -1152,15 -1145,6 +1152,15 @@@ T:    git git://git.kernel.org/pub/scm/lin
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
  F:    drivers/net/amt.c
  
 +ANALOG DEVICES INC AD4130 DRIVER
 +M:    Cosmin Tanislav <cosmin.tanislav@analog.com>
 +L:    linux-iio@vger.kernel.org
 +S:    Supported
 +W:    http://ez.analog.com/community/linux-device-drivers
 +F:    Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130
 +F:    Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml
 +F:    drivers/iio/adc/ad4130.c
 +
  ANALOG DEVICES INC AD7192 DRIVER
  M:    Alexandru Tachici <alexandru.tachici@analog.com>
  L:    linux-iio@vger.kernel.org
@@@ -1210,14 -1194,6 +1210,14 @@@ W:    https://ez.analog.com/linux-software
  F:    Documentation/devicetree/bindings/iio/adc/adi,ad7780.yaml
  F:    drivers/iio/adc/ad7780.c
  
 +ANALOG DEVICES INC AD74115 DRIVER
 +M:    Cosmin Tanislav <cosmin.tanislav@analog.com>
 +L:    linux-iio@vger.kernel.org
 +S:    Supported
 +W:    http://ez.analog.com/community/linux-device-drivers
 +F:    Documentation/devicetree/bindings/iio/addac/adi,ad74115.yaml
 +F:    drivers/iio/addac/ad74115.c
 +
  ANALOG DEVICES INC AD74413R DRIVER
  M:    Cosmin Tanislav <cosmin.tanislav@analog.com>
  L:    linux-iio@vger.kernel.org
@@@ -1241,14 -1217,6 +1241,14 @@@ W:    https://ez.analog.com/linux-software
  F:    Documentation/devicetree/bindings/iio/amplifiers/adi,ada4250.yaml
  F:    drivers/iio/amplifiers/ada4250.c
  
 +ANALOG DEVICES INC ADF4377 DRIVER
 +M:    Antoniu Miclaus <antoniu.miclaus@analog.com>
 +L:    linux-iio@vger.kernel.org
 +S:    Supported
 +W:    https://ez.analog.com/linux-software-drivers
 +F:    Documentation/devicetree/bindings/iio/frequency/adi,adf4377.yaml
 +F:    drivers/iio/frequency/adf4377.c
 +
  ANALOG DEVICES INC ADGS1408 DRIVER
  M:    Mircea Caprioru <mircea.caprioru@analog.com>
  S:    Supported
@@@ -2330,7 -2298,6 +2330,7 @@@ F:      Documentation/devicetree/bindings/bu
  F:    Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.txt
  F:    Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml
  F:    Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml
 +F:    arch/arm/boot/dts/intel-ixp*
  F:    arch/arm/mach-ixp4xx/
  F:    drivers/bus/intel-ixp4xx-eb.c
  F:    drivers/clocksource/timer-ixp4xx.c
@@@ -7922,7 -7889,6 +7922,7 @@@ M:      Chao Yu <chao@kernel.org
  L:    linux-f2fs-devel@lists.sourceforge.net
  S:    Maintained
  W:    https://f2fs.wiki.kernel.org/
 +B:    https://bugzilla.kernel.org/enter_bug.cgi?product=File%20System&component=f2fs
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git
  F:    Documentation/ABI/testing/sysfs-fs-f2fs
  F:    Documentation/filesystems/f2fs.rst
@@@ -7961,12 -7927,6 +7961,12 @@@ F:    fs/notify/fanotify
  F:    include/linux/fanotify.h
  F:    include/uapi/linux/fanotify.h
  
 +FARADAY FOTG210 USB2 DUAL-ROLE CONTROLLER
 +M:    Linus Walleij <linus.walleij@linaro.org>
 +L:    linux-usb@vger.kernel.org
 +S:    Maintained
 +F:    drivers/usb/fotg210/
 +
  FARSYNC SYNCHRONOUS DRIVER
  M:    Kevin Curtis <kevin.curtis@farsite.co.uk>
  S:    Supported
@@@ -8145,8 -8105,6 +8145,8 @@@ S:      Supporte
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
  F:    include/linux/fortify-string.h
  F:    lib/fortify_kunit.c
 +F:    lib/memcpy_kunit.c
 +F:    lib/strscpy_kunit.c
  F:    lib/test_fortify/*
  F:    scripts/test_fortify.sh
  K:    \b__NO_FORTIFY\b
@@@ -8560,9 -8518,6 +8560,9 @@@ FUNCTION HOOKS (FTRACE
  M:    Steven Rostedt <rostedt@goodmis.org>
  M:    Masami Hiramatsu <mhiramat@kernel.org>
  R:    Mark Rutland <mark.rutland@arm.com>
 +L:    linux-kernel@vger.kernel.org
 +L:    linux-trace-kernel@vger.kernel.org
 +Q:    https://patchwork.kernel.org/project/linux-trace-kernel/list/
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
  F:    Documentation/trace/ftrace*
@@@ -9308,7 -9263,6 +9308,7 @@@ HISILICON GPIO DRIVE
  M:    Jay Fang <f.fangjian@huawei.com>
  L:    linux-gpio@vger.kernel.org
  S:    Maintained
 +F:    Documentation/devicetree/bindings/gpio/hisilicon,ascend910-gpio.yaml
  F:    drivers/gpio/gpio-hisi.c
  
  HISILICON HIGH PERFORMANCE RSA ENGINE DRIVER (HPRE)
@@@ -9325,7 -9279,6 +9325,7 @@@ M:      Yicong Yang <yangyicong@hisilicon.co
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
  W:    https://www.hisilicon.com
 +F:    Documentation/devicetree/bindings/i2c/hisilicon,ascend910-i2c.yaml
  F:    drivers/i2c/busses/i2c-hisi.c
  
  HISILICON LPC BUS DRIVER
@@@ -9409,7 -9362,7 +9409,7 @@@ F:      Documentation/devicetree/bindings/in
  F:    drivers/infiniband/hw/hns/
  
  HISILICON SAS Controller
 -M:    John Garry <john.garry@huawei.com>
 +M:    Xiang Chen <chenxiang66@hisilicon.com>
  S:    Supported
  W:    http://www.hisilicon.com
  F:    Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
@@@ -9817,7 -9770,8 +9817,7 @@@ F:      Documentation/devicetree/bindings/i3
  F:    drivers/i3c/master/i3c-master-cdns.c
  
  I3C DRIVER FOR SYNOPSYS DESIGNWARE
 -M:    Vitor Soares <vitor.soares@synopsys.com>
 -S:    Maintained
 +S:    Orphan
  F:    Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.yaml
  F:    drivers/i3c/master/dw*
  
@@@ -10461,6 -10415,11 +10461,6 @@@ T:  git git://git.kernel.org/pub/scm/lin
  F:    drivers/iommu/intel/
  F:    include/linux/intel-svm.h
  
 -INTEL IOP-ADMA DMA DRIVER
 -R:    Dan Williams <dan.j.williams@intel.com>
 -S:    Odd fixes
 -F:    drivers/dma/iop-adma.c
 -
  INTEL IPU3 CSI-2 CIO2 DRIVER
  M:    Yong Zhi <yong.zhi@intel.com>
  M:    Sakari Ailus <sakari.ailus@linux.intel.com>
@@@ -10834,18 -10793,6 +10834,18 @@@ F: drivers/iommu/dma-iommu.
  F:    drivers/iommu/iova.c
  F:    include/linux/iova.h
  
 +IOMMUFD
 +M:    Jason Gunthorpe <jgg@nvidia.com>
 +M:    Kevin Tian <kevin.tian@intel.com>
 +L:    iommu@lists.linux.dev
 +S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd.git
 +F:    Documentation/userspace-api/iommufd.rst
 +F:    drivers/iommu/iommufd/
 +F:    include/linux/iommufd.h
 +F:    include/uapi/linux/iommufd.h
 +F:    tools/testing/selftests/iommu/
 +
  IOMMU SUBSYSTEM
  M:    Joerg Roedel <joro@8bytes.org>
  M:    Will Deacon <will@kernel.org>
@@@ -10878,7 -10825,6 +10878,7 @@@ T:   git git://git.kernel.dk/liburin
  F:    io_uring/
  F:    include/linux/io_uring.h
  F:    include/linux/io_uring_types.h
 +F:    include/trace/events/io_uring.h
  F:    include/uapi/linux/io_uring.h
  F:    tools/io_uring/
  
@@@ -11251,8 -11197,6 +11251,8 @@@ M:   Kees Cook <keescook@chromium.org
  L:    linux-hardening@vger.kernel.org
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
 +F:    Documentation/ABI/testing/sysfs-kernel-oops_count
 +F:    Documentation/ABI/testing/sysfs-kernel-warn_count
  F:    include/linux/overflow.h
  F:    include/linux/randomize_kstack.h
  F:    mm/usercopy.c
@@@ -11468,17 -11412,7 +11468,17 @@@ F: arch/x86/kvm/hyperv.
  F:    arch/x86/kvm/kvm_onhyperv.*
  F:    arch/x86/kvm/svm/hyperv.*
  F:    arch/x86/kvm/svm/svm_onhyperv.*
 -F:    arch/x86/kvm/vmx/evmcs.*
 +F:    arch/x86/kvm/vmx/hyperv.*
 +
 +KVM X86 Xen (KVM/Xen)
 +M:    David Woodhouse <dwmw2@infradead.org>
 +M:    Paul Durrant <paul@xen.org>
 +M:    Sean Christopherson <seanjc@google.com>
 +M:    Paolo Bonzini <pbonzini@redhat.com>
 +L:    kvm@vger.kernel.org
 +S:    Supported
 +T:    git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
 +F:    arch/x86/kvm/xen.*
  
  KERNFS
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@@@ -11600,12 -11534,6 +11600,12 @@@ F: drivers/mfd/khadas-mcu.
  F:    include/linux/mfd/khadas-mcu.h
  F:    drivers/thermal/khadas_mcu_fan.c
  
 +KIONIX/ROHM KX022A ACCELEROMETER
 +M:    Matti Vaittinen <mazziesaccount@gmail.com>
 +L:    linux-iio@vger.kernel.org
 +S:    Supported
 +F:    drivers/iio/accel/kionix-kx022a*
 +
  KMEMLEAK
  M:    Catalin Marinas <catalin.marinas@arm.com>
  S:    Maintained
@@@ -11643,9 -11571,6 +11643,9 @@@ M:   Naveen N. Rao <naveen.n.rao@linux.ib
  M:    Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
  M:    "David S. Miller" <davem@davemloft.net>
  M:    Masami Hiramatsu <mhiramat@kernel.org>
 +L:    linux-kernel@vger.kernel.org
 +L:    linux-trace-kernel@vger.kernel.org
 +Q:    https://patchwork.kernel.org/project/linux-trace-kernel/list/
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
  F:    Documentation/trace/kprobes.rst
@@@ -11729,13 -11654,11 +11729,13 @@@ F:        scripts/leaking_addresses.p
  
  LED SUBSYSTEM
  M:    Pavel Machek <pavel@ucw.cz>
 +M:    Lee Jones <lee@kernel.org>
  L:    linux-leds@vger.kernel.org
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git
  F:    Documentation/devicetree/bindings/leds/
  F:    drivers/leds/
 +F:    include/dt-bindings/leds/
  F:    include/linux/leds.h
  
  LEGACY EEPROM DRIVER
@@@ -12687,12 -12610,6 +12687,12 @@@ S: Maintaine
  F:    Documentation/devicetree/bindings/regulator/maxim,max20086.yaml
  F:    drivers/regulator/max20086-regulator.c
  
 +MAXIM MAX30208 TEMPERATURE SENSOR DRIVER
 +M:    Rajat Khandelwal <rajat.khandelwal@linux.intel.com>
 +L:    linux-iio@vger.kernel.org
 +S:    Maintained
 +F:    drivers/iio/temperature/max30208.c
 +
  MAXIM MAX77650 PMIC MFD DRIVER
  M:    Bartosz Golaszewski <brgl@bgdev.pl>
  L:    linux-kernel@vger.kernel.org
@@@ -13602,6 -13519,7 +13602,6 @@@ F:   arch/arm64/boot/dts/marvell/armada-3
  
  MHI BUS
  M:    Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
 -R:    Hemant Kumar <quic_hemantk@quicinc.com>
  L:    mhi@lists.linux.dev
  L:    linux-arm-msm@vger.kernel.org
  S:    Maintained
@@@ -13626,6 -13544,7 +13626,6 @@@ L:   dmaengine@vger.kernel.or
  S:    Supported
  F:    Documentation/devicetree/bindings/dma/atmel-dma.txt
  F:    drivers/dma/at_hdmac.c
 -F:    drivers/dma/at_hdmac_regs.h
  F:    drivers/dma/at_xdmac.c
  F:    include/dt-bindings/dma/at91.h
  
@@@ -13835,7 -13754,7 +13835,7 @@@ MICROCHIP USB251XB DRIVE
  M:    Richard Leitner <richard.leitner@skidata.com>
  L:    linux-usb@vger.kernel.org
  S:    Maintained
 -F:    Documentation/devicetree/bindings/usb/usb251xb.txt
 +F:    Documentation/devicetree/bindings/usb/usb251xb.yaml
  F:    drivers/usb/misc/usb251xb.c
  
  MICROCHIP USBA UDC DRIVER
@@@ -13875,15 -13794,6 +13875,15 @@@ F: drivers/scsi/smartpqi/smartpqi*.[ch
  F:    include/linux/cciss*.h
  F:    include/uapi/linux/cciss*.h
  
 +MICROSOFT MANA RDMA DRIVER
 +M:    Long Li <longli@microsoft.com>
 +M:    Ajay Sharma <sharmaajay@microsoft.com>
 +L:    linux-rdma@vger.kernel.org
 +S:    Supported
 +F:    drivers/infiniband/hw/mana/
 +F:    include/net/mana
 +F:    include/uapi/rdma/mana-abi.h
 +
  MICROSOFT SURFACE AGGREGATOR TABLET-MODE SWITCH
  M:    Maximilian Luz <luzmaximilian@gmail.com>
  L:    platform-driver-x86@vger.kernel.org
@@@ -14777,9 -14687,10 +14777,9 @@@ T:  git git://git.kernel.org/pub/scm/lin
  F:    arch/nios2/
  
  NITRO ENCLAVES (NE)
 -M:    Andra Paraschiv <andraprs@amazon.com>
 -M:    Alexandru Vasile <lexnv@amazon.com>
  M:    Alexandru Ciobotaru <alcioa@amazon.com>
  L:    linux-kernel@vger.kernel.org
 +L:    The AWS Nitro Enclaves Team <aws-nitro-enclaves-devel@amazon.com>
  S:    Supported
  W:    https://aws.amazon.com/ec2/nitro/nitro-enclaves/
  F:    Documentation/virt/ne_overview.rst
@@@ -14916,6 -14827,7 +14916,7 @@@ L:   linux-nvme@lists.infradead.or
  S:    Supported
  W:    http://git.infradead.org/nvme.git
  T:    git://git.infradead.org/nvme.git
+ F:    Documentation/nvme/
  F:    drivers/nvme/host/
  F:    drivers/nvme/common/
  F:    include/linux/nvme*
@@@ -15337,7 -15249,6 +15338,7 @@@ F:   drivers/mfd/menelaus.
  F:    drivers/mfd/palmas.c
  F:    drivers/mfd/tps65217.c
  F:    drivers/mfd/tps65218.c
 +F:    drivers/mfd/tps65219.c
  F:    drivers/mfd/tps65910.c
  F:    drivers/mfd/twl-core.[ch]
  F:    drivers/mfd/twl4030*.c
@@@ -16430,7 -16341,7 +16431,7 @@@ F:   tools/lib/perf
  F:    tools/perf/
  
  PERFORMANCE EVENTS TOOLING ARM64
 -R:    John Garry <john.garry@huawei.com>
 +R:    John Garry <john.g.garry@oracle.com>
  R:    Will Deacon <will@kernel.org>
  R:    James Clark <james.clark@arm.com>
  R:    Mike Leach <mike.leach@linaro.org>
@@@ -18007,13 -17918,6 +18008,13 @@@ F: Documentation/ABI/*/sysfs-driver-hid
  F:    drivers/hid/hid-roccat*
  F:    include/linux/hid-roccat*
  
 +ROCKCHIP CRYPTO DRIVERS
 +M:    Corentin Labbe <clabbe@baylibre.com>
 +L:    linux-crypto@vger.kernel.org
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/crypto/rockchip,rk3288-crypto.yaml
 +F:    drivers/crypto/rockchip/
 +
  ROCKCHIP I2S TDM DRIVER
  M:    Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
  L:    linux-rockchip@lists.infradead.org
@@@ -19127,7 -19031,7 +19128,7 @@@ M:   Jason A. Donenfeld <Jason@zx2c4.com
  S:    Maintained
  F:    include/linux/siphash.h
  F:    lib/siphash.c
 -F:    lib/test_siphash.c
 +F:    lib/siphash_kunit.c
  
  SIS 190 ETHERNET DRIVER
  M:    Francois Romieu <romieu@fr.zoreil.com>
@@@ -21125,9 -21029,6 +21126,9 @@@ F:   drivers/hwmon/pmbus/tps546d24.
  TRACING
  M:    Steven Rostedt <rostedt@goodmis.org>
  M:    Masami Hiramatsu <mhiramat@kernel.org>
 +L:    linux-kernel@vger.kernel.org
 +L:    linux-trace-kernel@vger.kernel.org
 +Q:    https://patchwork.kernel.org/project/linux-trace-kernel/list/
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
  F:    Documentation/trace/*
@@@ -21831,7 -21732,7 +21832,7 @@@ M:   Alex Williamson <alex.williamson@red
  R:    Cornelia Huck <cohuck@redhat.com>
  L:    kvm@vger.kernel.org
  S:    Maintained
 -T:    git git://github.com/awilliam/linux-vfio.git
 +T:    git https://github.com/awilliam/linux-vfio.git
  F:    Documentation/ABI/testing/sysfs-devices-vfio-dev
  F:    Documentation/driver-api/vfio.rst
  F:    drivers/vfio/
@@@ -23052,7 -22953,8 +23053,7 @@@ F:   drivers/media/pci/zoran
  
  ZRAM COMPRESSED RAM BLOCK DEVICE DRVIER
  M:    Minchan Kim <minchan@kernel.org>
 -M:    Nitin Gupta <ngupta@vflare.org>
 -R:    Sergey Senozhatsky <senozhatsky@chromium.org>
 +M:    Sergey Senozhatsky <senozhatsky@chromium.org>
  L:    linux-kernel@vger.kernel.org
  S:    Maintained
  F:    Documentation/admin-guide/blockdev/zram.rst
@@@ -23065,7 -22967,8 +23066,7 @@@ F:   drivers/tty/serial/zs.
  
  ZSMALLOC COMPRESSED SLAB MEMORY ALLOCATOR
  M:    Minchan Kim <minchan@kernel.org>
 -M:    Nitin Gupta <ngupta@vflare.org>
 -R:    Sergey Senozhatsky <senozhatsky@chromium.org>
 +M:    Sergey Senozhatsky <senozhatsky@chromium.org>
  L:    linux-mm@kvack.org
  S:    Maintained
  F:    Documentation/mm/zsmalloc.rst
  M:    Nick Terrell <terrelln@fb.com>
  S:    Maintained
  B:    https://github.com/facebook/zstd/issues
 -T:    git git://github.com/terrelln/linux.git
 +T:    git https://github.com/terrelln/linux.git
  F:    include/linux/zstd*
  F:    lib/zstd/
  F:    lib/decompress_unzstd.c
diff --combined drivers/nvme/host/core.c
index 95c488ea91c3035bf67871627b090f3c94020592,d307ae4d8a57521bcc2c3d9c191a41682673421b..7be562a4e1aa72d6278f657a24730afabb47aee8
@@@ -1074,6 -1074,18 +1074,18 @@@ static u32 nvme_known_admin_effects(u8 
        return 0;
  }
  
+ static u32 nvme_known_nvm_effects(u8 opcode)
+ {
+       switch (opcode) {
+       case nvme_cmd_write:
+       case nvme_cmd_write_zeroes:
+       case nvme_cmd_write_uncor:
+                return NVME_CMD_EFFECTS_LBCC;
+       default:
+               return 0;
+       }
+ }
  u32 nvme_command_effects(struct nvme_ctrl *ctrl, struct nvme_ns *ns, u8 opcode)
  {
        u32 effects = 0;
        if (ns) {
                if (ns->head->effects)
                        effects = le32_to_cpu(ns->head->effects->iocs[opcode]);
+               if (ns->head->ids.csi == NVME_CAP_CSS_NVM)
+                       effects |= nvme_known_nvm_effects(opcode);
                if (effects & ~(NVME_CMD_EFFECTS_CSUPP | NVME_CMD_EFFECTS_LBCC))
                        dev_warn_once(ctrl->device,
-                               "IO command:%02x has unhandled effects:%08x\n",
+                               "IO command:%02x has unusual effects:%08x\n",
                                opcode, effects);
-               return 0;
-       }
  
-       if (ctrl->effects)
-               effects = le32_to_cpu(ctrl->effects->acs[opcode]);
-       effects |= nvme_known_admin_effects(opcode);
+               /*
+                * NVME_CMD_EFFECTS_CSE_MASK causes a freeze all I/O queues,
+                * which would deadlock when done on an I/O command.  Note that
+                * We already warn about an unusual effect above.
+                */
+               effects &= ~NVME_CMD_EFFECTS_CSE_MASK;
+       } else {
+               if (ctrl->effects)
+                       effects = le32_to_cpu(ctrl->effects->acs[opcode]);
+               effects |= nvme_known_admin_effects(opcode);
+       }
  
        return effects;
  }
@@@ -2117,34 -2137,11 +2137,34 @@@ static int nvme_send_ns_pr_command(stru
        return nvme_submit_sync_cmd(ns->queue, c, data, 16);
  }
  
 +static int nvme_sc_to_pr_err(int nvme_sc)
 +{
 +      if (nvme_is_path_error(nvme_sc))
 +              return PR_STS_PATH_FAILED;
 +
 +      switch (nvme_sc) {
 +      case NVME_SC_SUCCESS:
 +              return PR_STS_SUCCESS;
 +      case NVME_SC_RESERVATION_CONFLICT:
 +              return PR_STS_RESERVATION_CONFLICT;
 +      case NVME_SC_ONCS_NOT_SUPPORTED:
 +              return -EOPNOTSUPP;
 +      case NVME_SC_BAD_ATTRIBUTES:
 +      case NVME_SC_INVALID_OPCODE:
 +      case NVME_SC_INVALID_FIELD:
 +      case NVME_SC_INVALID_NS:
 +              return -EINVAL;
 +      default:
 +              return PR_STS_IOERR;
 +      }
 +}
 +
  static int nvme_pr_command(struct block_device *bdev, u32 cdw10,
                                u64 key, u64 sa_key, u8 op)
  {
        struct nvme_command c = { };
        u8 data[16] = { 0, };
 +      int ret;
  
        put_unaligned_le64(key, &data[0]);
        put_unaligned_le64(sa_key, &data[8]);
  
        if (IS_ENABLED(CONFIG_NVME_MULTIPATH) &&
            bdev->bd_disk->fops == &nvme_ns_head_ops)
 -              return nvme_send_ns_head_pr_command(bdev, &c, data);
 -      return nvme_send_ns_pr_command(bdev->bd_disk->private_data, &c, data);
 +              ret = nvme_send_ns_head_pr_command(bdev, &c, data);
 +      else
 +              ret = nvme_send_ns_pr_command(bdev->bd_disk->private_data, &c,
 +                                            data);
 +      if (ret < 0)
 +              return ret;
 +
 +      return nvme_sc_to_pr_err(ret);
  }
  
  static int nvme_pr_register(struct block_device *bdev, u64 old,
@@@ -4628,9 -4619,9 +4648,9 @@@ void nvme_remove_namespaces(struct nvme
  }
  EXPORT_SYMBOL_GPL(nvme_remove_namespaces);
  
 -static int nvme_class_uevent(struct device *dev, struct kobj_uevent_env *env)
 +static int nvme_class_uevent(const struct device *dev, struct kobj_uevent_env *env)
  {
 -      struct nvme_ctrl *ctrl =
 +      const struct nvme_ctrl *ctrl =
                container_of(dev, struct nvme_ctrl, ctrl_device);
        struct nvmf_ctrl_options *opts = ctrl->opts;
        int ret;
@@@ -4926,7 -4917,7 +4946,7 @@@ int nvme_alloc_io_tag_set(struct nvme_c
  
        memset(set, 0, sizeof(*set));
        set->ops = ops;
-       set->queue_depth = ctrl->sqsize + 1;
+       set->queue_depth = min_t(unsigned, ctrl->sqsize, BLK_MQ_MAX_DEPTH - 1);
        /*
         * Some Apple controllers requires tags to be unique across admin and
         * the (only) I/O queue, so reserve the first 32 tags of the I/O queue.