]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
dm mpath: make pg_init_delay_msecs settable
authorBenjamin Marzinski <bmarzins@redhat.com>
Wed, 28 Jan 2026 00:12:24 +0000 (19:12 -0500)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:21:18 +0000 (07:21 -0500)
[ Upstream commit 218b16992a37ea97b9e09b7659a25a864fb9976f ]

"pg_init_delay_msecs X" can be passed as a feature in the multipath
table and is used to set m->pg_init_delay_msecs in parse_features().
However, alloc_multipath_stage2(), which is called after
parse_features(), resets m->pg_init_delay_msecs to its default value.
Instead, set m->pg_init_delay_msecs in alloc_multipath(), which is
called before parse_features(), to avoid overwriting a value passed in
by the table.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/dm-mpath.c

index aaf4a0a4b0ebb66fb5f2427d1f504c9a1b11502e..7d3fdd96f4edfcdacd07983db6cd1113295c71d4 100644 (file)
@@ -225,6 +225,7 @@ static struct multipath *alloc_multipath(struct dm_target *ti)
                mutex_init(&m->work_mutex);
 
                m->queue_mode = DM_TYPE_NONE;
+               m->pg_init_delay_msecs = DM_PG_INIT_DELAY_DEFAULT;
 
                m->ti = ti;
                ti->private = m;
@@ -257,7 +258,6 @@ static int alloc_multipath_stage2(struct dm_target *ti, struct multipath *m)
        set_bit(MPATHF_QUEUE_IO, &m->flags);
        atomic_set(&m->pg_init_in_progress, 0);
        atomic_set(&m->pg_init_count, 0);
-       m->pg_init_delay_msecs = DM_PG_INIT_DELAY_DEFAULT;
        init_waitqueue_head(&m->pg_init_wait);
        init_waitqueue_head(&m->probe_wait);