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

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

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

Pull device mapper updates from Mike Snitzer:

 - Add DM infrastructure for IMA-based remote attestion. These changes
   are the basis for deploying DM-based storage in a "cloud" that must
   validate configurations end-users run to maintain trust. These DM
   changes allow supported DM targets' configurations to be measured via
   IMA. But the policy and enforcement (of which configurations are
   valid) is managed by something outside the kernel (e.g. Keylime).

 - Fix DM crypt scalability regression on systems with many cpus due to
   percpu_counter spinlock contention in crypt_page_alloc().

 - Use in_hardirq() instead of deprecated in_irq() in DM crypt.

 - Add event counters to DM writecache to allow users to further assess
   how the writecache is performing.

 - Various code cleanup in DM writecache's main IO mapping function.

* tag 'for-5.15/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm crypt: use in_hardirq() instead of deprecated in_irq()
  dm ima: update dm documentation for ima measurement support
  dm ima: update dm target attributes for ima measurements
  dm ima: add a warning in dm_init if duplicate ima events are not measured
  dm ima: prefix ima event name related to device mapper with dm_
  dm ima: add version info to dm related events in ima log
  dm ima: prefix dm table hashes in ima log with hash algorithm
  dm crypt: Avoid percpu_counter spinlock contention in crypt_page_alloc()
  dm: add documentation for IMA measurement support
  dm: update target status functions to support IMA measurement
  dm ima: measure data on device rename
  dm ima: measure data on table clear
  dm ima: measure data on device remove
  dm ima: measure data on device resume
  dm ima: measure data on table load
  dm writecache: add event counters
  dm writecache: report invalid return from writecache_map helpers
  dm writecache: further writecache_map() cleanup
  dm writecache: factor out writecache_map_remap_origin()
  dm writecache: split up writecache_map() to improve code readability
parents a998a62b d3703ef3
Loading
Loading
Loading
Loading
+715 −0

File added.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ Device Mapper
    dm-dust
    dm-ebs
    dm-flakey
    dm-ima
    dm-init
    dm-integrity
    dm-io
+14 −2
Original line number Diff line number Diff line
@@ -78,13 +78,23 @@ Status:
2. the number of blocks
3. the number of free blocks
4. the number of blocks under writeback
5. the number of read requests
6. the number of read requests that hit the cache
7. the number of write requests
8. the number of write requests that hit uncommitted block
9. the number of write requests that hit committed block
10. the number of write requests that bypass the cache
11. the number of write requests that are allocated in the cache
12. the number of write requests that are blocked on the freelist
13. the number of flush requests
14. the number of discard requests

Messages:
	flush
		flush the cache device. The message returns successfully
		Flush the cache device. The message returns successfully
		if the cache device was flushed without an error
	flush_on_suspend
		flush the cache device on next suspend. Use this message
		Flush the cache device on next suspend. Use this message
		when you are going to remove the cache device. The proper
		sequence for removing the cache device is:

@@ -98,3 +108,5 @@ Messages:
		6. the cache device is now inactive and it can be deleted
	cleaner
		See above "cleaner" constructor documentation.
	clear_stats
		Clear the statistics that are reported on the status line
+4 −0
Original line number Diff line number Diff line
@@ -96,6 +96,10 @@ ifeq ($(CONFIG_BLK_DEV_ZONED),y)
dm-mod-objs			+= dm-zone.o
endif

ifeq ($(CONFIG_IMA),y)
dm-mod-objs			+= dm-ima.o
endif

ifeq ($(CONFIG_DM_VERITY_FEC),y)
dm-verity-objs			+= dm-verity-fec.o
endif
+24 −0
Original line number Diff line number Diff line
@@ -3122,6 +3122,30 @@ static void cache_status(struct dm_target *ti, status_type_t type,
			DMEMIT(" %s", cache->ctr_args[i]);
		if (cache->nr_ctr_args)
			DMEMIT(" %s", cache->ctr_args[cache->nr_ctr_args - 1]);
		break;

	case STATUSTYPE_IMA:
		DMEMIT_TARGET_NAME_VERSION(ti->type);
		if (get_cache_mode(cache) == CM_FAIL)
			DMEMIT(",metadata_mode=fail");
		else if (get_cache_mode(cache) == CM_READ_ONLY)
			DMEMIT(",metadata_mode=ro");
		else
			DMEMIT(",metadata_mode=rw");

		format_dev_t(buf, cache->metadata_dev->bdev->bd_dev);
		DMEMIT(",cache_metadata_device=%s", buf);
		format_dev_t(buf, cache->cache_dev->bdev->bd_dev);
		DMEMIT(",cache_device=%s", buf);
		format_dev_t(buf, cache->origin_dev->bdev->bd_dev);
		DMEMIT(",cache_origin_device=%s", buf);
		DMEMIT(",writethrough=%c", writethrough_mode(cache) ? 'y' : 'n');
		DMEMIT(",writeback=%c", writeback_mode(cache) ? 'y' : 'n');
		DMEMIT(",passthrough=%c", passthrough_mode(cache) ? 'y' : 'n');
		DMEMIT(",metadata2=%c", cache->features.metadata_version == 2 ? 'y' : 'n');
		DMEMIT(",no_discard_passdown=%c", cache->features.discard_passdown ? 'n' : 'y');
		DMEMIT(";");
		break;
	}

	return;
Loading