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
     

19 Apr, 2019

1 commit

  • Use list_bl to implement the exception hash tables' buckets. This change
    permits concurrent access, to distinct buckets, by multiple threads.

    Also, implement helper functions to lock and unlock the exception tables
    based on the chunk number of the exception at hand.

    We retain the global locking, by means of down_write(), which is
    replaced by the next commit.

    Still, we must acquire the per-bucket spinlocks when accessing the hash
    tables, since list_bl does not allow modification on unlocked lists.

    Co-developed-by: Ilias Tsitsimpis
    Signed-off-by: Nikos Tsironis
    Acked-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Nikos Tsironis
     

07 Apr, 2019

1 commit

  • Currently support for 64-bit sector_t and blkcnt_t is optional on 32-bit
    architectures. These types are required to support block device and/or
    file sizes larger than 2 TiB, and have generally defaulted to on for
    a long time. Enabling the option only increases the i386 tinyconfig
    size by 145 bytes, and many data structures already always use
    64-bit values for their in-core and on-disk data structures anyway,
    so there should not be a large change in dynamic memory usage either.

    Dropping this option removes a somewhat weird non-default config that
    has cause various bugs or compiler warnings when actually used.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

09 Jan, 2016

1 commit

  • When there is an error copying a chunk dm-snapshot can incorrectly hold
    associated bios indefinitely, resulting in hung IO.

    The function copy_callback sets pe->error if there was error copying the
    chunk, and then calls complete_exception. complete_exception calls
    pending_complete on error, otherwise it calls commit_exception with
    commit_callback (and commit_callback calls complete_exception).

    The persistent exception store (dm-snap-persistent.c) assumes that calls
    to prepare_exception and commit_exception are paired.
    persistent_prepare_exception increases ps->pending_count and
    persistent_commit_exception decreases it.

    If there is a copy error, persistent_prepare_exception is called but
    persistent_commit_exception is not. This results in the variable
    ps->pending_count never returning to zero and that causes some pending
    exceptions (and their associated bios) to be held forever.

    Fix this by unconditionally calling commit_exception regardless of
    whether the copy was successful. A new "valid" parameter is added to
    commit_exception -- when the copy fails this parameter is set to zero so
    that the chunk that failed to copy (and all following chunks) is not
    recorded in the snapshot store. Also, remove commit_callback now that
    it is merely a wrapper around pending_complete.

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

    Mikulas Patocka
     

10 Oct, 2015

1 commit

  • Commit 76c44f6d80 introduced the possibly for "Overflow" to be reported
    by the snapshot device's status. Older userspace (e.g. lvm2) does not
    handle the "Overflow" status response.

    Fix this incompatibility by requiring newer userspace code, that can
    cope with "Overflow", request the persistent store with overflow support
    by using "PO" (Persistent with Overflow) for the snapshot store type.

    Reported-by: Zdenek Kabelac
    Fixes: 76c44f6d80 ("dm snapshot: don't invalidate on-disk image on snapshot write overflow")
    Reviewed-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer

    Mike Snitzer
     

12 Aug, 2010

1 commit

  • Validate chunk size against both origin and snapshot sector size

    Don't allow chunk size smaller than either origin or snapshot logical
    sector size. Reading or writing data not aligned to sector size is not
    allowed and causes immediate errors.

    This requires us to open the origin before initialising the
    exception store and to export dm_snap_origin.

    Cc: stable@kernel.org
    Signed-off-by: Mikulas Patocka
    Reviewed-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     

11 Dec, 2009

6 commits

  • Merging is started when origin is resumed and it is stopped when
    origin is suspended or when the merging snapshot is destroyed or
    errors are detected.

    Merging is not yet interlocked with writes: this will be handled in
    subsequent patches.

    The code relies on callbacks from a private kcopyd thread.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     
  • Add functions that decide how many consecutive chunks of snapshot to
    merge back into the origin next and to update the metadata afterwards.

    prepare_merge provides a pointer to the most recent still-to-be-merged
    chunk and returns how many previous ones are consecutive and can be
    processed together.

    commit_merge removes the nr_merged most-recent chunks permanently from
    the exception store. The number must not exceed that returned by
    prepare_merge.

    Introduce NUM_SNAPSHOT_HDR_CHUNKS to show where the snapshot header
    chunk is accounted for.

    Signed-off-by: Mikulas Patocka
    Reviewed-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     
  • Store the reference to the snapshot cow device in the core snapshot
    code instead of each exception store. It can be accessed through the
    new function dm_snap_cow(). Exception stores should each now maintain a
    reference to their parent snapshot struct.

    This is cleaner and makes part of the forthcoming snapshot merge code simpler.

    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon
    Reviewed-by: Jonathan Brassow
    Cc: Mikulas Patocka

    Mike Snitzer
     
  • Add number of sectors used by metadata to the end of the snapshot's status
    line.

    Renamed dm_exception_store_type's 'fraction_full' to 'usage'. Renamed
    arguments to be clearer about what is being returned. Also added
    'metadata_sectors'.

    Signed-off-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Mike Snitzer
     
  • The exception structure is not necessarily just a snapshot
    element (especially after we pull it out of dm-snap.c).

    Renaming appropriately.

    Signed-off-by: Jonathan Brassow
    Reviewed-by: Mike Snitzer
    Signed-off-by: Alasdair G Kergon

    Jon Brassow
     
  • Removed unnecessary 'and' masking: The right shift discards the lower
    bits so there is no need to clear them.

    (A later patch needs this change to support a 32-bit chunk_mask.)

    Signed-off-by: Mikulas Patocka
    Reviewed-by: Mike Snitzer
    Reviewed-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     

17 Oct, 2009

1 commit

  • Use unsigned integer chunk size.

    Maximum chunk size is 512kB, there won't ever be need to use 4GB chunk size,
    so the number can be 32-bit. This fixes compiler failure on 32-bit systems
    with large block devices.

    Cc: stable@kernel.org
    Signed-off-by: Mikulas Patocka
    Signed-off-by: Mike Snitzer
    Reviewed-by: Jonathan Brassow
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     

05 Sep, 2009

1 commit


22 Jun, 2009

1 commit

  • Use i_size_read() instead of reading i_size.

    If someone changes the size of the device simultaneously, i_size_read
    is guaranteed to return a valid value (either the old one or the new one).

    i_size can return some intermediate invalid value (on 32-bit computers
    with 64-bit i_size, the reads to both halves of i_size can be interleaved
    with updates to i_size, resulting in garbage being returned).

    Cc: stable@kernel.org
    Signed-off-by: Mikulas Patocka
    Signed-off-by: Alasdair G Kergon

    Mikulas Patocka
     

19 Jun, 2009

1 commit

  • Follow-up to "block: enable by default support for large devices
    and files on 32-bit archs".

    Rename CONFIG_LBD to CONFIG_LBDAF to:
    - allow update of existing [def]configs for "default y" change
    - reflect that it is used also for large files support nowadays

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     

03 Apr, 2009

8 commits


06 Jan, 2009

4 commits