aboutsummaryrefslogtreecommitdiffstats
path: root/fs/kernfs/file.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-13 17:20:56 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-13 17:20:56 -0500
commit7653fe9d6cddc3fc5e4220608079006d8ac0054c (patch)
tree637f23e79a8956fe1a59faa62060ef369ab5f421 /fs/kernfs/file.c
parentf4b3e631b39db31f7375cce0b5e4111d14cde511 (diff)
Revert "kernfs: remove kernfs_addrm_cxt"
This reverts commit 99177a34110889a8f2c36420c34e3bcc9bfd8a70. Tejun writes: I'm sorry but can you please revert the whole series? get_active() waiting while a node is deactivated has potential to lead to deadlock and that deactivate/reactivate interface is something fundamentally flawed and that cgroup will have to work with the remove_self() like everybody else. IOW, I think the first posting was correct. Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/kernfs/file.c')
-rw-r--r--fs/kernfs/file.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
index ffe1bebf9197..404ffd2f27bc 100644
--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -817,6 +817,7 @@ struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
817 bool name_is_static, 817 bool name_is_static,
818 struct lock_class_key *key) 818 struct lock_class_key *key)
819{ 819{
820 struct kernfs_addrm_cxt acxt;
820 struct kernfs_node *kn; 821 struct kernfs_node *kn;
821 unsigned flags; 822 unsigned flags;
822 int rc; 823 int rc;
@@ -852,7 +853,14 @@ struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
852 if (ops->mmap) 853 if (ops->mmap)
853 kn->flags |= KERNFS_HAS_MMAP; 854 kn->flags |= KERNFS_HAS_MMAP;
854 855
855 rc = kernfs_add_one(kn, parent); 856 rc = -ENOENT;
857 if (kernfs_get_active(parent)) {
858 kernfs_addrm_start(&acxt);
859 rc = kernfs_add_one(&acxt, kn, parent);
860 kernfs_addrm_finish(&acxt);
861 kernfs_put_active(parent);
862 }
863
856 if (rc) { 864 if (rc) {
857 kernfs_put(kn); 865 kernfs_put(kn);
858 return ERR_PTR(rc); 866 return ERR_PTR(rc);