xfs
[Top] [All Lists]

Re: mount -o bind confusion and hard lock

To: Adam McKenna <adam-dated-1008549217.6f5784@xxxxxxxxxxxx>
Subject: Re: mount -o bind confusion and hard lock
From: Andrew Morton <akpm@xxxxxxxxxx>
Date: Wed, 12 Dec 2001 23:31:01 -0800
Cc: linux-xfs@xxxxxxxxxxx
References: <20011211163334.D22092@flounder.net>
Sender: owner-linux-xfs@xxxxxxxxxxx
Adam McKenna wrote:
> 
> I tried using mount -o bind to mount a filesystem on my workstation --
> instead of using the correct syntax, which would be
> 
> # mount -o bind /foo /bar
> 
> I did:
> 
> # mount -o bind /dev/sdb1 /bar
> 
> Apparently this is the incorrect way to do things, but when I did this, my
> box hard-locked.  I had to power it off and back on again.  It doesn't seem
> like this should happen.

It's a core kernel locking bug.  Thanks.

A patch from Al Viro:

--- fs/namespace.c      Tue Dec 11 15:53:59 2001
+++ /tmp/namespace.c    Thu Dec 13 02:05:58 2001
@@ -517,9 +517,11 @@
 
        if (mnt) {
                err = graft_tree(mnt, nd);
-               if (err)
+               if (err) {
+                       spin_lock(&dcache_lock);
                        umount_tree(mnt);
-               else
+                       spin_unlock(&dcache_lock);
+               } else
                        mntput(mnt);
        }


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