diff options
Diffstat (limited to 'fs/configfs/symlink.c')
-rw-r--r-- | fs/configfs/symlink.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c index c12801a12c34..61a886dbd601 100644 --- a/fs/configfs/symlink.c +++ b/fs/configfs/symlink.c | |||
@@ -31,6 +31,9 @@ | |||
31 | #include <linux/configfs.h> | 31 | #include <linux/configfs.h> |
32 | #include "configfs_internal.h" | 32 | #include "configfs_internal.h" |
33 | 33 | ||
34 | /* Protects attachments of new symlinks */ | ||
35 | DEFINE_MUTEX(configfs_symlink_mutex); | ||
36 | |||
34 | static int item_depth(struct config_item * item) | 37 | static int item_depth(struct config_item * item) |
35 | { | 38 | { |
36 | struct config_item * p = item; | 39 | struct config_item * p = item; |
@@ -147,7 +150,9 @@ int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symna | |||
147 | 150 | ||
148 | ret = type->ct_item_ops->allow_link(parent_item, target_item); | 151 | ret = type->ct_item_ops->allow_link(parent_item, target_item); |
149 | if (!ret) { | 152 | if (!ret) { |
153 | mutex_lock(&configfs_symlink_mutex); | ||
150 | ret = create_link(parent_item, target_item, dentry); | 154 | ret = create_link(parent_item, target_item, dentry); |
155 | mutex_unlock(&configfs_symlink_mutex); | ||
151 | if (ret && type->ct_item_ops->drop_link) | 156 | if (ret && type->ct_item_ops->drop_link) |
152 | type->ct_item_ops->drop_link(parent_item, | 157 | type->ct_item_ops->drop_link(parent_item, |
153 | target_item); | 158 | target_item); |