Skip to contentSkip to conversation

of: overlay: do not break notify on NOTIFY_{OK|STOP}

PATCH Applied Nuno Sá 3 participants 3 messages Apr 20, 2022 Device tree

lore
Share & tools
lore

Nuno Sá

author
#0 lore raw

PATCH v2 1/1 of: overlay: do not break notify on NOTIFY_{OK|STOP}

We should not break overlay notifications on NOTIFY_{OK|STOP} otherwise we might break on the first fragment. We should only stop notifications if a *real* errno is returned by one of the listeners.

Fixes a1d19bd4cf1fe ("of: overlay: pr_err from return NOTIFY_OK to overlay apply/remove")

---
v2:
* Only break fragment notification in case errno is returned from
notifier;
* Massaged commit message accordingly.

 drivers/of/overlay.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/of/overlay.c +1 -3
index d80160cf34bb..d1187123c4fc 100644
@@ -170,9 +170,7 @@ static int overlay_notify(struct overlay_changeset *ovcs,
 
 		ret = blocking_notifier_call_chain(&overlay_notify_chain,
 						   action, &nd);
-		if (ret == NOTIFY_OK || ret == NOTIFY_STOP)
-			return 0;
-		if (ret) {
+		if (notifier_to_errno(ret)) {
 			ret = notifier_to_errno(ret);
 			pr_err("overlay changeset %s notifier error %d, target: %pOF\n",
 			       of_overlay_action_name[action], ret, nd.target);
Signature · 1 line
2.35.1
maintainer Applied
#1 lore raw
Quoted 6 lines · Nuno Sá

We should not break overlay notifications on NOTIFY_{OK|STOP} otherwise we might break on the first fragment. We should only stop notifications if a *real* errno is returned by one of the listeners.

Fixes a1d19bd4cf1fe ("of: overlay: pr_err from return NOTIFY_OK to overlay apply/remove")
Quoted 9 lines

---
v2:
* Only break fragment notification in case errno is returned from
notifier;
* Massaged commit message accordingly.

 drivers/of/overlay.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Applied, thanks!

#2 lore raw
In reply to Nuno Sá
Quoted 6 lines · Nuno Sá

We should not break overlay notifications on NOTIFY_{OK|STOP} otherwise we might break on the first fragment. We should only stop notifications if a *real* errno is returned by one of the listeners.

Fixes a1d19bd4cf1fe ("of: overlay: pr_err from return NOTIFY_OK to overlay apply/remove")

Thank you.

-Frank

Quoted 24 lines

---
v2:
* Only break fragment notification in case errno is returned from
notifier;
* Massaged commit message accordingly.

 drivers/of/overlay.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/of/overlay.c +1 -3
index d80160cf34bb..d1187123c4fc 100644
@@ -170,9 +170,7 @@ static int overlay_notify(struct overlay_changeset *ovcs,
 
 		ret = blocking_notifier_call_chain(&overlay_notify_chain,
 						   action, &nd);
-		if (ret == NOTIFY_OK || ret == NOTIFY_STOP)
-			return 0;
-		if (ret) {
+		if (notifier_to_errno(ret)) {
 			ret = notifier_to_errno(ret);
 			pr_err("overlay changeset %s notifier error %d, target: %pOF\n",
 			       of_overlay_action_name[action], ret, nd.target);