Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 12 Aug 2002 13:24:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 12 Aug 2002 13:24:27 -0400 Received: from neon-gw-l3.transmeta.com ([63.209.4.196]:19730 "EHLO neon-gw.transmeta.com") by vger.kernel.org with ESMTP id ; Mon, 12 Aug 2002 13:24:27 -0400 Date: Mon, 12 Aug 2002 10:30:25 -0700 (PDT) From: Linus Torvalds To: Rusty Russell cc: akpm@zip.com.au, Subject: Re: [patch 6/12] hold atomic kmaps across generic_file_read In-Reply-To: <20020812174530.398156a1.rusty@rustcorp.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1002 Lines: 32 On Mon, 12 Aug 2002, Rusty Russell wrote: > On Fri, 9 Aug 2002 18:33:09 -0700 (PDT) > Linus Torvalds wrote: > > > repeat: > > kmap_atomic(..); // this increments preempt count > > nr = copy_from_user(..); > > Please please please use a different name for "I know I'm not preemptible but > I can handle it" or a flag or something. > > That leaves us with the possibility of a BUG() in the "normal" copy_to/from_user > for all those "I'm holding a spinlock while copying to userspace wheeee!" bugs. > Very common mistake for new kernel authors. Agreed. Maybe the right thing to do is to just have a atomic_copy_from_user() which can then be used to explicitly not check if we have a kernel debugging option. Linus - 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/