Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765845AbXJROvz (ORCPT ); Thu, 18 Oct 2007 10:51:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755955AbXJROvr (ORCPT ); Thu, 18 Oct 2007 10:51:47 -0400 Received: from lixom.net ([66.141.50.11]:58862 "EHLO mail.lixom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757433AbXJROvr (ORCPT ); Thu, 18 Oct 2007 10:51:47 -0400 Date: Thu, 18 Oct 2007 09:58:10 -0500 From: Olof Johansson To: Jens Axboe Cc: Benny Halevy , David Miller , torvalds@linux-foundation.org, fujita.tomonori@lab.ntt.co.jp, mingo@elte.hu, linux-kernel@vger.kernel.org, jgarzik@pobox.com, alan@lxorguk.ukuu.org.uk, tomof@acm.org Subject: Re: [bug] ata subsystem related crash with latest -git Message-ID: <20071018145810.GB5565@lixom.net> References: <20071018.045505.106265100.davem@davemloft.net> <20071018115702.GW5063@kernel.dk> <20071018.050554.115911163.davem@davemloft.net> <20071018120950.GX5063@kernel.dk> <20071018121547.GY5063@kernel.dk> <4717587E.6090301@panasas.com> <20071018135605.GL5063@kernel.dk> <20071018140550.GO5063@kernel.dk> <47176AB9.2070000@panasas.com> <20071018143836.GA10674@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071018143836.GA10674@kernel.dk> User-Agent: Mutt/1.5.16 (2007-06-11) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1879 Lines: 59 On Thu, Oct 18, 2007 at 04:38:36PM +0200, Jens Axboe wrote: > On Thu, Oct 18 2007, Benny Halevy wrote: > > On Oct. 18, 2007, 16:05 +0200, Jens Axboe wrote: > > > On Thu, Oct 18 2007, Jens Axboe wrote: > > >> On Thu, Oct 18 2007, Benny Halevy wrote: > > >>>> return sg; > > >>>> } > > >>>> @@ -83,6 +96,9 @@ static inline struct scatterlist *sg_last(struct scatterlist *sgl, > > >>>> ret = sg; > > >>>> > > >>>> #endif > > >>>> +#ifdef CONFIG_DEBUG_SG > > >>>> + BUG_ON(sgl[0].sg_magic != SG_MAGIC); > > >>> can it also do BUG_ON(!sg_is_last(sg))? > > >> That would make sense, definitely. I'll add that. > > > > > > BUG_ON(!sg_is_last(ret)); > > > > > > it should be, not sg. That's what I merged. > > > > > right. of course. > > OK, that found something interesting - mapping a request may shrink it, > so we need to update the end marker to move it earlier in the list. > Basically just a > > if (sg) > __sg_mark_end(sg); > > at the bottom of blk_rq_map_sg(). Updated patch below, booted on other > machines now as well without incident. PPC needs this. I'm guessing other arches might too. Otherwise seems to boot and work well (with Jeff's sata patch). Thanks, -Olof diff --git a/include/asm-powerpc/scatterlist.h b/include/asm-powerpc/scatterlist.h index b9f1dbc..fcf7d55 100644 --- a/include/asm-powerpc/scatterlist.h +++ b/include/asm-powerpc/scatterlist.h @@ -14,6 +14,9 @@ #include struct scatterlist { +#ifdef CONFIG_DEBUG_SG + unsigned long sg_magic; +#endif unsigned long page_link; unsigned int offset; unsigned int length; - 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/