From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.fusionio.com (mx1.fusionio.com [64.244.102.30]) by ozlabs.org (Postfix) with ESMTP id 8B7EFB70F3 for ; Sun, 17 Oct 2010 17:49:40 +1100 (EST) Message-ID: <4CBA9C79.7050908@fusionio.com> Date: Sun, 17 Oct 2010 08:49:29 +0200 From: Jens Axboe MIME-Version: 1.0 To: Geert Uytterhoeven Subject: Re: [patch] ps3disk: passing wrong variable to bvec_kunmap_irq() References: <20101011191335.GH5851@bicker> <4CB3689F.1050601@fusionio.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Cc: "cbe-oss-dev@lists.ozlabs.org" , Dan Carpenter , "Martin K. Petersen" , Geoff Levand , "kernel-janitors@vger.kernel.org" , FUJITA Tomonori , "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 2010-10-16 21:39, Geert Uytterhoeven wrote: > On Mon, Oct 11, 2010 at 21:42, Jens Axboe wrote: >> On 2010-10-11 21:13, Dan Carpenter wrote: >>> This should pass "buf" to bvec_kunmap_irq() instead of "bv". The api is >>> like kmap_atomic() instead of kmap(). >>> >>> Signed-off-by: Dan Carpenter >>> >>> diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c >>> index e9da874..03688c2 100644 >>> --- a/drivers/block/ps3disk.c >>> +++ b/drivers/block/ps3disk.c >>> @@ -113,7 +113,7 @@ static void ps3disk_scatter_gather(struct ps3_storage_device *dev, >>> memcpy(buf, dev->bounce_buf+offset, size); >>> offset += size; >>> flush_kernel_dcache_page(bvec->bv_page); >>> - bvec_kunmap_irq(bvec, &flags); >>> + bvec_kunmap_irq(buf, &flags); >>> i++; >>> } >>> } >> >> Thanks applied, that bug is all too common. > > Because bvec_kunmap_irq() is a macro if !CONFIG_HIGHMEM, and thus there's no > argument type checking on e.g. pp64, which doesn't support HIGHMEM? It's a generic problem, not isolated to this case. The problem is that the API isn't symmetric, and the unmap parts take a void * pointer. -- Jens Axboe