From patchwork Fri Jul 17 00:16:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "IKEDA, Munehiro" X-Patchwork-Id: 35979 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6H0IJjP024862 for ; Fri, 17 Jul 2009 00:18:19 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id C06DC61A68E; Thu, 16 Jul 2009 20:18:18 -0400 (EDT) Received: from int-mx2.corp.redhat.com ([172.16.27.26]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n6H0IDNP027121 for ; Thu, 16 Jul 2009 20:18:13 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6H0I7pv004203; Thu, 16 Jul 2009 20:18:07 -0400 Received: from ronnie.usersys.redhat.com (dhcp-100-2-140.bos.redhat.com [10.16.2.140]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6H0HxSD019960; Thu, 16 Jul 2009 20:18:00 -0400 Message-ID: <4A5FC2CA.1040609@ds.jp.nec.com> Date: Thu, 16 Jul 2009 20:16:10 -0400 From: Munehiro Ikeda User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: Vivek Goyal References: <1246564917-19603-1-git-send-email-vgoyal@redhat.com> <1246564917-19603-23-git-send-email-vgoyal@redhat.com> In-Reply-To: <1246564917-19603-23-git-send-email-vgoyal@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-loop: dm-devel@redhat.com Cc: dhaval@linux.vnet.ibm.com, snitzer@redhat.com, peterz@infradead.org, dm-devel@redhat.com, dpshah@google.com, jens.axboe@oracle.com, agk@redhat.com, balbir@linux.vnet.ibm.com, paolo.valente@unimore.it, guijianfeng@cn.fujitsu.com, fernando@oss.ntt.co.jp, mikew@google.com, jmoyer@redhat.com, nauman@google.com, righi.andrea@gmail.com, lizf@cn.fujitsu.com, fchecconi@gmail.com, akpm@linux-foundation.org, containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org, s-uchida@ap.jp.nec.com, jbaron@redhat.com Subject: [dm-devel] Re: [PATCH 22/25] io-controller: Per io group bdi congestion interface X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com Hi, Vivek Goyal wrote, on 07/02/2009 04:01 PM: > diff --git a/block/blk-core.c b/block/blk-core.c > index 2035c20..79fe6a9 100644 > --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -90,6 +90,27 @@ void blk_queue_congestion_threshold(struct request_queue *q) > q->nr_congestion_off = nr; > } > > +#ifdef CONFIG_GROUP_IOSCHED > +int blk_queue_io_group_congested(struct backing_dev_info *bdi, int bdi_bits, > + struct page *page) > +{ > + int ret = 0; > + struct request_queue *q = bdi->unplug_io_data; > + > + if (!q&& !q->elevator) > + return bdi_congested(bdi, bdi_bits); It causes NULL pointer dereference for brd etc. Signed-off-by: Munehiro "Muuhh" Ikeda --- block/blk-core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 79fe6a9..39fab66 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -97,7 +97,7 @@ int blk_queue_io_group_congested(struct backing_dev_info *bdi, int bdi_bits, int ret = 0; struct request_queue *q = bdi->unplug_io_data; - if (!q && !q->elevator) + if (!q || !q->elevator) return bdi_congested(bdi, bdi_bits); /* Do we need to hold queue lock? */