Skip to contentSkip to conversation

udevd: queue-export - remove retry loop

PATCH In review Alan Jenkins 2 participants 2 messages Oct 29, 2009 – Oct 30, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udevd: queue-export - remove retry loop

These retry loops are required where create_path() could race with delete_path(). But only the main udevd process writes to the queue, so no races will happen here.

---
 libudev/libudev-queue-private.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)
libudev/libudev-queue-private.c +4 -11
index 37de67a..6109837 100644
@@ -396,7 +396,6 @@ static void update_failed(struct udev_queue_export *udev_queue_export,
 {
 	struct udev *udev = udev_device_get_udev(udev_device);
 	char filename[UTIL_PATH_SIZE];
-	int err;
 
 	if (state != DEVICE_FAILED && udev_queue_export->failed_count = 0)
 		return;
@@ -409,16 +408,10 @@ static void update_failed(struct udev_queue_export *udev_queue_export,
 	case DEVICE_FAILED:
 		/* record event in the failed directory */
 		udev_queue_export->failed_count++;
-		do {
-			err = util_create_path(udev, filename);
-			if (err != 0 && err != -ENOENT)
-				break;
-			udev_selinux_setfscreatecon(udev, filename, S_IFLNK);
-			err = symlink(udev_device_get_devpath(udev_device), filename);
-			if (err != 0)
-				err = -errno;
-			udev_selinux_resetfscreatecon(udev);
-		} while (err = -ENOENT);
+		util_create_path(udev, filename);
+		udev_selinux_setfscreatecon(udev, filename, S_IFLNK);
+		symlink(udev_device_get_devpath(udev_device), filename);
+		udev_selinux_resetfscreatecon(udev);
 		break;
 
 	case DEVICE_QUEUED:
Signature · 1 line
1.5.6.5
#1 lore raw
Quoted 3 lines · Alan Jenkins

These retry loops are required where create_path() could race with delete_path().  But only the main udevd process writes to the queue, so no races will happen here.

Ah, right. Applied.

Thanks,
Kay