Skip to contentSkip to conversation

Fix return code for mkdir calls

PATCH Applied Ciju Rajan K 3 participants 3 messages Aug 20, 2010 – Aug 23, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix return code for mkdir calls

Hi,

This patch fixes the return value when the cgroup hierarchy for blkio control groups is deeper than two levels. Right now EINVAL is returned. This patch replaces EINVAL with more appropriate EPERM to align with mkdir system call return values. This was discussed between Vivek and Daniel sometime back. Please consider this patch for inclusion in 2.6.36.

Thanks
Ciju

Quoted 1 line

From bd2b65775a5b187f7c15c2b6d88f47cd24fb9c4e Mon Sep 17 00:00:00 2001

From: Ciju Rajan K <[email protected]>
Date: Fri, 20 Aug 2010 12:02:45 +0530
Subject: blkio: Fix return code for mkdir calls

If the cgroup hierarchy for blkio control groups is deeper than two levels, kernel should not allow the creation of further levels. mkdir system call does not except EINVAL as a return value. This patch replaces EINVAL with more appropriate EPERM

---
 block/blk-cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
block/blk-cgroup.c +1 -1
index a680964..2fef1ef 100644
@@ -966,7 +966,7 @@ blkiocg_create(struct cgroup_subsys *subsys, struct cgroup *cgroup)
 
 	/* Currently we do not support hierarchy deeper than two level (0,1) */
 	if (parent != cgroup->top_cgroup)
-		return ERR_PTR(-EINVAL);
+		return ERR_PTR(-EPERM);
 
 	blkcg = kzalloc(sizeof(*blkcg), GFP_KERNEL);
 	if (!blkcg)
Signature · 1 line
1.6.0.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · On Fri, 20 Aug 2010 14:21:53 +0530 Ciju Rajan K <[email protected]> wrote:

Hi,

This patch fixes the return value when the cgroup hierarchy for blkio control groups is deeper than two levels. Right now EINVAL is returned. This patch replaces EINVAL with more appropriate EPERM to align with mkdir system call return values. This was discussed between Vivek and Daniel sometime back. Please consider this patch for inclusion in 2.6.36.

Thanks
Ciju

Thank you!

Applied
#2 lore raw
In reply to Ciju Rajan K
Quoted 11 lines · Ciju Rajan K

Hi,

This patch fixes the return value when the cgroup hierarchy for blkio control groups is deeper than two levels. Right now EINVAL is returned. This patch replaces EINVAL with more appropriate EPERM to align with mkdir system call return values. This was discussed between Vivek and Daniel sometime back. Please consider this patch for inclusion in 2.6.36.

Thanks
Ciju

Thanks, applied.

Signature · 1 line
Jens Axboe