01 Nov, 2011

1 commit


02 Aug, 2011

4 commits


29 May, 2011

1 commit

  • Replace the arbitrary calculation of an initial io struct mempool size
    with a constant.

    The code calculated the number of reserved structures based on the request
    size and used a "magic" multiplication constant of 4. This patch changes
    it to reserve a fixed number - itself still chosen quite arbitrarily.
    Further testing might show if there is a better number to choose.

    Note that if there is no memory pressure, we can still allocate an
    arbitrary number of "struct io" structures. One structure is enough to
    process the whole request.

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

    Mikulas Patocka
     

14 Jan, 2011

2 commits

  • metadata_wq serves on-stack work items from chunk_io(). Even if
    multiple chunk_io() are simultaneously in progress, each is
    independent and queued only once, so multithreaded workqueue can be
    safely used.

    Switch metadata_wq to multithread and flush the work item instead of
    the workqueue in chunk_io().

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

    Tejun Heo
     
  • Convert all create[_singlethread]_work() users to the new
    alloc[_ordered]_workqueue(). This conversion is mechanical and
    doesn't introduce any behavior change.

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

    Tejun Heo
     

27 Oct, 2010

1 commit

  • Silly though it is, completions and wait_queue_heads use foo_ONSTACK
    (COMPLETION_INITIALIZER_ONSTACK, DECLARE_COMPLETION_ONSTACK,
    __WAIT_QUEUE_HEAD_INIT_ONSTACK and DECLARE_WAIT_QUEUE_HEAD_ONSTACK) so I
    guess workqueues should do the same thing.

    s/INIT_WORK_ON_STACK/INIT_WORK_ONSTACK/
    s/INIT_DELAYED_WORK_ON_STACK/INIT_DELAYED_WORK_ONSTACK/

    Cc: Peter Zijlstra
    Acked-by: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

10 Sep, 2010

1 commit

  • This patch converts bio-based dm to support REQ_FLUSH/FUA instead of
    now deprecated REQ_HARDBARRIER.

    * -EOPNOTSUPP handling logic dropped.

    * Preflush is handled as before but postflush is dropped and replaced
    with passing down REQ_FUA to member request_queues. This replaces
    one array wide cache flush w/ member specific FUA writes.

    * __split_and_process_bio() now calls __clone_and_map_flush() directly
    for flushes and guarantees all FLUSH bio's going to targets are zero
    ` length.

    * It's now guaranteed that all FLUSH bio's which are passed onto dm
    targets are zero length. bio_empty_barrier() tests are replaced
    with REQ_FLUSH tests.

    * Empty WRITE_BARRIERs are replaced with WRITE_FLUSHes.

    * Dropped unlikely() around REQ_FLUSH tests. Flushes are not unlikely
    enough to be marked with unlikely().

    * Block layer now filters out REQ_FLUSH/FUA bio's if the request_queue
    doesn't support cache flushing. Advertise REQ_FLUSH | REQ_FUA
    capability.

    * Request based dm isn't converted yet. dm_init_request_based_queue()
    resets flush support to 0 for now. To avoid disturbing request
    based dm code, dm->flush_error is added for bio based dm while
    requested based dm continues to use dm->barrier_error.

    Lightly tested linear, stripe, raid1, snap and crypt targets. Please
    proceed with caution as I'm not familiar with the code base.

    Signed-off-by: Tejun Heo
    Cc: dm-devel@redhat.com
    Cc: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Tejun Heo
     

12 Aug, 2010

1 commit


17 Feb, 2010

1 commit

  • chunk_io() declares its 'struct mdata_req' on the stack and then
    initializes its 'struct work_struct' member. Annotate the
    initialization of this workqueue with INIT_WORK_ON_STACK to suppress a
    debugobjects warning seen when CONFIG_DEBUG_OBJECTS_WORK is enabled.

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

    Mike Snitzer
     

11 Dec, 2009

5 commits

  • 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
     
  • Minor code touch-up. We don't need the 'else'.

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

    Jon Brassow
     

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

3 commits

  • Fix some problems seen in the chunk size processing when activating a
    pre-existing snapshot.

    For a new snapshot, the chunk size can either be supplied by the creator
    or a default value can be used. For an existing snapshot, the
    chunk size in the snapshot header on disk should always be used.

    If someone attempts to load an existing snapshot and has the 'default
    chunk size' option set, the kernel uses its default value even when it
    is incorrect for the snapshot being loaded. This patch ensures the
    correct on-disk value is always used.

    Secondly, when the code does use the chunk size stored on the disk it is
    prudent to revalidate it, so the code can exit cleanly if it got
    corrupted as happened in
    https://bugzilla.redhat.com/show_bug.cgi?id=461506 .

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

    Mikulas Patocka
     
  • If a persistent snapshot fills up, a race can corrupt the on-disk header
    which causes a crash on any future attempt to activate the snapshot
    (typically while booting). This patch fixes the race.

    When the snapshot overflows, __invalidate_snapshot is called, which calls
    snapshot store method drop_snapshot. It goes to persistent_drop_snapshot that
    calls write_header. write_header constructs the new header in the "area"
    location.

    Concurrently, an existing kcopyd job may finish, call copy_callback
    and commit_exception method, that goes to persistent_commit_exception.
    persistent_commit_exception doesn't do locking, relying on the fact that
    callbacks are single-threaded, but it can race with snapshot invalidation and
    overwrite the header that is just being written while the snapshot is being
    invalidated.

    The result of this race is a corrupted header being written that can
    lead to a crash on further reactivation (if chunk_size is zero in the
    corrupted header).

    The fix is to use separate memory areas for each.

    See the bug: https://bugzilla.redhat.com/show_bug.cgi?id=461506

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

    Mikulas Patocka
     
  • Refactor chunk_io to prepare for the fix in the following patch.

    Pass an area pointer to chunk_io and simplify zero_disk_area to use
    chunk_io. No functional change.

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

    Mikulas Patocka
     

22 Jun, 2009

1 commit


23 May, 2009

1 commit

  • Until now we have had a 1:1 mapping between storage device physical
    block size and the logical block sized used when addressing the device.
    With SATA 4KB drives coming out that will no longer be the case. The
    sector size will be 4KB but the logical block size will remain
    512-bytes. Hence we need to distinguish between the physical block size
    and the logical ditto.

    This patch renames hardsect_size to logical_block_size.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

03 Apr, 2009

7 commits


06 Jan, 2009

2 commits