Commit d632ab86 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-6.17/dm-changes' of...

Merge tag 'for-6.17/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm

Pull device mapper updates from Mikulas Patocka:

 - fix checking for request-based stackable devices (dm-table)

 - fix corrupt_bio_byte setup checks (dm-flakey)

 - add support for resync w/o metadata devices (dm raid)

 - small code simplification (dm, dm-mpath, vm-vdo, dm-raid)

 - remove support for asynchronous hashes (dm-verity)

 - close smatch warning (dm-zoned-target)

 - update the documentation and enable inline-crypto passthrough
   (dm-thin)

* tag 'for-6.17/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm: set DM_TARGET_PASSES_CRYPTO feature for dm-thin
  dm-thin: update the documentation
  dm-raid: do not include dm-core.h
  vdo: omit need_resched() before cond_resched()
  md: dm-zoned-target: Initialize return variable r to avoid uninitialized use
  dm-verity: remove support for asynchronous hashes
  dm-mpath: don't print the "loaded" message if registering fails
  dm-mpath: make dm_unregister_path_selector return void
  dm: ima: avoid extra calls to strlen()
  dm: Simplify dm_io_complete()
  dm: Remove unnecessary return in dm_zone_endio()
  dm raid: add support for resync w/o metadata devices
  dm-flakey: Fix corrupt_bio_byte setup checks
  dm-table: fix checking for rq stackable devices
parents 69917dbf 55a0fbd2
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -80,11 +80,11 @@ less sharing than average you'll need a larger-than-average metadata device.

As a guide, we suggest you calculate the number of bytes to use in the
metadata device as 48 * $data_dev_size / $data_block_size but round it up
to 2MB if the answer is smaller.  If you're creating large numbers of
to 2MiB if the answer is smaller.  If you're creating large numbers of
snapshots which are recording large amounts of change, you may find you
need to increase this.

The largest size supported is 16GB: If the device is larger,
The largest size supported is 16GiB: If the device is larger,
a warning will be issued and the excess space will not be used.

Reloading a pool table
@@ -107,13 +107,13 @@ Using an existing pool device

$data_block_size gives the smallest unit of disk space that can be
allocated at a time expressed in units of 512-byte sectors.
$data_block_size must be between 128 (64KB) and 2097152 (1GB) and a
multiple of 128 (64KB).  $data_block_size cannot be changed after the
$data_block_size must be between 128 (64KiB) and 2097152 (1GiB) and a
multiple of 128 (64KiB).  $data_block_size cannot be changed after the
thin-pool is created.  People primarily interested in thin provisioning
may want to use a value such as 1024 (512KB).  People doing lots of
snapshotting may want a smaller value such as 128 (64KB).  If you are
may want to use a value such as 1024 (512KiB).  People doing lots of
snapshotting may want a smaller value such as 128 (64KiB).  If you are
not zeroing newly-allocated data, a larger $data_block_size in the
region of 256000 (128MB) is suggested.
region of 262144 (128MiB) is suggested.

$low_water_mark is expressed in blocks of size $data_block_size.  If
free space on the data device drops below this level then a dm event
@@ -291,7 +291,7 @@ i) Constructor
      error_if_no_space:
	Error IOs, instead of queueing, if no space.

    Data block size must be between 64KB (128 sectors) and 1GB
    Data block size must be between 64KiB (128 sectors) and 1GiB
    (2097152 sectors) inclusive.


+6 −3
Original line number Diff line number Diff line
@@ -215,16 +215,19 @@ static int parse_features(struct dm_arg_set *as, struct flakey_c *fc,
	}

	if (test_bit(DROP_WRITES, &fc->flags) &&
	    (fc->corrupt_bio_rw == WRITE || fc->random_write_corrupt)) {
	    ((fc->corrupt_bio_byte && fc->corrupt_bio_rw == WRITE) ||
	     fc->random_write_corrupt)) {
		ti->error = "drop_writes is incompatible with random_write_corrupt or corrupt_bio_byte with the WRITE flag set";
		return -EINVAL;

	} else if (test_bit(ERROR_WRITES, &fc->flags) &&
		   (fc->corrupt_bio_rw == WRITE || fc->random_write_corrupt)) {
		   ((fc->corrupt_bio_byte && fc->corrupt_bio_rw == WRITE) ||
		    fc->random_write_corrupt)) {
		ti->error = "error_writes is incompatible with random_write_corrupt or corrupt_bio_byte with the WRITE flag set";
		return -EINVAL;
	} else if (test_bit(ERROR_READS, &fc->flags) &&
		   (fc->corrupt_bio_rw == READ || fc->random_read_corrupt)) {
		   ((fc->corrupt_bio_byte && fc->corrupt_bio_rw == READ) ||
		    fc->random_read_corrupt)) {
		ti->error = "error_reads is incompatible with random_read_corrupt or corrupt_bio_byte with the READ flag set";
		return -EINVAL;
	}
+19 −23
Original line number Diff line number Diff line
@@ -241,10 +241,11 @@ void dm_ima_measure_on_table_load(struct dm_table *table, unsigned int status_fl
		/*
		 * First retrieve the target metadata.
		 */
		scnprintf(target_metadata_buf, DM_IMA_TARGET_METADATA_BUF_LEN,
		target_metadata_buf_len =
			scnprintf(target_metadata_buf,
				  DM_IMA_TARGET_METADATA_BUF_LEN,
				  "target_index=%d,target_begin=%llu,target_len=%llu,",
				  i, ti->begin, ti->len);
		target_metadata_buf_len = strlen(target_metadata_buf);

		/*
		 * Then retrieve the actual target data.
@@ -448,11 +449,9 @@ void dm_ima_measure_on_device_resume(struct mapped_device *md, bool swap)
		if (r)
			goto error;

		scnprintf(device_table_data, DM_IMA_DEVICE_BUF_LEN,
		l = scnprintf(device_table_data, DM_IMA_DEVICE_BUF_LEN,
			      "%sname=%s,uuid=%s;device_resume=no_data;",
			      DM_IMA_VERSION_STR, dev_name, dev_uuid);
		l = strlen(device_table_data);

	}

	capacity_len = strlen(capacity_str);
@@ -561,10 +560,9 @@ void dm_ima_measure_on_device_remove(struct mapped_device *md, bool remove_all)
		if (dm_ima_alloc_and_copy_name_uuid(md, &dev_name, &dev_uuid, noio))
			goto error;

		scnprintf(device_table_data, DM_IMA_DEVICE_BUF_LEN,
		l = scnprintf(device_table_data, DM_IMA_DEVICE_BUF_LEN,
			      "%sname=%s,uuid=%s;device_remove=no_data;",
			      DM_IMA_VERSION_STR, dev_name, dev_uuid);
		l = strlen(device_table_data);
	}

	memcpy(device_table_data + l, remove_all_str, remove_all_len);
@@ -647,10 +645,9 @@ void dm_ima_measure_on_table_clear(struct mapped_device *md, bool new_map)
		if (dm_ima_alloc_and_copy_name_uuid(md, &dev_name, &dev_uuid, noio))
			goto error2;

		scnprintf(device_table_data, DM_IMA_DEVICE_BUF_LEN,
		l = scnprintf(device_table_data, DM_IMA_DEVICE_BUF_LEN,
			      "%sname=%s,uuid=%s;table_clear=no_data;",
			      DM_IMA_VERSION_STR, dev_name, dev_uuid);
		l = strlen(device_table_data);
	}

	capacity_len = strlen(capacity_str);
@@ -706,7 +703,7 @@ void dm_ima_measure_on_device_rename(struct mapped_device *md)
	char *old_device_data = NULL, *new_device_data = NULL, *combined_device_data = NULL;
	char *new_dev_name = NULL, *new_dev_uuid = NULL, *capacity_str = NULL;
	bool noio = true;
	int r;
	int r, len;

	if (dm_ima_alloc_and_copy_device_data(md, &new_device_data,
					      md->ima.active_table.num_targets, noio))
@@ -728,12 +725,11 @@ void dm_ima_measure_on_device_rename(struct mapped_device *md)
	md->ima.active_table.device_metadata = new_device_data;
	md->ima.active_table.device_metadata_len = strlen(new_device_data);

	scnprintf(combined_device_data, DM_IMA_DEVICE_BUF_LEN * 2,
	len = scnprintf(combined_device_data, DM_IMA_DEVICE_BUF_LEN * 2,
			"%s%snew_name=%s,new_uuid=%s;%s", DM_IMA_VERSION_STR, old_device_data,
			new_dev_name, new_dev_uuid, capacity_str);

	dm_ima_measure_data("dm_device_rename", combined_device_data, strlen(combined_device_data),
			    noio);
	dm_ima_measure_data("dm_device_rename", combined_device_data, len, noio);

	goto exit;

+3 −5
Original line number Diff line number Diff line
@@ -117,16 +117,16 @@ int dm_register_path_selector(struct path_selector_type *pst)
}
EXPORT_SYMBOL_GPL(dm_register_path_selector);

int dm_unregister_path_selector(struct path_selector_type *pst)
void dm_unregister_path_selector(struct path_selector_type *pst)
{
	struct ps_internal *psi;

	down_write(&_ps_lock);

	psi = __find_path_selector_type(pst->name);
	if (!psi) {
	if (WARN_ON(!psi)) {
		up_write(&_ps_lock);
		return -EINVAL;
		return;
	}

	list_del(&psi->list);
@@ -134,7 +134,5 @@ int dm_unregister_path_selector(struct path_selector_type *pst)
	up_write(&_ps_lock);

	kfree(psi);

	return 0;
}
EXPORT_SYMBOL_GPL(dm_unregister_path_selector);
+1 −1
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ struct path_selector_type {
int dm_register_path_selector(struct path_selector_type *type);

/* Unregister a path selector */
int dm_unregister_path_selector(struct path_selector_type *type);
void dm_unregister_path_selector(struct path_selector_type *type);

/* Returns a registered path selector type */
struct path_selector_type *dm_get_path_selector(const char *name);
Loading