The patch below does not apply to the 4.14-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(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 3d1cf435e201d1fd63e4346b141881aed086effd Mon Sep 17 00:00:00 2001
From: "Rafael J. Wysocki" <rafael.j.wysocki(a)intel.com>
Date: Fri, 15 Jan 2021 19:30:51 +0100
Subject: [PATCH] driver core: Extend device_is_dependent()
If the device passed as the target (second argument) to
device_is_dependent() is not completely registered (that is, it has
been initialized, but not added yet), but the parent pointer of it
is set, it may be missing from the list of the parent's children
and device_for_each_child() called by device_is_dependent() cannot
be relied on to catch that dependency.
For this reason, modify device_is_dependent() to check the ancestors
of the target device by following its parent pointer in addition to
the device_for_each_child() walk.
Fixes: 9ed9895370ae ("driver core: Functional dependencies tracking support")
Reported-by: Stephan Gerhold <stephan(a)gerhold.net>
Tested-by: Stephan Gerhold <stephan(a)gerhold.net>
Reviewed-by: Saravana Kannan <saravanak(a)google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>
Link: https://lore.kernel.org/r/17705994.d592GUb2YH@kreacher
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 25e08e5f40bd..3819fd012e27 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -208,6 +208,16 @@ int device_links_read_lock_held(void)
#endif
#endif /* !CONFIG_SRCU */
+static bool device_is_ancestor(struct device *dev, struct device *target)
+{
+ while (target->parent) {
+ target = target->parent;
+ if (dev == target)
+ return true;
+ }
+ return false;
+}
+
/**
* device_is_dependent - Check if one device depends on another one
* @dev: Device to check dependencies for.
@@ -221,7 +231,12 @@ int device_is_dependent(struct device *dev, void *target)
struct device_link *link;
int ret;
- if (dev == target)
+ /*
+ * The "ancestors" check is needed to catch the case when the target
+ * device has not been completely initialized yet and it is still
+ * missing from the list of children of its parent device.
+ */
+ if (dev == target || device_is_ancestor(dev, target))
return 1;
ret = device_for_each_child(dev, target, device_is_dependent);
Hi,
please apply the following commits to 5.4.x tree. They're fixing a problem with
a long running transaction and there are users that have hit that. Other users
from the community have been using the patches on 5.4 base so they can be
considered tested.
All apply cleanly on top of current 5.4 tree. Thanks.
7ac8b88ee668a5b4743ebf3e9888fabac85c334a
ed58f2e66e849c34826083e5a6c1b506ee8a4d8e
cfc0eed0ec89db7c4a8d461174cabfaa4a0912c7
b25b0b871f206936d5bca02b80d38c05623e27da
Short ids with subjects:
7ac8b88ee668 ("btrfs: backref, only collect file extent items matching backref offset")
ed58f2e66e84 ("btrfs: backref, don't add refs from shared block when resolving normal backref")
cfc0eed0ec89 ("btrfs: backref, only search backref entries from leaves of the same root")
b25b0b871f20 ("btrfs: backref, use correct count to resolve normal data refs")
Hi Greg and Sasha,
Please apply commit 28187dc8ebd9 ("ARM: 9025/1: Kconfig: CPU_BIG_ENDIAN
depends on !LD_IS_LLD") to linux-5.10.y, as it fixes a series of errors
that are seen with ARCH=arm LLVM=1 all{mod,yes}config. CONFIG_LD_IS_LLD
was introduced in 5.8 so it currently does not need to go back farther
than 5.10.
Cheers,
Nathan
Hi,
this upstream patch 7f2923c4f73f21cfd714d12a2d48de8c21f11cfe, should
also be applied to 4.19.
The other patch of this series (sysctl: handle overflow for file-max)
was already applied.
This was found by ltp test (sysctl02).
Thanks,
Joerg