public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ciju Rajan K <ciju@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org, Jens Axobe <jaxboe@fusionio.com>,
	Vivek Goyal <vgoyal@redhat.com>,
	"Daniel P. Berrange" <berrange@redhat.com>
Cc: Munehiro Ikeda <m-ikeda@ds.jp.nec.com>,
	Ryo Tsuruta <ryov@valinux.co.jp>,
	taka@valinux.co.jp,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Andrea Righi <righi.andrea@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	Bharata B Rao <bharata@linux.vnet.ibm.com>,
	Ciju Rajan K <ciju@linux.vnet.ibm.com>
Subject: [PATCH]Fix return code for mkdir calls
Date: Fri, 20 Aug 2010 14:21:53 +0530	[thread overview]
Message-ID: <4C6E4229.4050702@linux.vnet.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 378 bytes --]

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


[-- Attachment #2: blkio-Fix-the-return-code.patch --]
[-- Type: text/plain, Size: 1056 bytes --]

>From bd2b65775a5b187f7c15c2b6d88f47cd24fb9c4e Mon Sep 17 00:00:00 2001
From: Ciju Rajan K <ciju@linux.vnet.ibm.com>
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

Signed-off-by: Ciju Rajan K <ciju@linux.vnet.ibm.com>
---
 block/blk-cgroup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index a680964..2fef1ef 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -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)
-- 
1.6.0.6



             reply	other threads:[~2010-08-20  8:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-20  8:51 Ciju Rajan K [this message]
2010-08-20  8:51 ` [PATCH]Fix return code for mkdir calls KAMEZAWA Hiroyuki
2010-08-23  8:54 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C6E4229.4050702@linux.vnet.ibm.com \
    --to=ciju@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=berrange@redhat.com \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=jaxboe@fusionio.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m-ikeda@ds.jp.nec.com \
    --cc=righi.andrea@gmail.com \
    --cc=ryov@valinux.co.jp \
    --cc=taka@valinux.co.jp \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox