|
|
4eda52 |
From cf49a46c165619a0480d361a0afebb89e998f61c Mon Sep 17 00:00:00 2001
|
|
|
4295f9 |
From: Yu Watanabe <watanabe.yu+github@gmail.com>
|
|
|
4295f9 |
Date: Thu, 2 Sep 2021 06:58:59 +0900
|
|
|
4295f9 |
Subject: [PATCH] udev-node: assume no new claim to a symlink if
|
|
|
4295f9 |
/run/udev/links is not updated
|
|
|
4295f9 |
|
|
|
4295f9 |
During creating a symlink to a device node, if another device node which
|
|
|
4295f9 |
requests the same symlink is added/removed, `stat_inode_unmodified()`
|
|
|
4295f9 |
should always detects that. We do not need to continue the loop
|
|
|
4295f9 |
unconditionally.
|
|
|
4295f9 |
|
|
|
4295f9 |
(cherry picked from commit 8f27311eb2aec2411d1fb7d62e6c9d75d21ae8df)
|
|
|
4295f9 |
|
|
|
4eda52 |
Related: #2005024
|
|
|
4295f9 |
---
|
|
|
4295f9 |
src/udev/udev-node.c | 5 -----
|
|
|
4295f9 |
1 file changed, 5 deletions(-)
|
|
|
4295f9 |
|
|
|
4295f9 |
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
|
|
|
4295f9 |
index 0de848da19..1a34ea8128 100644
|
|
|
4295f9 |
--- a/src/udev/udev-node.c
|
|
|
4295f9 |
+++ b/src/udev/udev-node.c
|
|
|
4295f9 |
@@ -491,11 +491,6 @@ static int link_update(sd_device *dev, const char *slink_in, bool add) {
|
|
|
4295f9 |
r = node_symlink(dev, target, slink);
|
|
|
4295f9 |
if (r < 0)
|
|
|
4295f9 |
return r;
|
|
|
4295f9 |
- if (r == 1)
|
|
|
4295f9 |
- /* We have replaced already existing symlink, possibly there is some other device trying
|
|
|
4295f9 |
- * to claim the same symlink. Let's do one more iteration to give us a chance to fix
|
|
|
4295f9 |
- * the error if other device actually claims the symlink with higher priority. */
|
|
|
4295f9 |
- continue;
|
|
|
4295f9 |
|
|
|
4295f9 |
/* Skip the second stat() if the first failed, stat_inode_unmodified() would return false regardless. */
|
|
|
4295f9 |
if ((st1.st_mode & S_IFMT) != 0) {
|