Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751948Ab0HTIwS (ORCPT ); Fri, 20 Aug 2010 04:52:18 -0400 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:51398 "EHLO e23smtp03.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751018Ab0HTIwQ (ORCPT ); Fri, 20 Aug 2010 04:52:16 -0400 Message-ID: <4C6E4229.4050702@linux.vnet.ibm.com> Date: Fri, 20 Aug 2010 14:21:53 +0530 From: Ciju Rajan K User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, Jens Axobe , Vivek Goyal , "Daniel P. Berrange" CC: Munehiro Ikeda , Ryo Tsuruta , taka@valinux.co.jp, KAMEZAWA Hiroyuki , Andrea Righi , Andrew Morton , Balbir Singh , Bharata B Rao , Ciju Rajan K Subject: [PATCH]Fix return code for mkdir calls Content-Type: multipart/mixed; boundary="------------010904080608000603050104" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2110 Lines: 63 This is a multi-part message in MIME format. --------------010904080608000603050104 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------010904080608000603050104 Content-Type: text/plain; name="blkio-Fix-the-return-code.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="blkio-Fix-the-return-code.patch" >From bd2b65775a5b187f7c15c2b6d88f47cd24fb9c4e Mon Sep 17 00:00:00 2001 From: Ciju Rajan K 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 --- 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 --------------010904080608000603050104-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/