From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [patch 3/5] vfs: introduce FMODE_NEG_OFFSET for allowing negative f_pos Date: Tue, 20 Jul 2010 21:03:29 -0700 Message-ID: <20100720210329.8c503ece.akpm@linux-foundation.org> References: <201007202229.o6KMTmMF021834@imap1.linux-foundation.org> <20100721025437.GC2963@amd> <20100721115359.01b5d2b8.kamezawa.hiroyu@jp.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Nick Piggin , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, fengguang.wu@intel.com, heiko.carstens@de.ibm.com To: KAMEZAWA Hiroyuki Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:46426 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854Ab0GUEEg (ORCPT ); Wed, 21 Jul 2010 00:04:36 -0400 In-Reply-To: <20100721115359.01b5d2b8.kamezawa.hiroyu@jp.fujitsu.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 21 Jul 2010 11:53:59 +0900 KAMEZAWA Hiroyuki wrote: > On Wed, 21 Jul 2010 12:54:37 +1000 > Nick Piggin wrote: > > > On Tue, Jul 20, 2010 at 03:29:48PM -0700, Andrew Morton wrote: > > > From: KAMEZAWA Hiroyuki > > > > > > Now, rw_verify_area() checsk f_pos is negative or not. And if negative, > > > returns -EINVAL. > > > > > > But, some special files as /dev/(k)mem and /proc//mem etc.. has > > > negative offsets. And we can't do any access via read/write to the > > > file(device). > > > > > > So introduce FMODE_NEG_OFFSET to allow negative file offsets. > > > > Minor nitpick but I don't understand why this is called NEG_OFFSET. It's > > a large positive offset into the file so FMODE_UNSIGNED_OFFSET seems > > like it would be better. > > > Ah, agreed. > > I'll prepare a macro-renaming patch later (if this patch goes now.) It won't. I hand-edited the diff...