linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* WAIT_FOR_SYSFS ignores further conditions
@ 2006-01-29 12:00 Andrey Borzenkov
  2006-01-30 16:37 ` Andrey Borzenkov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrey Borzenkov @ 2006-01-29 12:00 UTC (permalink / raw)
  To: linux-hotplug


[-- Attachment #1.1: Type: text/plain, Size: 84 bytes --]

Is it intentional? It looks rather like copy'n'paste slip. Patch attached.

-andrey

[-- Attachment #1.2: wait_for_sysfs_ignores_other_conditions.diff --]
[-- Type: text/x-diff, Size: 1181 bytes --]

Subject: [PATCH] WAIT_FOR_SYSFS was ignoring other conditions, notably SYSFS

From: Andrey Borzenkov <arvidjaar@mail.ru>



Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
---

 udev_rules.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/udev_rules.c b/udev_rules.c
index f1bbfd8..dac6b43 100644
--- a/udev_rules.c
+++ b/udev_rules.c
@@ -736,16 +736,14 @@ static int match_rule(struct udevice *ud
 		int match;
 
 		match = (wait_for_sysfs(udev, key_val(rule, &rule->wait_for_sysfs), 3) == 0);
-		if (match && (rule->wait_for_sysfs.operation != KEY_OP_NOMATCH)) {
+		if (match && (rule->wait_for_sysfs.operation == KEY_OP_MATCH))
 			dbg("WAIT_FOR_SYSFS is true (matching value)");
-			return 0;
-		}
-		if (!match && (rule->wait_for_sysfs.operation == KEY_OP_NOMATCH)) {
+		else if (!match && (rule->wait_for_sysfs.operation == KEY_OP_NOMATCH))
 			dbg("WAIT_FOR_SYSFS is true, (non matching value)");
-			return 0;
+		else {
+			dbg("WAIT_FOR_SYSFS is false");
+			goto nomatch;
 		}
-		dbg("WAIT_FOR_SYSFS is false");
-		return -1;
 	}
 
 	/* walk up the chain of parent devices and find a match */

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: WAIT_FOR_SYSFS ignores further conditions
  2006-01-29 12:00 WAIT_FOR_SYSFS ignores further conditions Andrey Borzenkov
@ 2006-01-30 16:37 ` Andrey Borzenkov
  2006-01-31 14:30 ` Kay Sievers
  2006-02-03 13:05 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Andrey Borzenkov @ 2006-01-30 16:37 UTC (permalink / raw)
  To: linux-hotplug

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 29 January 2006 15:00, Andrey Borzenkov wrote:
> Is it intentional? It looks rather like copy'n'paste slip. Patch attached.
>

This actually fixed a real bug here (every rule having WAIT_FOR_SYSFS was 
executed, not the one with mathing SYSFS value); so if there is something 
wrong with this patch I appreciate if someone explains what.

Regards

Andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD3kCsR6LMutpd94wRArBxAJ9ogrCvDa2UnJ59tQEKJmt6tbPdmACfWs0t
dShZZrwqWacRdZHx1X1wBB8=u8N2
-----END PGP SIGNATURE-----


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: WAIT_FOR_SYSFS ignores further conditions
  2006-01-29 12:00 WAIT_FOR_SYSFS ignores further conditions Andrey Borzenkov
  2006-01-30 16:37 ` Andrey Borzenkov
@ 2006-01-31 14:30 ` Kay Sievers
  2006-02-03 13:05 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2006-01-31 14:30 UTC (permalink / raw)
  To: linux-hotplug

On Mon, Jan 30, 2006 at 07:37:00PM +0300, Andrey Borzenkov wrote:
> On Sunday 29 January 2006 15:00, Andrey Borzenkov wrote:
> > Is it intentional? It looks rather like copy'n'paste slip. Patch attached.
> 
> This actually fixed a real bug here (every rule having WAIT_FOR_SYSFS was 
> executed, not the one with mathing SYSFS value); so if there is something 
> wrong with this patch I appreciate if someone explains what.

Correct, it doesn't work the way you use it and it should be fixed. I'll go
look into this later this week.

(WAIT_FOR_SYSFS is a hack, that should be used only in the first rules file
udev finds and better not do any other function than ensuring that all
the later rules can be sure that a file will be there or will not appear
at all. Just don't use it in "real" rules, only in separate fixup rules at
the beginning of the rule processing.)

Kay


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

* Re: WAIT_FOR_SYSFS ignores further conditions
  2006-01-29 12:00 WAIT_FOR_SYSFS ignores further conditions Andrey Borzenkov
  2006-01-30 16:37 ` Andrey Borzenkov
  2006-01-31 14:30 ` Kay Sievers
@ 2006-02-03 13:05 ` Kay Sievers
  2 siblings, 0 replies; 4+ messages in thread
From: Kay Sievers @ 2006-02-03 13:05 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Jan 31, 2006 at 03:30:48PM +0100, Kay Sievers wrote:
> On Mon, Jan 30, 2006 at 07:37:00PM +0300, Andrey Borzenkov wrote:
> > On Sunday 29 January 2006 15:00, Andrey Borzenkov wrote:
> > > Is it intentional? It looks rather like copy'n'paste slip. Patch attached.
> > 
> > This actually fixed a real bug here (every rule having WAIT_FOR_SYSFS was 
> > executed, not the one with mathing SYSFS value); so if there is something 
> > wrong with this patch I appreciate if someone explains what.
> 
> Correct, it doesn't work the way you use it and it should be fixed. I'll go
> look into this later this week.

Works for me now. But WAIT_FOR_SYSFS should still only be placed in the
first rules file, so that no other user of udev rules would see the
same race.

I still hope to fix all the issues some day in the kernel. In the past
we got several pages of rules built into udev, today there are only a
very few rules left and udev itself does not wait for anything, so things
look promising. :)

Thanks,
Kay


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x103432&bid#0486&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

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

end of thread, other threads:[~2006-02-03 13:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-29 12:00 WAIT_FOR_SYSFS ignores further conditions Andrey Borzenkov
2006-01-30 16:37 ` Andrey Borzenkov
2006-01-31 14:30 ` Kay Sievers
2006-02-03 13:05 ` 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).