Path: news.gmane.org!not-for-mail From: Evgeniy Polyakov Newsgroups: gmane.linux.network,gmane.linux.kernel.announce Subject: Re: kmap_atomic() oopses in current mainline Date: Thu, 19 Jul 2007 13:28:56 +0400 Lines: 43 Approved: news@gmane.org Message-ID: <20070719092856.GA15839@2ka.mipt.ru> References: <20070719013304.3c060c99.akpm@linux-foundation.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r X-Trace: sea.gmane.org 1184837396 5043 80.91.229.12 (19 Jul 2007 09:29:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 19 Jul 2007 09:29:56 +0000 (UTC) Cc: netdev@vger.kernel.org, linux-kernel-announce@vger.kernel.org, Dan Williams To: Andrew Morton Original-X-From: netdev-owner@vger.kernel.org Thu Jul 19 11:29:54 2007 Return-path: Envelope-to: linux-netdev-2@gmane.org Original-Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1IBSKW-00025z-Al for linux-netdev-2@gmane.org; Thu, 19 Jul 2007 11:29:52 +0200 Original-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932484AbXGSJ3e (ORCPT ); Thu, 19 Jul 2007 05:29:34 -0400 Original-Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758381AbXGSJ3d (ORCPT ); Thu, 19 Jul 2007 05:29:33 -0400 Original-Received: from relay.2ka.mipt.ru ([194.85.82.65]:52743 "EHLO 2ka.mipt.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754666AbXGSJ3c (ORCPT ); Thu, 19 Jul 2007 05:29:32 -0400 Original-Received: from 2ka.mipt.ru (localhost [127.0.0.1]) by 2ka.mipt.ru (8.14.1/8.14.1) with ESMTP id l6J9Sw7L021863; Thu, 19 Jul 2007 13:28:58 +0400 Original-Received: (from johnpol@localhost) by 2ka.mipt.ru (8.14.1/8.12.1/Submit) id l6J9SuZJ021855; Thu, 19 Jul 2007 13:28:56 +0400 Content-Disposition: inline In-Reply-To: <20070719013304.3c060c99.akpm@linux-foundation.org> User-Agent: Mutt/1.5.9i Original-Sender: netdev-owner@vger.kernel.org Precedence: bulk X-Mailing-List: netdev@vger.kernel.org Xref: news.gmane.org gmane.linux.network:66984 gmane.linux.kernel.announce:459 Archived-At: Hi. On Thu, Jul 19, 2007 at 01:33:04AM -0700, Andrew Morton (akpm@linux-foundation.org) wrote: > I don't think the 2-year-old Vaio has offload engine support ;) Dan, this: > > + if (flags & ASYNC_TX_KMAP_DST) > + dest_buf = kmap_atomic(dest, KM_USER0) + dest_offset; > + else > + dest_buf = page_address(dest) + dest_offset; > + > + if (flags & ASYNC_TX_KMAP_SRC) > + src_buf = kmap_atomic(src, KM_USER0) + src_offset; > + else > + src_buf = page_address(src) + src_offset; > + > + memcpy(dest_buf, src_buf, len); > + > + if (flags & ASYNC_TX_KMAP_DST) > + kunmap_atomic(dest_buf, KM_USER0); > + > + if (flags & ASYNC_TX_KMAP_SRC) > + kunmap_atomic(src_buf, KM_USER0); > + > > is very wrong if both ASYNC_TX_KMAP_DST and ASYNC_TX_KMAP_SRC can ever be > set. We'll end up using the same kmap slot for both src add dest and we > get either corrupted data or a BUG. So far it can not since the only user is raid code, which only allows to perform either reading from bio or writing into one, which requires only one mapping. Btw, shouldn't it always be kmap_atomic() even if flag is not set. That pages are usual one returned by alloc_page(). -- Evgeniy Polyakov - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html