2002-03-17 18:10:08

by Felix Braun

[permalink] [raw]
Subject: devfs mounted twice in linux 2.4.19-pre3

Hi Richard,

I just noticed that devfs is listed twice in /proc/mounts in linux
2.4.19-pre3, which confuses my shutdown script. Under 2.4.19-pre my
/proc/mounts looks like this:

devfs /dev devfs rw 0 0
/dev/ide/host0/bus0/target0/lun0/part5 / reiserfs rw 0 0
none /dev devfs rw 0 0
/proc /proc proc rw 0 0
/dev/discs/disc0/part1 /dos vfat rw 0 0
/dev/discs/disc0/part9 /opt reiserfs rw,noatime 0 0
none /dev/pts devpts rw 0 0
/dev/discs/disc0/part7 /usr reiserfs rw 0 0
none /dev/shm tmpfs rw 0 0

whereas under 2.4.18 the first line didn't show up. Is that a
misconfiguration on my part?

Bye
Felix


2002-03-18 06:43:53

by Denis Vlasenko

[permalink] [raw]
Subject: Re: devfs mounted twice in linux 2.4.19-pre3

On 17 March 2002 09:19, Felix Braun wrote:
> Hi Richard,
>
> I just noticed that devfs is listed twice in /proc/mounts in linux
> 2.4.19-pre3, which confuses my shutdown script. Under 2.4.19-pre my
> /proc/mounts looks like this:
>
> devfs /dev devfs rw 0 0
> /dev/ide/host0/bus0/target0/lun0/part5 / reiserfs rw 0 0
> none /dev devfs rw 0 0
> /proc /proc proc rw 0 0
> /dev/discs/disc0/part1 /dos vfat rw 0 0
> /dev/discs/disc0/part9 /opt reiserfs rw,noatime 0 0
> none /dev/pts devpts rw 0 0
> /dev/discs/disc0/part7 /usr reiserfs rw 0 0
> none /dev/shm tmpfs rw 0 0
>
> whereas under 2.4.18 the first line didn't show up. Is that a
> misconfiguration on my part?

Maybe you mount devfs manually after kernel did the same?
devfs /dev devfs rw 0 0 - most probably mounted by initscripts
none /dev devfs rw 0 0 - by kernel

Look into /var/log/messages for:
kernel: VFS: Mounted root (nfs filesystem).
kernel: Mounted devfs on /dev <============ do yo have this?
--
vda

2002-03-18 12:38:51

by Paul Komkoff

[permalink] [raw]
Subject: Re: devfs mounted twice in linux 2.4.19-pre3

Replying to Denis Vlasenko:
> > whereas under 2.4.18 the first line didn't show up. Is that a
> > misconfiguration on my part?
>
> Maybe you mount devfs manually after kernel did the same?
> devfs /dev devfs rw 0 0 - most probably mounted by initscripts
> none /dev devfs rw 0 0 - by kernel

no - this is known bug at init/do_mounts.c - fixed in latest ac

--
Paul P 'Stingray' Komkoff 'Greatest' Jr // (icq)23200764 // (irc)Spacebar
PPKJ1-RIPE // (smtp)[email protected] // (http)stingr.net // (pgp)0xA4B4ECA4

2002-03-18 15:37:16

by Richard Gooch

[permalink] [raw]
Subject: Re: devfs mounted twice in linux 2.4.19-pre3

Denis Vlasenko writes:
> On 17 March 2002 09:19, Felix Braun wrote:
> > Hi Richard,
> >
> > I just noticed that devfs is listed twice in /proc/mounts in linux
> > 2.4.19-pre3, which confuses my shutdown script. Under 2.4.19-pre my
> > /proc/mounts looks like this:
> >
> > devfs /dev devfs rw 0 0
> > /dev/ide/host0/bus0/target0/lun0/part5 / reiserfs rw 0 0
> > none /dev devfs rw 0 0
> > /proc /proc proc rw 0 0
> > /dev/discs/disc0/part1 /dos vfat rw 0 0
> > /dev/discs/disc0/part9 /opt reiserfs rw,noatime 0 0
> > none /dev/pts devpts rw 0 0
> > /dev/discs/disc0/part7 /usr reiserfs rw 0 0
> > none /dev/shm tmpfs rw 0 0
> >
> > whereas under 2.4.18 the first line didn't show up. Is that a
> > misconfiguration on my part?
>
> Maybe you mount devfs manually after kernel did the same?
> devfs /dev devfs rw 0 0 - most probably mounted by initscripts
> none /dev devfs rw 0 0 - by kernel
>
> Look into /var/log/messages for:
> kernel: VFS: Mounted root (nfs filesystem).
> kernel: Mounted devfs on /dev <============ do yo have this?

No, I don't think that's the problem. I now also have two devfs
entries in /proc/mounts with 2.4.19-pre3. My boot scripts don't mount
devfs. I'm looking into the problem. It seems to have something to do
with Al's changes to the boot sequence code.

Regards,

Richard....
Permanent: [email protected]
Current: [email protected]

2002-03-18 15:58:54

by Alexander Viro

[permalink] [raw]
Subject: Re: devfs mounted twice in linux 2.4.19-pre3



On Mon, 18 Mar 2002, Richard Gooch wrote:

> No, I don't think that's the problem. I now also have two devfs
> entries in /proc/mounts with 2.4.19-pre3. My boot scripts don't mount
> devfs. I'm looking into the problem. It seems to have something to do
> with Al's changes to the boot sequence code.

It has and it will go away when the next series is merged.

2002-03-18 16:09:14

by Richard Gooch

[permalink] [raw]
Subject: Re: devfs mounted twice in linux 2.4.19-pre3

Alexander Viro writes:
> On Mon, 18 Mar 2002, Richard Gooch wrote:
>
> > No, I don't think that's the problem. I now also have two devfs
> > entries in /proc/mounts with 2.4.19-pre3. My boot scripts don't mount
> > devfs. I'm looking into the problem. It seems to have something to do
> > with Al's changes to the boot sequence code.
>
> It has and it will go away when the next series is merged.

Are you talking about this patch:
+++ linux.19pre3-ac1/init/do_mounts.c Thu Mar 14 23:01:31 2002
@@ -375,7 +375,7 @@
done:
putname(fs_names);
if (do_devfs)
- sys_umount(".", 0);
+ sys_umount(".", MNT_DETACH);
}

#ifdef CONFIG_BLK_DEV_INITRD

I tried that and it didn't fix the problem.

Regards,

Richard....
Permanent: [email protected]
Current: [email protected]

2002-03-20 06:30:54

by Richard Gooch

[permalink] [raw]
Subject: Re: devfs mounted twice in linux 2.4.19-pre3

Felix Braun writes:
> Hi Richard,
>
> I just noticed that devfs is listed twice in /proc/mounts in linux
> 2.4.19-pre3, which confuses my shutdown script. Under 2.4.19-pre my
> /proc/mounts looks like this:
>
> devfs /dev devfs rw 0 0
> /dev/ide/host0/bus0/target0/lun0/part5 / reiserfs rw 0 0
> none /dev devfs rw 0 0
> /proc /proc proc rw 0 0
> /dev/discs/disc0/part1 /dos vfat rw 0 0
> /dev/discs/disc0/part9 /opt reiserfs rw,noatime 0 0
> none /dev/pts devpts rw 0 0
> /dev/discs/disc0/part7 /usr reiserfs rw 0 0
> none /dev/shm tmpfs rw 0 0
>
> whereas under 2.4.18 the first line didn't show up. Is that a
> misconfiguration on my part?

No, this is due to a change in the kernel (presumably done by Al).
What seems to be happening is that the kernel temporarily mounts devfs
and then detaches it again using MNT_DETACH (actually, you need
2.4.19-pre3-ac2 to get the fix that adds MNT_DETACH). However,
detached filesystems still appear to be listed in /proc/mounts.
Arguably, this is incorrect.

If you were to reboot single-user, and with devfs=nomount, inspection
of /proc/mounts would show the line:
devfs /dev devfs rw 0 0

However, if you listed /dev, you would see that it doesn't actually
contain a devfs. Thus, /proc/mounts is deceiving you.

Al: what is the intended behaviour of MNT_DETACH wrt. /proc/mounts?

Regards,

Richard....
Permanent: [email protected]
Current: [email protected]

2002-03-25 00:09:08

by Richard Gooch

[permalink] [raw]
Subject: Re: devfs mounted twice in linux 2.4.19-pre3

Hi, Al. What is the intended behaviour of MNT_DETACH
wrt. /proc/mounts? It appears that detaching a FS leaves behind an
apparently stale entry in /proc/mounts. Is this intentional?

This question came up after the following exchange:

I wrote:
> Felix Braun writes:
> > Hi Richard,
> >
> > I just noticed that devfs is listed twice in /proc/mounts in linux
> > 2.4.19-pre3, which confuses my shutdown script. Under 2.4.19-pre my
> > /proc/mounts looks like this:
> >
> > devfs /dev devfs rw 0 0
> > /dev/ide/host0/bus0/target0/lun0/part5 / reiserfs rw 0 0
> > none /dev devfs rw 0 0
> > /proc /proc proc rw 0 0
> > /dev/discs/disc0/part1 /dos vfat rw 0 0
> > /dev/discs/disc0/part9 /opt reiserfs rw,noatime 0 0
> > none /dev/pts devpts rw 0 0
> > /dev/discs/disc0/part7 /usr reiserfs rw 0 0
> > none /dev/shm tmpfs rw 0 0
> >
> > whereas under 2.4.18 the first line didn't show up. Is that a
> > misconfiguration on my part?
>
> No, this is due to a change in the kernel (presumably done by Al).
> What seems to be happening is that the kernel temporarily mounts devfs
> and then detaches it again using MNT_DETACH (actually, you need
> 2.4.19-pre3-ac2 to get the fix that adds MNT_DETACH). However,
> detached filesystems still appear to be listed in /proc/mounts.
> Arguably, this is incorrect.
>
> If you were to reboot single-user, and with devfs=nomount, inspection
> of /proc/mounts would show the line:
> devfs /dev devfs rw 0 0
>
> However, if you listed /dev, you would see that it doesn't actually
> contain a devfs. Thus, /proc/mounts is deceiving you.
>
> Al: what is the intended behaviour of MNT_DETACH wrt. /proc/mounts?

Regards,

Richard....
Permanent: [email protected]
Current: [email protected]

2002-03-25 17:08:01

by Christoph Hellwig

[permalink] [raw]
Subject: Re: devfs mounted twice in linux 2.4.19-pre3

On Mon, Mar 25, 2002 at 09:58:41AM -0700, Richard Gooch wrote:
> This is not a problem with mount(8). It's a kernel problem. When
> sys_umount(..., MNT_DETACH) is called from kernel space, it doesn't
> clean up /proc/mounts.

Oh - I though about /etc/mtab, sorry for misreading..