devfs
[Top] [All Lists]

Re: Why removables revalidation works at all?

To: Borsenkow Andrej <Andrej.Borsenkow@xxxxxxxxxxxxxx>
Subject: Re: Why removables revalidation works at all?
From: Richard Gooch <rgooch@xxxxxxxxxxxxxxx>
Date: Fri, 22 Feb 2002 09:30:19 -0700
Cc: "'devfs mailing list'" <devfs@xxxxxxxxxxx>
In-reply-to: <003401c1bb74$995e7770$21c9ca95@xxxxxxxxxxxxxx>
References: <003401c1bb74$995e7770$21c9ca95@xxxxxxxxxxxxxx>
Sender: owner-devfs@xxxxxxxxxxx
Borsenkow Andrej writes:
> 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?

If I understand your question: you're wondering about races between
devfsd and it's child dd process. There are no such races, because
devfsd will wait for the child process to finish. Devfsd is
explicitely single-threaded (i.e. it waits for children to finish) to
avoid any such problems.

                                Regards,

                                        Richard....
Permanent: rgooch@xxxxxxxxxxxxx
Current:   rgooch@xxxxxxxxxxxxxxx

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