From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: Re: [patch 3/5] vfs: introduce FMODE_NEG_OFFSET for allowing negative f_pos Date: Wed, 21 Jul 2010 12:54:37 +1000 Message-ID: <20100721025437.GC2963@amd> References: <201007202229.o6KMTmMF021834@imap1.linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, kamezawa.hiroyu@jp.fujitsu.com, fengguang.wu@intel.com, heiko.carstens@de.ibm.com To: akpm@linux-foundation.org Return-path: Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:5925 "EHLO ipmail07.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758652Ab0GUCyp (ORCPT ); Tue, 20 Jul 2010 22:54:45 -0400 Content-Disposition: inline In-Reply-To: <201007202229.o6KMTmMF021834@imap1.linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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.