[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140319212232.25520.67165.stgit@rabbit.intern.cm-ag>
Date: Wed, 19 Mar 2014 22:22:32 +0100
From: Max Kellermann <mk@...all.com>
To: viro@...iv.linux.org.uk
Cc: max@...mpel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] fs/namespace: use RCU list functions for mnt_hash
mount.mnt_hash is RCU-protected, and therefore we must use the RCU
variants to manipulate the list.
Signed-off-by: Max Kellermann <mk@...all.com>
---
fs/namespace.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index 2aa0a14..295a0c0 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -22,6 +22,7 @@
#include <linux/fsnotify.h> /* fsnotify_vfsmount_delete */
#include <linux/uaccess.h>
#include <linux/proc_ns.h>
+#include <linux/rculist.h>
#include <linux/magic.h>
#include "pnode.h"
#include "internal.h"
@@ -739,8 +740,8 @@ static void attach_mnt(struct mount *mnt,
struct mountpoint *mp)
{
mnt_set_mountpoint(parent, mp, mnt);
- list_add_tail(&mnt->mnt_hash, mount_hashtable +
- hash(&parent->mnt, mp->m_dentry));
+ list_add_tail_rcu(&mnt->mnt_hash, mount_hashtable +
+ hash(&parent->mnt, mp->m_dentry));
list_add_tail(&mnt->mnt_child, &parent->mnt_mounts);
}
@@ -762,8 +763,8 @@ static void commit_tree(struct mount *mnt)
list_splice(&head, n->list.prev);
- list_add_tail(&mnt->mnt_hash, mount_hashtable +
- hash(&parent->mnt, mnt->mnt_mountpoint));
+ list_add_tail_rcu(&mnt->mnt_hash, mount_hashtable +
+ hash(&parent->mnt, mnt->mnt_mountpoint));
list_add_tail(&mnt->mnt_child, &parent->mnt_mounts);
touch_mnt_namespace(n);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists