[PATCH] namespace.c: fix expiring of detached mount
[deliverable/linux.git] / fs / namespace.c
index d82cf18a1a947b381603b28ef9765b3be41aef39..2b4635e43ae84024cac1564231a834f93afc6590 100644 (file)
@@ -829,6 +829,15 @@ static void expire_mount(struct vfsmount *mnt, struct list_head *mounts)
 {
        spin_lock(&vfsmount_lock);
 
+       /*
+        * Check if mount is still attached, if not, let whoever holds it deal
+        * with the sucker
+        */
+       if (mnt->mnt_parent == mnt) {
+               spin_unlock(&vfsmount_lock);
+               return;
+       }
+
        /*
         * Check that it is still dead: the count should now be 2 - as
         * contributed by the vfsmount parent and the mntget above
This page took 0.0306380000000001 seconds and 5 git commands to generate.