Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933386AbYB2ULn (ORCPT ); Fri, 29 Feb 2008 15:11:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757505AbYB2ULa (ORCPT ); Fri, 29 Feb 2008 15:11:30 -0500 Received: from brick.kernel.dk ([87.55.233.238]:23556 "EHLO kernel.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754760AbYB2UL3 (ORCPT ); Fri, 29 Feb 2008 15:11:29 -0500 Date: Fri, 29 Feb 2008 21:11:25 +0100 From: Jens Axboe To: James Bottomley Cc: Tejun Heo , Mike Galbraith , Andrew Morton , LKML , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, Jeff Garzik Subject: Re: [PATCH] block: fix residual byte count handling Message-ID: <20080229201123.GK6704@kernel.dk> References: <20080226150845.2196bc1a.akpm@linux-foundation.org> <1204079075.26640.8.camel@homer.simson.net> <1204092010.9934.31.camel@homer.simson.net> <1204096025.1623.9.camel@homer.simson.net> <47C6661E.9010504@gmail.com> <1204186800.7362.7.camel@homer.simson.net> <47C675C6.8000904@gmail.com> <20080228153542.GZ6704@kernel.dk> <47C6D73E.4030302@gmail.com> <1204303656.4003.19.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1204303656.4003.19.camel@localhost.localdomain> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1941 Lines: 48 On Fri, Feb 29 2008, James Bottomley wrote: > > On Fri, 2008-02-29 at 00:46 +0900, Tejun Heo wrote: > > Jens Axboe wrote: > > >> This problem was reported and diagnosed by Mike Galbraith. > > > > > > Tejun, this patch isn't much cleaner at all. It really shows the pain of > > > these two seperate, yet related, variables. > > > > Not much cleaner compared to what? I think padding stuff is bound to be > > somewhat complex. It's a nasty thing in nature. I think ->extra_len is > > better than ->raw_data_len because ->extra_len only needs to be updated > > where the dirty jobs are done and extra buffer areas are added. Any > > better suggestions? > > Well, I just investigated a bug report in the SCSI transport class. Our > SMP handler is broken in exactly the same way. We rely on the incoming > reported request lengths to size our request data, and they've blown up > from the true length to 512 bytes (the size of our alignment). > > With the original patch, I have to run through the whole of libsas and > scsi_transport_sas doing > > s/data_len/raw_data_len/ > > With your update it looks like I have to run through them all doing > > s/data_len/data_len - extra_len/ > > which is even worse. Can't we put things back to a point where data_len > means exactly that and extra_len means how much we have spare on the > end, so you know you can DMA up to data_len + extra_len if need be? > > That way we don't have to sweep through every block driver altering the > way it uses data_len. Fully agree. The reason why I think it's so ugly is that you have to keep these two seperate variables in sync. The burning was just one bug, there will be others... -- Jens Axboe -- 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/