Commit 78109c59 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-6.15/dm-fixes' of...

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

Pull device mapper fixes from Mikulas Patocka:

 - always update the array size in realloc_argv on success

 - dm-integrity: fix a warning on invalid table line

 - dm-bufio: don't schedule in atomic context

 - Fix W=1 build with clang

* tag 'for-6.15/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm: always update the array size in realloc_argv on success
  dm-integrity: fix a warning on invalid table line
  dm-bufio: don't schedule in atomic context
  dm table: Fix W=1 build warning when mempool_needs_integrity is unused
parents f15d97df 5a2a6c42
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@
#define LIST_DIRTY	1
#define LIST_SIZE	2

#define SCAN_RESCHED_CYCLE	16

/*--------------------------------------------------------------*/

/*
@@ -2424,7 +2426,12 @@ static void __scan(struct dm_bufio_client *c)

			atomic_long_dec(&c->need_shrink);
			freed++;

			if (unlikely(freed % SCAN_RESCHED_CYCLE == 0)) {
				dm_bufio_unlock(c);
				cond_resched();
				dm_bufio_lock(c);
			}
		}
	}
}
+1 −1
Original line number Diff line number Diff line
@@ -5164,7 +5164,7 @@ static void dm_integrity_dtr(struct dm_target *ti)
	BUG_ON(!RB_EMPTY_ROOT(&ic->in_progress));
	BUG_ON(!list_empty(&ic->wait_list));

	if (ic->mode == 'B')
	if (ic->mode == 'B' && ic->bitmap_flush_work.work.func)
		cancel_delayed_work_sync(&ic->bitmap_flush_work);
	if (ic->metadata_wq)
		destroy_workqueue(ic->metadata_wq);
+3 −5
Original line number Diff line number Diff line
@@ -523,9 +523,10 @@ static char **realloc_argv(unsigned int *size, char **old_argv)
		gfp = GFP_NOIO;
	}
	argv = kmalloc_array(new_size, sizeof(*argv), gfp);
	if (argv && old_argv) {
		memcpy(argv, old_argv, *size * sizeof(*argv));
	if (argv) {
		*size = new_size;
		if (old_argv)
			memcpy(argv, old_argv, *size * sizeof(*argv));
	}

	kfree(old_argv);
@@ -1049,7 +1050,6 @@ static int dm_table_alloc_md_mempools(struct dm_table *t, struct mapped_device *
	unsigned int min_pool_size = 0, pool_size;
	struct dm_md_mempools *pools;
	unsigned int bioset_flags = 0;
	bool mempool_needs_integrity = t->integrity_supported;

	if (unlikely(type == DM_TYPE_NONE)) {
		DMERR("no table type is set, can't allocate mempools");
@@ -1074,8 +1074,6 @@ static int dm_table_alloc_md_mempools(struct dm_table *t, struct mapped_device *

		per_io_data_size = max(per_io_data_size, ti->per_io_data_size);
		min_pool_size = max(min_pool_size, ti->num_flush_bios);

		mempool_needs_integrity |= ti->mempool_needs_integrity;
	}
	pool_size = max(dm_get_reserved_bio_based_ios(), min_pool_size);
	front_pad = roundup(per_io_data_size,