24 May, 2019

2 commits

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 or at your option any
    later version you should have received a copy of the gnu general
    public license for example usr src linux copying if not write to the
    free software foundation inc 675 mass ave cambridge ma 02139 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 20 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520170858.552543146@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 or at your option any
    later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 11 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520170858.370933192@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

3 commits

  • Add SPDX license identifiers to all Make/Kconfig files which:

    - Have no license information of any form

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have MODULE_LICENCE("GPL*") inside which was used in the initial
    scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have EXPORT_.*_SYMBOL_GPL inside which was used in the
    initial scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

17 May, 2019

1 commit

  • …it/device-mapper/linux-dm

    Pull device mapper updates from Mike Snitzer:

    - Improve DM snapshot target's scalability by using finer grained
    locking. Requires some list_bl interface improvements.

    - Add ability for DM integrity to use a bitmap mode, that tracks
    regions where data and metadata are out of sync, instead of using a
    journal.

    - Improve DM thin provisioning target to not write metadata changes to
    disk if the thin-pool and associated thin devices are merely
    activated but not used. This avoids metadata corruption due to
    concurrent activation of thin devices across different OS instances
    (e.g. split brain scenarios, which ultimately would be avoided if
    proper device filters were used -- but not having proper filtering
    has proven a very common configuration mistake)

    - Fix missing call to path selector type->end_io in DM multipath. This
    fixes reported performance problems due to inaccurate path selector
    IO accounting causing an imbalance of IO (e.g. avoiding issuing IO to
    particular path due to it seemingly being heavily used).

    - Fix bug in DM cache metadata's loading of its discard bitset that
    could lead to all cache blocks being discarded if the very first
    cache block was discarded (thankfully in practice the first cache
    block is generally in use; be it FS superblock, partition table, disk
    label, etc).

    - Add testing-only DM dust target which simulates a device that has
    failing sectors and/or read failures.

    - Fix a DM init error path reference count hang that caused boot hangs
    if user supplied malformed input on kernel commandline.

    - Fix a couple issues with DM crypt target's logging being overly
    verbose or lacking context.

    - Various other small fixes to DM init, DM multipath, DM zoned, and DM
    crypt.

    * tag 'for-5.2/dm-changes-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: (42 commits)
    dm: fix a couple brace coding style issues
    dm crypt: print device name in integrity error message
    dm crypt: move detailed message into debug level
    dm ioctl: fix hang in early create error condition
    dm integrity: whitespace, coding style and dead code cleanup
    dm integrity: implement synchronous mode for reboot handling
    dm integrity: handle machine reboot in bitmap mode
    dm integrity: add a bitmap mode
    dm integrity: introduce a function add_new_range_and_wait()
    dm integrity: allow large ranges to be described
    dm ingerity: pass size to dm_integrity_alloc_page_list()
    dm integrity: introduce rw_journal_sectors()
    dm integrity: update documentation
    dm integrity: don't report unused options
    dm integrity: don't check null pointer before kvfree and vfree
    dm integrity: correctly calculate the size of metadata area
    dm dust: Make dm_dust_init and dm_dust_exit static
    dm dust: remove redundant unsigned comparison to less than zero
    dm mpath: always free attached_handler_name in parse_path()
    dm init: fix max devices/targets checks
    ...

    Linus Torvalds
     

16 May, 2019

4 commits

  • Signed-off-by: Sheetal Singala
    Signed-off-by: Mike Snitzer

    Sheetal Singala
     
  • This message should better identify the DM device with the integrity
    failure.

    Signed-off-by: Milan Broz
    Signed-off-by: Mike Snitzer

    Milan Broz
     
  • The information about tag size should not be printed without debug info
    set. Also print device major:minor in the error message to identify the
    device instance.

    Also use rate limiting and debug level for info about used crypto API
    implementaton. This is important because during online reencryption
    the existing message saturates syslog (because we are moving hotzone
    across the whole device).

    Cc: stable@vger.kernel.org
    Signed-off-by: Milan Broz
    Signed-off-by: Mike Snitzer

    Milan Broz
     
  • The dm_early_create() function (which deals with "dm-mod.create=" kernel
    command line option) calls dm_hash_insert() who gets an extra reference
    to the md object.

    In case of failure, this reference wasn't being released, causing
    dm_destroy() to hang, thus hanging the whole boot process.

    Fix this by calling __hash_remove() in the error path.

    Fixes: 6bbc923dfcf57d ("dm: add support to directly boot to a mapped device")
    Cc: stable@vger.kernel.org
    Signed-off-by: Helen Koike
    Signed-off-by: Mike Snitzer

    Helen Koike
     

10 May, 2019

1 commit


09 May, 2019

4 commits

  • Unfortunatelly, there may be bios coming even after the reboot notifier
    was called. We don't want these bios to make the bitmap dirty again.

    To address this, implement a synchronous mode - when a bio is about to
    be terminated, we clean the bitmap and terminate the bio after the clean
    operation succeeds. This obviously slows down bio processing, but it
    makes sure that when all bios are finished, the bitmap will be clean.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     
  • When in bitmap mode the bitmap must be cleared when rebooting. This
    commit adds the reboot hook.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     
  • Introduce an alternate mode of operation where dm-integrity uses a
    bitmap instead of a journal. If a bit in the bitmap is 1, the
    corresponding region's data and integrity tags are not synchronized - if
    the machine crashes, the unsynchronized regions will be recalculated.
    The bitmap mode is faster than the journal mode, because we don't have
    to write the data twice, but it is also less reliable, because if data
    corruption happens when the machine crashes, it may not be detected.

    Benchmark results for an SSD connected to a SATA300 port, when doing
    large linear writes with dd:

    buffered I/O:
    raw device throughput - 245MB/s
    dm-integrity with journaling - 120MB/s
    dm-integrity with bitmap - 238MB/s

    direct I/O with 1MB block size:
    raw device throughput - 248MB/s
    dm-integrity with journaling - 123MB/s
    dm-integrity with bitmap - 223MB/s

    For more info see dm-integrity in Documentation/device-mapper/

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     
  • Introduce a function add_new_range_and_wait() in order to avoid
    repetitive code. It will be used in the following commit.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     

08 May, 2019

10 commits

  • Pull block updates from Jens Axboe:
    "Nothing major in this series, just fixes and improvements all over the
    map. This contains:

    - Series of fixes for sed-opal (David, Jonas)

    - Fixes and performance tweaks for BFQ (via Paolo)

    - Set of fixes for bcache (via Coly)

    - Set of fixes for md (via Song)

    - Enabling multi-page for passthrough requests (Ming)

    - Queue release fix series (Ming)

    - Device notification improvements (Martin)

    - Propagate underlying device rotational status in loop (Holger)

    - Removal of mtip32xx trim support, which has been disabled for years
    (Christoph)

    - Improvement and cleanup of nvme command handling (Christoph)

    - Add block SPDX tags (Christoph)

    - Cleanup/hardening of bio/bvec iteration (Christoph)

    - A few NVMe pull requests (Christoph)

    - Removal of CONFIG_LBDAF (Christoph)

    - Various little fixes here and there"

    * tag 'for-5.2/block-20190507' of git://git.kernel.dk/linux-block: (164 commits)
    block: fix mismerge in bvec_advance
    block: don't drain in-progress dispatch in blk_cleanup_queue()
    blk-mq: move cancel of hctx->run_work into blk_mq_hw_sysfs_release
    blk-mq: always free hctx after request queue is freed
    blk-mq: split blk_mq_alloc_and_init_hctx into two parts
    blk-mq: free hw queue's resource in hctx's release handler
    blk-mq: move cancel of requeue_work into blk_mq_release
    blk-mq: grab .q_usage_counter when queuing request from plug code path
    block: fix function name in comment
    nvmet: protect discovery change log event list iteration
    nvme: mark nvme_core_init and nvme_core_exit static
    nvme: move command size checks to the core
    nvme-fabrics: check more command sizes
    nvme-pci: check more command sizes
    nvme-pci: remove an unneeded variable initialization
    nvme-pci: unquiesce admin queue on shutdown
    nvme-pci: shutdown on timeout during deletion
    nvme-pci: fix psdt field for single segment sgls
    nvme-multipath: don't print ANA group state by default
    nvme-multipath: split bios with the ns_head bio_set before submitting
    ...

    Linus Torvalds
     
  • Change n_sectors data type from unsigned to sector_t. Following commits
    will need to lock large ranges.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     
  • Pass size to dm_integrity_alloc_page_list(). This is needed so
    following commits can pass a size that is different from
    ic->journal_pages.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     
  • Introduce a function rw_journal_sectors() that takes sector and length
    as its arguments instead of a section and the number of sections.

    This functions will be used in further patches.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     
  • Update documentation with the "meta_device" parameter and flags.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     
  • If we are not journaling, don't report journaling options in the table
    status.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     
  • The functions kfree, vfree and kvfree do nothing if we pass a NULL
    pointer to them. So we don't need to test the pointer for NULL.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     
  • When we use separate devices for data and metadata, dm-integrity would
    incorrectly calculate the size of the metadata device as if it had
    512-byte block size - and it would refuse activation with larger block
    size and smaller metadata device.

    Fix this so that it takes actual block size into account, which fixes
    the following reported issue:
    https://gitlab.com/cryptsetup/cryptsetup/issues/450

    Fixes: 356d9d52e122 ("dm integrity: allow separate metadata device")
    Cc: stable@vger.kernel.org # v4.19+
    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     
  • Fix sparse warnings:

    drivers/md/dm-dust.c:495:12: warning: symbol 'dm_dust_init' was not declared. Should it be static?
    drivers/md/dm-dust.c:505:13: warning: symbol 'dm_dust_exit' was not declared. Should it be static?

    Reported-by: Hulk Robot
    Signed-off-by: YueHaibing
    Signed-off-by: Mike Snitzer

    YueHaibing
     
  • Variable block is an unsigned long long hence the less than zero
    comparison is always false, hence it is redundant and can be removed.

    Addresses-Coverity: ("Unsigned compared against 0")
    Signed-off-by: Colin Ian King
    Reviewed-by: Bryan Gurney
    Signed-off-by: Mike Snitzer

    Colin Ian King
     

07 May, 2019

1 commit

  • Pull crypto update from Herbert Xu:
    "API:
    - Add support for AEAD in simd
    - Add fuzz testing to testmgr
    - Add panic_on_fail module parameter to testmgr
    - Use per-CPU struct instead multiple variables in scompress
    - Change verify API for akcipher

    Algorithms:
    - Convert x86 AEAD algorithms over to simd
    - Forbid 2-key 3DES in FIPS mode
    - Add EC-RDSA (GOST 34.10) algorithm

    Drivers:
    - Set output IV with ctr-aes in crypto4xx
    - Set output IV in rockchip
    - Fix potential length overflow with hashing in sun4i-ss
    - Fix computation error with ctr in vmx
    - Add SM4 protected keys support in ccree
    - Remove long-broken mxc-scc driver
    - Add rfc4106(gcm(aes)) cipher support in cavium/nitrox"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (179 commits)
    crypto: ccree - use a proper le32 type for le32 val
    crypto: ccree - remove set but not used variable 'du_size'
    crypto: ccree - Make cc_sec_disable static
    crypto: ccree - fix spelling mistake "protedcted" -> "protected"
    crypto: caam/qi2 - generate hash keys in-place
    crypto: caam/qi2 - fix DMA mapping of stack memory
    crypto: caam/qi2 - fix zero-length buffer DMA mapping
    crypto: stm32/cryp - update to return iv_out
    crypto: stm32/cryp - remove request mutex protection
    crypto: stm32/cryp - add weak key check for DES
    crypto: atmel - remove set but not used variable 'alg_name'
    crypto: picoxcell - Use dev_get_drvdata()
    crypto: crypto4xx - get rid of redundant using_sd variable
    crypto: crypto4xx - use sync skcipher for fallback
    crypto: crypto4xx - fix cfb and ofb "overran dst buffer" issues
    crypto: crypto4xx - fix ctr-aes missing output IV
    crypto: ecrdsa - select ASN1 and OID_REGISTRY for EC-RDSA
    crypto: ux500 - use ccflags-y instead of CFLAGS_.o
    crypto: ccree - handle tee fips error during power management resume
    crypto: ccree - add function to handle cryptocell tee fips error
    ...

    Linus Torvalds
     

01 May, 2019

4 commits

  • It's not used outside this file.

    Fixes: 631207314d88 ("bcache: fix failure in journal relplay")
    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • Commit b592211c33f7 ("dm mpath: fix attached_handler_name leak and
    dangling hw_handler_name pointer") fixed a memory leak for the case
    where setup_scsi_dh() returns failure. But setup_scsi_dh may return
    success and not "use" attached_handler_name if the
    retain_attached_hwhandler flag is not set on the map. As setup_scsi_sh
    properly "steals" the pointer by nullifying it, freeing it
    unconditionally in parse_path() is safe.

    Fixes: b592211c33f7 ("dm mpath: fix attached_handler_name leak and dangling hw_handler_name pointer")
    Cc: stable@vger.kernel.org
    Reported-by: Yufen Yu
    Signed-off-by: Martin Wilck
    Signed-off-by: Mike Snitzer

    Martin Wilck
     
  • dm-init should allow up to DM_MAX_{DEVICES,TARGETS} for devices/targets,
    and not DM_MAX_{DEVICES,TARGETS} - 1.

    Fix the checks and also fix the error message when the number of devices
    is surpassed.

    Fixes: 6bbc923dfcf57d ("dm: add support to directly boot to a mapped device")
    Cc: stable@vger.kernel.org
    Signed-off-by: Helen Koike
    Signed-off-by: Mike Snitzer

    Helen Koike
     
  • Add the dm-dust target, which simulates the behavior of bad sectors
    at arbitrary locations, and the ability to enable the emulation of
    the read failures at an arbitrary time.

    This target behaves similarly to a linear target. At a given time,
    the user can send a message to the target to start failing read
    requests on specific blocks. When the failure behavior is enabled,
    reads of blocks configured "bad" will fail with EIO.

    Writes of blocks configured "bad" will result in the following:

    1. Remove the block from the "bad block list".
    2. Successfully complete the write.

    After this point, the block will successfully contain the written
    data, and will service reads and writes normally. This emulates the
    behavior of a "remapped sector" on a hard disk drive.

    dm-dust provides logging of which blocks have been added or removed
    to the "bad block list", as well as logging when a block has been
    removed from the bad block list. These messages can be used
    alongside the messages from the driver using a dm-dust device to
    analyze the driver's behavior when a read fails at a given time.

    (This logging can be reduced via a "quiet" mode, if desired.)

    NOTE: If the block size is larger than 512 bytes, only the first sector
    of each "dust block" is detected. Placing a limiting layer above a dust
    target, to limit the minimum I/O size to the dust block size, will
    ensure proper emulation of the given large block size.

    Signed-off-by: Bryan Gurney
    Co-developed-by: Joe Shimkus
    Co-developed-by: John Dorminy
    Co-developed-by: John Pittman
    Co-developed-by: Thomas Jaskiewicz
    Signed-off-by: Mike Snitzer

    Bryan Gurney
     

30 Apr, 2019

3 commits

  • We only have two callers that need the integer loop iterator, and they
    can easily maintain it themselves.

    Suggested-by: Matthew Wilcox
    Reviewed-by: Johannes Thumshirn
    Acked-by: David Sterba
    Reviewed-by: Hannes Reinecke
    Acked-by: Coly Li
    Reviewed-by: Matthew Wilcox
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     
  • Use a variable containing the buffer address instead of the to be
    removed integer iterator from bio_for_each_segment_all.

    Suggested-by: Matthew Wilcox
    Reviewed-by: Hannes Reinecke
    Acked-by: Coly Li
    Reviewed-by: Matthew Wilcox
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     
  • Commit 95f18c9d1310 ("bcache: avoid potential memleak of list of
    journal_replay(s) in the CACHE_SYNC branch of run_cache_set") forgets
    to remove the original define of LIST_HEAD(journal), which makes
    the change no take effect. This patch removes redundant variable
    LIST_HEAD(journal) from run_cache_set(), to make Shenghui's fix
    working.

    Fixes: 95f18c9d1310 ("bcache: avoid potential memleak of list of journal_replay(s) in the CACHE_SYNC branch of run_cache_set")
    Reported-by: Juha Aatrokoski
    Cc: Shenghui Wang
    Signed-off-by: Coly Li
    Signed-off-by: Jens Axboe

    Coly Li
     

29 Apr, 2019

2 commits

  • Replace the indirection through struct stack_trace with an invocation of
    the storage array based interface. This results in less storage space and
    indirection.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Josh Poimboeuf
    Cc: Andy Lutomirski
    Cc: dm-devel@redhat.com
    Cc: Mike Snitzer
    Cc: Alasdair Kergon
    Cc: Steven Rostedt
    Cc: Alexander Potapenko
    Cc: Alexey Dobriyan
    Cc: Andrew Morton
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: linux-mm@kvack.org
    Cc: David Rientjes
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Andrey Ryabinin
    Cc: kasan-dev@googlegroups.com
    Cc: Mike Rapoport
    Cc: Akinobu Mita
    Cc: Christoph Hellwig
    Cc: iommu@lists.linux-foundation.org
    Cc: Robin Murphy
    Cc: Marek Szyprowski
    Cc: Johannes Thumshirn
    Cc: David Sterba
    Cc: Chris Mason
    Cc: Josef Bacik
    Cc: linux-btrfs@vger.kernel.org
    Cc: Daniel Vetter
    Cc: intel-gfx@lists.freedesktop.org
    Cc: Joonas Lahtinen
    Cc: Maarten Lankhorst
    Cc: dri-devel@lists.freedesktop.org
    Cc: David Airlie
    Cc: Jani Nikula
    Cc: Rodrigo Vivi
    Cc: Tom Zanussi
    Cc: Miroslav Benes
    Cc: linux-arch@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190425094802.533968922@linutronix.de

    Thomas Gleixner
     
  • Replace the indirection through struct stack_trace with an invocation of
    the storage array based interface.

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Josh Poimboeuf
    Cc: Andy Lutomirski
    Cc: dm-devel@redhat.com
    Cc: Mike Snitzer
    Cc: Alasdair Kergon
    Cc: Steven Rostedt
    Cc: Alexander Potapenko
    Cc: Alexey Dobriyan
    Cc: Andrew Morton
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: linux-mm@kvack.org
    Cc: David Rientjes
    Cc: Catalin Marinas
    Cc: Dmitry Vyukov
    Cc: Andrey Ryabinin
    Cc: kasan-dev@googlegroups.com
    Cc: Mike Rapoport
    Cc: Akinobu Mita
    Cc: Christoph Hellwig
    Cc: iommu@lists.linux-foundation.org
    Cc: Robin Murphy
    Cc: Marek Szyprowski
    Cc: Johannes Thumshirn
    Cc: David Sterba
    Cc: Chris Mason
    Cc: Josef Bacik
    Cc: linux-btrfs@vger.kernel.org
    Cc: Daniel Vetter
    Cc: intel-gfx@lists.freedesktop.org
    Cc: Joonas Lahtinen
    Cc: Maarten Lankhorst
    Cc: dri-devel@lists.freedesktop.org
    Cc: David Airlie
    Cc: Jani Nikula
    Cc: Rodrigo Vivi
    Cc: Tom Zanussi
    Cc: Miroslav Benes
    Cc: linux-arch@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190425094802.446326191@linutronix.de

    Thomas Gleixner
     

26 Apr, 2019

5 commits

  • This is a small optimization in writecache_find_entry().

    If we go past the condition "if (unlikely(!node))", we can be certain that
    there is no entry in the tree that has the block equal to the "block"
    variable.

    Consequently, we can return the next entry directly, we don't need to go
    to the second part of the function that finds the entry with lowest or
    highest seq number that matches the "block" variable.

    Also, add some whitespace and cleanup needless braces.

    Suggested-by: Huaisheng Ye
    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     
  • The stucture member page_offset in writeback_struct never has been
    used actually. Remove it.

    Signed-off-by: Huaisheng Ye
    Acked-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Huaisheng Ye
     
  • When the target line contains an invalid device, delay_ctr() will call
    delay_dtr() with NULL workqueue. Attempting to destroy the NULL
    workqueue causes a crash.

    Signed-off-by: Mikulas Patocka
    Cc: stable@vger.kernel.org
    Signed-off-by: Mike Snitzer

    Mikulas Patocka
     
  • md->dax_dev defaults to NULL and there is no need to initialize it
    if CONFIG_DAX_DRIVER is disabled.

    Signed-off-by: Peng Wang
    Signed-off-by: Mike Snitzer

    Peng Wang
     
  • After commit 396eaf21ee17 ("blk-mq: improve DM's blk-mq IO merging via
    blk_insert_cloned_request feedback"), map_request() will requeue the tio
    when issued clone request return BLK_STS_RESOURCE or BLK_STS_DEV_RESOURCE.

    Thus, if device driver status is error, a tio may be requeued multiple
    times until the return value is not DM_MAPIO_REQUEUE. That means
    type->start_io may be called multiple times, while type->end_io is only
    called when IO complete.

    In fact, even without commit 396eaf21ee17, setup_clone() failure can
    also cause tio requeue and associated missed call to type->end_io.

    The service-time path selector selects path based on in_flight_size,
    which is increased by st_start_io() and decreased by st_end_io().
    Missed calls to st_end_io() can lead to in_flight_size count error and
    will cause the selector to make the wrong choice. In addition,
    queue-length path selector will also be affected.

    To fix the problem, call type->end_io in ->release_clone_rq before tio
    requeue. map_info is passed to ->release_clone_rq() for map_request()
    error path that result in requeue.

    Fixes: 396eaf21ee17 ("blk-mq: improve DM's blk-mq IO merging via blk_insert_cloned_request feedback")
    Cc: stable@vger.kernl.org
    Signed-off-by: Yufen Yu
    Signed-off-by: Mike Snitzer

    Yufen Yu