Re: [PATCH 1/4] cgroup: fix error return value in cgroup_mount()

2014-01-28 Thread Li Zefan
On 2014/1/28 23:32, Tejun Heo wrote:
> When cgroup_mount() fails to allocate an id for the root, it didn't
> set ret before jumping to unlock_drop ending up returning 0 after a
> failure.  Fix it.
> 
> Signed-off-by: Tejun Heo 
> Cc: sta...@vger.kernel.org

Acked-by: Li Zefan 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/4] cgroup: fix error return value in cgroup_mount()

2014-01-28 Thread Tejun Heo
When cgroup_mount() fails to allocate an id for the root, it didn't
set ret before jumping to unlock_drop ending up returning 0 after a
failure.  Fix it.

Signed-off-by: Tejun Heo 
Cc: sta...@vger.kernel.org
---
 kernel/cgroup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index e2f46ba..364aeb22 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1566,10 +1566,10 @@ static struct dentry *cgroup_mount(struct 
file_system_type *fs_type,
mutex_lock(_mutex);
mutex_lock(_root_mutex);
 
-   root_cgrp->id = idr_alloc(>cgroup_idr, root_cgrp,
-  0, 1, GFP_KERNEL);
-   if (root_cgrp->id < 0)
+   ret = idr_alloc(>cgroup_idr, root_cgrp, 0, 1, GFP_KERNEL);
+   if (ret < 0)
goto unlock_drop;
+   root_cgrp->id = ret;
 
/* Check for name clashes with existing mounts */
ret = -EBUSY;
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/4] cgroup: fix error return value in cgroup_mount()

2014-01-28 Thread Tejun Heo
When cgroup_mount() fails to allocate an id for the root, it didn't
set ret before jumping to unlock_drop ending up returning 0 after a
failure.  Fix it.

Signed-off-by: Tejun Heo t...@kernel.org
Cc: sta...@vger.kernel.org
---
 kernel/cgroup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index e2f46ba..364aeb22 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1566,10 +1566,10 @@ static struct dentry *cgroup_mount(struct 
file_system_type *fs_type,
mutex_lock(cgroup_mutex);
mutex_lock(cgroup_root_mutex);
 
-   root_cgrp-id = idr_alloc(root-cgroup_idr, root_cgrp,
-  0, 1, GFP_KERNEL);
-   if (root_cgrp-id  0)
+   ret = idr_alloc(root-cgroup_idr, root_cgrp, 0, 1, GFP_KERNEL);
+   if (ret  0)
goto unlock_drop;
+   root_cgrp-id = ret;
 
/* Check for name clashes with existing mounts */
ret = -EBUSY;
-- 
1.8.5.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/4] cgroup: fix error return value in cgroup_mount()

2014-01-28 Thread Li Zefan
On 2014/1/28 23:32, Tejun Heo wrote:
 When cgroup_mount() fails to allocate an id for the root, it didn't
 set ret before jumping to unlock_drop ending up returning 0 after a
 failure.  Fix it.
 
 Signed-off-by: Tejun Heo t...@kernel.org
 Cc: sta...@vger.kernel.org

Acked-by: Li Zefan lize...@huawei.com

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/