* FAILED: patch "[PATCH] dm: add missing unlock on in dm_keyslot_evict()" failed to apply to 5.12-stable tree
@ 2025-05-09 8:10 gregkh
2025-05-12 12:36 ` [PATCH 5.12.y] dm: add missing unlock on in dm_keyslot_evict() Mikulas Patocka
0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2025-05-09 8:10 UTC (permalink / raw)
To: dan.carpenter, mpatocka; +Cc: stable
The patch below does not apply to the 5.12-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.12.y
git checkout FETCH_HEAD
git cherry-pick -x 650266ac4c7230c89bcd1307acf5c9c92cfa85e2
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2025050954-excretion-yonder-4e95@gregkh' --subject-prefix 'PATCH 5.12.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 650266ac4c7230c89bcd1307acf5c9c92cfa85e2 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@linaro.org>
Date: Wed, 30 Apr 2025 11:05:54 +0300
Subject: [PATCH] dm: add missing unlock on in dm_keyslot_evict()
We need to call dm_put_live_table() even if dm_get_live_table() returns
NULL.
Fixes: 9355a9eb21a5 ("dm: support key eviction from keyslot managers of underlying devices")
Cc: stable@vger.kernel.org # v5.12+
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 9e175c5e0634..31d67a1a91dd 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1173,7 +1173,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile,
t = dm_get_live_table(md, &srcu_idx);
if (!t)
- return 0;
+ goto put_live_table;
for (unsigned int i = 0; i < t->num_targets; i++) {
struct dm_target *ti = dm_table_get_target(t, i);
@@ -1184,6 +1184,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile,
(void *)key);
}
+put_live_table:
dm_put_live_table(md, srcu_idx);
return 0;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 5.12.y] dm: add missing unlock on in dm_keyslot_evict()
2025-05-09 8:10 FAILED: patch "[PATCH] dm: add missing unlock on in dm_keyslot_evict()" failed to apply to 5.12-stable tree gregkh
@ 2025-05-12 12:36 ` Mikulas Patocka
2025-05-20 11:27 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Mikulas Patocka @ 2025-05-12 12:36 UTC (permalink / raw)
To: gregkh; +Cc: dan.carpenter, stable
Hi
Here I'm submitting updated patch.
Mikulas
On Fri, 9 May 2025, gregkh@linuxfoundation.org wrote:
>
> The patch below does not apply to the 5.12-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
>
> To reproduce the conflict and resubmit, you may use the following commands:
>
> git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.12.y
> git checkout FETCH_HEAD
> git cherry-pick -x 650266ac4c7230c89bcd1307acf5c9c92cfa85e2
> # <resolve conflicts, build, test, etc.>
> git commit -s
> git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2025050954-excretion-yonder-4e95@gregkh' --subject-prefix 'PATCH 5.12.y' HEAD^..
>
> Possible dependencies:
>
>
>
> thanks,
>
> greg k-h
>
> ------------------ original commit in Linus's tree ------------------
>
> >From 650266ac4c7230c89bcd1307acf5c9c92cfa85e2 Mon Sep 17 00:00:00 2001
> From: Dan Carpenter <dan.carpenter@linaro.org>
> Date: Wed, 30 Apr 2025 11:05:54 +0300
> Subject: [PATCH] dm: add missing unlock on in dm_keyslot_evict()
>
> We need to call dm_put_live_table() even if dm_get_live_table() returns
> NULL.
>
> Fixes: 9355a9eb21a5 ("dm: support key eviction from keyslot managers of underlying devices")
> Cc: stable@vger.kernel.org # v5.12+
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
>
> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> index 9e175c5e0634..31d67a1a91dd 100644
> --- a/drivers/md/dm-table.c
> +++ b/drivers/md/dm-table.c
> @@ -1173,7 +1173,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile,
>
> t = dm_get_live_table(md, &srcu_idx);
> if (!t)
> - return 0;
> + goto put_live_table;
>
> for (unsigned int i = 0; i < t->num_targets; i++) {
> struct dm_target *ti = dm_table_get_target(t, i);
> @@ -1184,6 +1184,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile,
> (void *)key);
> }
>
> +put_live_table:
> dm_put_live_table(md, srcu_idx);
> return 0;
> }
>
We need to call dm_put_live_table() even if dm_get_live_table() returns
NULL.
Fixes: 9355a9eb21a5 ("dm: support key eviction from keyslot managers of underlying devices")
Cc: stable@vger.kernel.org # v5.12+
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
---
drivers/md/dm-table.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: linux-stable/drivers/md/dm-table.c
===================================================================
--- linux-stable.orig/drivers/md/dm-table.c
+++ linux-stable/drivers/md/dm-table.c
@@ -1251,13 +1251,14 @@ static int dm_keyslot_evict(struct blk_k
t = dm_get_live_table(md, &srcu_idx);
if (!t)
- return 0;
+ goto put_live_table;
for (i = 0; i < dm_table_get_num_targets(t); i++) {
ti = dm_table_get_target(t, i);
if (!ti->type->iterate_devices)
continue;
ti->type->iterate_devices(ti, dm_keyslot_evict_callback, &args);
}
+put_live_table:
dm_put_live_table(md, srcu_idx);
return args.err;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 5.12.y] dm: add missing unlock on in dm_keyslot_evict()
2025-05-12 12:36 ` [PATCH 5.12.y] dm: add missing unlock on in dm_keyslot_evict() Mikulas Patocka
@ 2025-05-20 11:27 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2025-05-20 11:27 UTC (permalink / raw)
To: Mikulas Patocka; +Cc: dan.carpenter, stable
On Mon, May 12, 2025 at 02:36:16PM +0200, Mikulas Patocka wrote:
> Hi
>
> Here I'm submitting updated patch.
>
> Mikulas
>
>
> On Fri, 9 May 2025, gregkh@linuxfoundation.org wrote:
>
> >
> > The patch below does not apply to the 5.12-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> >
> > To reproduce the conflict and resubmit, you may use the following commands:
> >
> > git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.12.y
> > git checkout FETCH_HEAD
> > git cherry-pick -x 650266ac4c7230c89bcd1307acf5c9c92cfa85e2
> > # <resolve conflicts, build, test, etc.>
> > git commit -s
> > git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2025050954-excretion-yonder-4e95@gregkh' --subject-prefix 'PATCH 5.12.y' HEAD^..
> >
> > Possible dependencies:
> >
> >
> >
> > thanks,
> >
> > greg k-h
> >
> > ------------------ original commit in Linus's tree ------------------
> >
> > >From 650266ac4c7230c89bcd1307acf5c9c92cfa85e2 Mon Sep 17 00:00:00 2001
> > From: Dan Carpenter <dan.carpenter@linaro.org>
> > Date: Wed, 30 Apr 2025 11:05:54 +0300
> > Subject: [PATCH] dm: add missing unlock on in dm_keyslot_evict()
> >
> > We need to call dm_put_live_table() even if dm_get_live_table() returns
> > NULL.
> >
> > Fixes: 9355a9eb21a5 ("dm: support key eviction from keyslot managers of underlying devices")
> > Cc: stable@vger.kernel.org # v5.12+
> > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> > Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> >
> > diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> > index 9e175c5e0634..31d67a1a91dd 100644
> > --- a/drivers/md/dm-table.c
> > +++ b/drivers/md/dm-table.c
> > @@ -1173,7 +1173,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile,
> >
> > t = dm_get_live_table(md, &srcu_idx);
> > if (!t)
> > - return 0;
> > + goto put_live_table;
> >
> > for (unsigned int i = 0; i < t->num_targets; i++) {
> > struct dm_target *ti = dm_table_get_target(t, i);
> > @@ -1184,6 +1184,7 @@ static int dm_keyslot_evict(struct blk_crypto_profile *profile,
> > (void *)key);
> > }
> >
> > +put_live_table:
> > dm_put_live_table(md, srcu_idx);
> > return 0;
> > }
> >
>
> We need to call dm_put_live_table() even if dm_get_live_table() returns
> NULL.
>
> Fixes: 9355a9eb21a5 ("dm: support key eviction from keyslot managers of underlying devices")
> Cc: stable@vger.kernel.org # v5.12+
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
>
> ---
> drivers/md/dm-table.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Index: linux-stable/drivers/md/dm-table.c
> ===================================================================
> --- linux-stable.orig/drivers/md/dm-table.c
> +++ linux-stable/drivers/md/dm-table.c
> @@ -1251,13 +1251,14 @@ static int dm_keyslot_evict(struct blk_k
>
> t = dm_get_live_table(md, &srcu_idx);
> if (!t)
> - return 0;
> + goto put_live_table;
> for (i = 0; i < dm_table_get_num_targets(t); i++) {
> ti = dm_table_get_target(t, i);
> if (!ti->type->iterate_devices)
> continue;
> ti->type->iterate_devices(ti, dm_keyslot_evict_callback, &args);
> }
> +put_live_table:
> dm_put_live_table(md, srcu_idx);
> return args.err;
> }
Sorry, I don't know why I said 5.12, this should be for 5.15, can you
fix it up and send a version for that tree?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-20 11:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-09 8:10 FAILED: patch "[PATCH] dm: add missing unlock on in dm_keyslot_evict()" failed to apply to 5.12-stable tree gregkh
2025-05-12 12:36 ` [PATCH 5.12.y] dm: add missing unlock on in dm_keyslot_evict() Mikulas Patocka
2025-05-20 11:27 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox