]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/pnode.c
[patch 6/7] vfs: mountinfo: add /proc/<pid>/mountinfo
[net-next-2.6.git] / fs / pnode.c
index 1d8f5447f3f7c533bc848883694bf7656428a64b..d18d66491a01ab5de2684b056692c424c0159c4f 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/mnt_namespace.h>
 #include <linux/mount.h>
 #include <linux/fs.h>
+#include "internal.h"
 #include "pnode.h"
 
 /* return the next shared peer mount of @p */
@@ -45,7 +46,11 @@ static int do_make_slave(struct vfsmount *mnt)
                if (peer_mnt == mnt)
                        peer_mnt = NULL;
        }
+       if (IS_MNT_SHARED(mnt) && list_empty(&mnt->mnt_share))
+               mnt_release_group_id(mnt);
+
        list_del_init(&mnt->mnt_share);
+       mnt->mnt_group_id = 0;
 
        if (peer_mnt)
                master = peer_mnt;
@@ -67,7 +72,6 @@ static int do_make_slave(struct vfsmount *mnt)
        }
        mnt->mnt_master = master;
        CLEAR_MNT_SHARED(mnt);
-       INIT_LIST_HEAD(&mnt->mnt_slave_list);
        return 0;
 }
 
@@ -211,8 +215,7 @@ int propagate_mnt(struct vfsmount *dest_mnt, struct dentry *dest_dentry,
 out:
        spin_lock(&vfsmount_lock);
        while (!list_empty(&tmp_list)) {
-               child = list_entry(tmp_list.next, struct vfsmount, mnt_hash);
-               list_del_init(&child->mnt_hash);
+               child = list_first_entry(&tmp_list, struct vfsmount, mnt_hash);
                umount_tree(child, 0, &umount_list);
        }
        spin_unlock(&vfsmount_lock);