devfs
[Top] [All Lists]

Why removables revalidation works at all?

To: "'devfs mailing list'" <devfs@xxxxxxxxxxx>
Subject: Why removables revalidation works at all?
From: Borsenkow Andrej <Andrej.Borsenkow@xxxxxxxxxxxxxx>
Date: Fri, 22 Feb 2002 10:43:20 +0300
Importance: Normal
Sender: owner-devfs@xxxxxxxxxxx
I am sorry if this is stupid question but if it should not work if I
understand devfs properly ... I mean these dd's in devfsd.

What happens is

User accesses /dev/sda4
       |
devfs lookup calls devfsd with LOOKUP
       |
devfsd runs dd if=/dev/sda
       |
       |-----------------------+
       |                       |
devfsd returns to devfs      devfs calls devfsd with REGISTER
       |                       |
devfs repeats lookup         devfsd creates /dev/sda4
       |
devfs returns /dev/sda4?


So to my eyes there are two independent threads with obvious race
condition here. There is no way known to me to synchronize them. It
assumes second threads completes BEFORE devfs does second lookup. Is it
really garanteed?

-andrej 

<Prev in Thread] Current Thread [Next in Thread>