linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] udevd: queue-export - remove retry loop
@ 2009-10-29 18:02 Alan Jenkins
  2009-10-30 11:40 ` Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Jenkins @ 2009-10-29 18:02 UTC (permalink / raw)
  To: linux-hotplug

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.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
---
 libudev/libudev-queue-private.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/libudev/libudev-queue-private.c b/libudev/libudev-queue-private.c
index 37de67a..6109837 100644
--- a/libudev/libudev-queue-private.c
+++ b/libudev/libudev-queue-private.c
@@ -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:
-- 
1.5.6.5




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] udevd: queue-export - remove retry loop
  2009-10-29 18:02 [PATCH] udevd: queue-export - remove retry loop Alan Jenkins
@ 2009-10-30 11:40 ` Kay Sievers
  0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2009-10-30 11:40 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Oct 29, 2009 at 19:02, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-30 11:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-29 18:02 [PATCH] udevd: queue-export - remove retry loop Alan Jenkins
2009-10-30 11:40 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).