Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754176AbZICDKy (ORCPT ); Wed, 2 Sep 2009 23:10:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754130AbZICDKx (ORCPT ); Wed, 2 Sep 2009 23:10:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28748 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754118AbZICDKx (ORCPT ); Wed, 2 Sep 2009 23:10:53 -0400 Message-ID: <4A9F3319.8040509@ds.jp.nec.com> Date: Wed, 02 Sep 2009 23:08:09 -0400 From: Munehiro Ikeda User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Thunderbird/3.0b3 MIME-Version: 1.0 To: Vivek Goyal CC: linux-kernel@vger.kernel.org, jens.axboe@oracle.com, containers@lists.linux-foundation.org, dm-devel@redhat.com, nauman@google.com, dpshah@google.com, lizf@cn.fujitsu.com, mikew@google.com, fchecconi@gmail.com, paolo.valente@unimore.it, ryov@valinux.co.jp, fernando@oss.ntt.co.jp, s-uchida@ap.jp.nec.com, taka@valinux.co.jp, guijianfeng@cn.fujitsu.com, jmoyer@redhat.com, dhaval@linux.vnet.ibm.com, balbir@linux.vnet.ibm.com, righi.andrea@gmail.com, agk@redhat.com, akpm@linux-foundation.org, peterz@infradead.org, jmarchan@redhat.com, torvalds@linux-foundation.org, mingo@elte.hu, riel@redhat.com Subject: Re: [PATCH 07/23] io-controller: Common hierarchical fair queuing code in elevaotor layer References: <1251495072-7780-1-git-send-email-vgoyal@redhat.com> <1251495072-7780-8-git-send-email-vgoyal@redhat.com> In-Reply-To: <1251495072-7780-8-git-send-email-vgoyal@redhat.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1605 Lines: 56 Hi, Vivek Goyal wrote, on 08/28/2009 05:30 PM: > +static struct io_group *io_find_alloc_group(struct request_queue *q, > + struct cgroup *cgroup, struct elv_fq_data *efqd, > + int create) > +{ > + struct io_cgroup *iocg = cgroup_to_io_cgroup(cgroup); > + struct io_group *iog = NULL; > + /* Note: Use efqd as key */ > + void *key = efqd; > + > + /* > + * Take a refenrece to css object. Don't want to map a bio to > + * a group if it has been marked for deletion > + */ > + > + if (!css_tryget(&iocg->css)) > + return iog; cgroup_to_io_cgroup() returns NULL if only blkio subsystem is mounted but io subsystem is not. It can cause NULL pointer access. Signed-off-by: Munehiro "Muuhh" Ikeda --- block/elevator-fq.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/elevator-fq.c b/block/elevator-fq.c index b723c12..6714e73 100644 --- a/block/elevator-fq.c +++ b/block/elevator-fq.c @@ -1827,7 +1827,7 @@ static struct io_group *io_find_alloc_group(struct request_queue *q, * a group if it has been marked for deletion */ - if (!css_tryget(&iocg->css)) + if (!iocg || !css_tryget(&iocg->css)) return iog; iog = io_cgroup_lookup_group(iocg, key); -- 1.6.2.5 -- IKEDA, Munehiro NEC Corporation of America m-ikeda@ds.jp.nec.com -- 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/