Re: 2.4.0test1-ac4 - mount problem

From: Alexander Viro (viro@math.psu.edu)
Date: Tue May 30 2000 - 09:31:43 EST


On Tue, 30 May 2000, Chad Schwartz wrote:

> > On Tue, 30 May 2000, Chad Schwartz wrote:
> >
> > > Yeah. It shouldn't be allowed to work by default... This causes HORRIBLE
> > > problems if someone were to mount the root FS twice. :) (locks hard..)
> >
> > What? Testcase, please - it's supposed to work. Locks hard at which point,
> > BTW?
>
> Mount your root filesystem twice.
>
> mount /dev/hda1 /
> mount /dev/hda1 /
>
> Kernel will lock hard.

Oh, fsck... Yes, I see what happens - sorry, my fault. Stupid bug in
add_vfsmnt() - thanks for catching it. Quick fix: in add_vfsmnt()
replace
        if (parent)
                list_add(&mnt->mnt_child, &parent->mnt_mounts);
        else
                INIT_LIST_HEAD(&mnt->mnt_child);
        INIT_LIST_HEAD(&mnt->mnt_mounts);
        list_add(&mnt->mnt_instances, &sb->s_mounts);
        list_add(&mnt->mnt_clash, &mountpoint->d_vfsmnt);
        list_add(&mnt->mnt_list, vfsmntlist.prev);
with
        if (parent) {
                list_add(&mnt->mnt_child, &parent->mnt_mounts);
                list_add(&mnt->mnt_clash, &mountpoint->d_vfsmnt);
        } else {
                INIT_LIST_HEAD(&mnt->mnt_child);
                INIT_LIST_HEAD(&mnt->mnt_clash);
        }
        INIT_LIST_HEAD(&mnt->mnt_mounts);
        list_add(&mnt->mnt_instances, &sb->s_mounts);
        list_add(&mnt->mnt_list, vfsmntlist.prev);

and ditto for move_vfsmnt(). Sorry about that...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:24 EST