From dc11d2bf6602558770e61f772d925ba8dcc71233 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Mon, 18 Nov 2019 18:47:16 +0900
Subject: [PATCH 0650/1760] udevadm: ignore EROFS and return earlier

Fixes #14060.
Reference: https://github.com/systemd/systemd/commit/dc11d2bf6602558770e61f772d925ba8dcc71233
Conflict: NA
---
 src/udev/udevadm-trigger.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c
index 11f2f1c..60c68b5 100644
--- a/src/udev/udevadm-trigger.c
+++ b/src/udev/udevadm-trigger.c
@@ -45,10 +45,13 @@ static int exec_list(sd_device_enumerator *e, const char *action, Set *settle_se
 
                 r = write_string_file(filename, action, WRITE_STRING_FILE_DISABLE_BUFFER);
                 if (r < 0) {
-                        bool ignore = IN_SET(r, -ENOENT, -EACCES, -ENODEV);
+                        bool ignore = IN_SET(r, -ENOENT, -EACCES, -ENODEV, -EROFS);
 
                         log_full_errno(ignore ? LOG_DEBUG : LOG_ERR, r,
-                                       "Failed to write '%s' to '%s': %m", action, filename);
+                                       "Failed to write '%s' to '%s'%s: %m",
+                                       action, filename, ignore ? ", ignoring" : "");
+                        if (r == -EROFS)
+                                return 0; /* Read only filesystem. Return earlier. */
                         if (ret == 0 && !ignore)
                                 ret = r;
                         continue;
-- 
1.8.3.1

