On Tue, Nov 4, 2025 at 2:16 PM Sasha Levin <sashal(a)kernel.org> wrote:
>
> This is a note to let you know that I've just added the patch titled
>
> rust: kunit: allow `cfg` on `test`s
>
> to the 6.17-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
>
> The filename of the patch is:
> rust-kunit-allow-cfg-on-test-s.patch
> and it can be found in the queue-6.17 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable(a)vger.kernel.org> know about it.
It probably doesn't hurt, but if we don't have any test that needs it,
then we could skip it, i.e. it is essentially a feature.
Thanks!
Cheers,
Miguel
From: Kent Overstreet <kent.overstreet(a)linux.dev>
commit 3f6d5e6a468d02676244b868b210433831846127 upstream.
Our proliferation of memalloc_*_{save,restore} APIs is getting a bit
silly, this adds a generic version and converts the existing
save/restore functions to wrappers.
Signed-off-by: Kent Overstreet <kent.overstreet(a)linux.dev>
Cc: Vlastimil Babka <vbabka(a)suse.cz>
Cc: Matthew Wilcox <willy(a)infradead.org>
Cc: Michal Hocko <mhocko(a)kernel.org>
Cc: Darrick J. Wong <djwong(a)kernel.org>
Cc: linux-mm(a)kvack.org
Acked-by: Vlastimil Babka <vbabka(a)suse.cz>
Signed-off-by: Long Li <leo.lilong(a)huawei.com>
---
We encountered a deadlock issue in our internal version caused by
PF_MEMALLOC_NOFS being unexpectedly cleared during inode inactive
transaction. This issue appears to still exist in 6.1/6.6 lts version.
In the mainline kernel, before commit [2] f2e812c1522d ("xfs: don't use
current->journal_info") was merged, we relied on current->journal_info to
check for transaction recursion. During transaction rollback/commit, only
the last transaction commit would call xfs_trans_clear_context(tp) to
restore the nofs flag, which worked correctly.
After this patch was merged, we no longer check for transaction recursion,
so each transaction rollback/commit calls xfs_trans_clear_context(tp) to
restore the nofs flag. At this point, tp->t_pflags is set to 0 (except for
the last one tp), and memalloc_nofs_restore(0) will not clear the
PF_MEMALLOC_NOFS flag during transaction rollback, this is also correct.
However, this also implies that the above patch depends on commit [1]
3f6d5e6a468d ("mm: introduce memalloc_flags_{save,restore}"), because that
patch modified the semantics of the memalloc_nofs_{save,restore} interface,
and only after this modification can it ensure that memalloc_nofs_restore(0)
won't clear the PF_MEMALLOC_NOFS flag.
In our 6.1/6.6 LTS versions, we directly backported commit [2] without
backporting commit [1], which leads to confusion with the PF_MEMALLOC_NOFS
flag during transaction rollback, for example as follows:
xfs_inodegc_worker
nofs_flag = memalloc_nofs_save();
//set PF_MEMALLOC_NOFS in current->flags
xfs_inactive
xfs_attr_inactive(ip)
xfs_trans_alloc(mp, &M_RES(mp)->tr_attrinval, 0, 0, 0, &trans)
xfs_trans_set_context(tp)
//tp->t_pflags ==> 1
xfs_trans_commit(trans)
__xfs_trans_commit(tp)
xfs_defer_trans_roll
xfs_trans_roll
*tpp = xfs_trans_dup(trans)
xfs_trans_switch_context(tp, ntp)
new_tp->t_pflags = old_tp->t_pflags;
//new_tp->t_pflags ==> 1
old_tp->t_pflags = 0;
//old_tp->t_pflags ==> 0
__xfs_trans_commit(trans) //commit old_tp
xfs_trans_free(tp); //free old_tp
xfs_trans_clear_context(tp)
memalloc_nofs_restore(0)
//clear PF_MEMALLOC_NOFS in current->flags
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
< commit new_tp >
xfs_trans_free(tp) //free new_tp
memalloc_nofs_restore(1)
//set PF_MEMALLOC_NOFS in current->flags
memalloc_nofs_restore(nofs_flag);
//clear PF_MEMALLOC_NOFS in current->flags
So backport commit [1] 3f6d5e6a468d ("mm: introduce memalloc_flags_{save,restore}")
to 6.1/6.6 lts.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
include/linux/sched/mm.h | 43 ++++++++++++++++++++++++----------------
1 file changed, 26 insertions(+), 17 deletions(-)
diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h
index 8d89c8c4fac1..10792d374785 100644
--- a/include/linux/sched/mm.h
+++ b/include/linux/sched/mm.h
@@ -306,6 +306,24 @@ static inline void might_alloc(gfp_t gfp_mask)
might_sleep_if(gfpflags_allow_blocking(gfp_mask));
}
+/**
+ * memalloc_flags_save - Add a PF_* flag to current->flags, save old value
+ *
+ * This allows PF_* flags to be conveniently added, irrespective of current
+ * value, and then the old version restored with memalloc_flags_restore().
+ */
+static inline unsigned memalloc_flags_save(unsigned flags)
+{
+ unsigned oldflags = ~current->flags & flags;
+ current->flags |= flags;
+ return oldflags;
+}
+
+static inline void memalloc_flags_restore(unsigned flags)
+{
+ current->flags &= ~flags;
+}
+
/**
* memalloc_noio_save - Marks implicit GFP_NOIO allocation scope.
*
@@ -319,9 +337,7 @@ static inline void might_alloc(gfp_t gfp_mask)
*/
static inline unsigned int memalloc_noio_save(void)
{
- unsigned int flags = current->flags & PF_MEMALLOC_NOIO;
- current->flags |= PF_MEMALLOC_NOIO;
- return flags;
+ return memalloc_flags_save(PF_MEMALLOC_NOIO);
}
/**
@@ -334,7 +350,7 @@ static inline unsigned int memalloc_noio_save(void)
*/
static inline void memalloc_noio_restore(unsigned int flags)
{
- current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags;
+ memalloc_flags_restore(flags);
}
/**
@@ -350,9 +366,7 @@ static inline void memalloc_noio_restore(unsigned int flags)
*/
static inline unsigned int memalloc_nofs_save(void)
{
- unsigned int flags = current->flags & PF_MEMALLOC_NOFS;
- current->flags |= PF_MEMALLOC_NOFS;
- return flags;
+ return memalloc_flags_save(PF_MEMALLOC_NOFS);
}
/**
@@ -365,32 +379,27 @@ static inline unsigned int memalloc_nofs_save(void)
*/
static inline void memalloc_nofs_restore(unsigned int flags)
{
- current->flags = (current->flags & ~PF_MEMALLOC_NOFS) | flags;
+ memalloc_flags_restore(flags);
}
static inline unsigned int memalloc_noreclaim_save(void)
{
- unsigned int flags = current->flags & PF_MEMALLOC;
- current->flags |= PF_MEMALLOC;
- return flags;
+ return memalloc_flags_save(PF_MEMALLOC);
}
static inline void memalloc_noreclaim_restore(unsigned int flags)
{
- current->flags = (current->flags & ~PF_MEMALLOC) | flags;
+ memalloc_flags_restore(flags);
}
static inline unsigned int memalloc_pin_save(void)
{
- unsigned int flags = current->flags & PF_MEMALLOC_PIN;
-
- current->flags |= PF_MEMALLOC_PIN;
- return flags;
+ return memalloc_flags_save(PF_MEMALLOC_PIN);
}
static inline void memalloc_pin_restore(unsigned int flags)
{
- current->flags = (current->flags & ~PF_MEMALLOC_PIN) | flags;
+ memalloc_flags_restore(flags);
}
#ifdef CONFIG_MEMCG
--
2.39.2
It looks like the execution permissions (+x) got lost during the
backports of these new files.
The issue is that some CIs don't execute these tests without that.
Fixes: 37848a456fc3 ("selftests: mptcp: connect: also cover alt modes")
Fixes: fdf0f60a2bb0 ("selftests: mptcp: connect: also cover checksum")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe(a)kernel.org>
---
I'm not sure why they got lost, maybe Quilt doesn't support that? But
then, can this patch still be applied?
The same patch can be applied up to v5.10. In v5.10, only
mptcp_connect_mmap.sh file is present, but I can send a dedicated patch
for v5.10.
---
tools/testing/selftests/net/mptcp/mptcp_connect_checksum.sh | 0
tools/testing/selftests/net/mptcp/mptcp_connect_mmap.sh | 0
tools/testing/selftests/net/mptcp/mptcp_connect_sendfile.sh | 0
3 files changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 tools/testing/selftests/net/mptcp/mptcp_connect_checksum.sh
mode change 100644 => 100755 tools/testing/selftests/net/mptcp/mptcp_connect_mmap.sh
mode change 100644 => 100755 tools/testing/selftests/net/mptcp/mptcp_connect_sendfile.sh
diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect_checksum.sh b/tools/testing/selftests/net/mptcp/mptcp_connect_checksum.sh
old mode 100644
new mode 100755
diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect_mmap.sh b/tools/testing/selftests/net/mptcp/mptcp_connect_mmap.sh
old mode 100644
new mode 100755
diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect_sendfile.sh b/tools/testing/selftests/net/mptcp/mptcp_connect_sendfile.sh
old mode 100644
new mode 100755
--
2.51.0
Make sure to drop the references taken to the vtg devices by
of_find_device_by_node() when looking up their driver data during
component probe.
Note that holding a reference to a platform device does not prevent its
driver data from going away so there is no point in keeping the
reference after the lookup helper returns.
Fixes: cc6b741c6f63 ("drm: sti: remove useless fields from vtg structure")
Cc: stable(a)vger.kernel.org # 4.16
Cc: Benjamin Gaignard <benjamin.gaignard(a)collabora.com>
Signed-off-by: Johan Hovold <johan(a)kernel.org>
---
drivers/gpu/drm/sti/sti_vtg.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sti/sti_vtg.c b/drivers/gpu/drm/sti/sti_vtg.c
index ee81691b3203..ce6bc7e7b135 100644
--- a/drivers/gpu/drm/sti/sti_vtg.c
+++ b/drivers/gpu/drm/sti/sti_vtg.c
@@ -143,12 +143,17 @@ struct sti_vtg {
struct sti_vtg *of_vtg_find(struct device_node *np)
{
struct platform_device *pdev;
+ struct sti_vtg *vtg;
pdev = of_find_device_by_node(np);
if (!pdev)
return NULL;
- return (struct sti_vtg *)platform_get_drvdata(pdev);
+ vtg = platform_get_drvdata(pdev);
+
+ put_device(&pdev->dev);
+
+ return vtg;
}
static void vtg_reset(struct sti_vtg *vtg)
--
2.49.1