From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH] fs: change sys_truncate/sys_ftruncate length parameter type Date: Wed, 23 Sep 2009 08:13:47 -0700 (PDT) Message-ID: References: <20090923150326.GB23595@osiris.boeblingen.de.ibm.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:46539 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751382AbZIWPO0 (ORCPT ); Wed, 23 Sep 2009 11:14:26 -0400 In-Reply-To: <20090923150326.GB23595@osiris.boeblingen.de.ibm.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Heiko Carstens Cc: Andrew Morton , Christoph Hellwig , Al Viro , "H. Peter Anvin" , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org On Wed, 23 Sep 2009, Heiko Carstens wrote: > > For both system calls user space passes a signed long length parameter, > while the kernel side takes an unsigned long parameter and converts it > later to signed long again. No it doesn't. Look at sys_ftruncate() again. It doesn't convert it to signed long at all. It converts it to 'loff_t' which is something different entirely. Now, it may be that we _should_ convert it to 'long' like your patch does, but this is definitely not a "no changes" patch as far as I can tell. It limits ftruncate to 31 bits on 32-bit architectures, in ways it didn't use to be limited. [ Note the "small" logic and the interaction with O_LARGEFILE. On a 32-bit architecture, if you open with O_LARGEFILE, ftruncate() gets the full 32-bit range, and that's the part your patch broke. ] So NAK. Not without some serious explanations on why I'm wrong and am just being unnecessarily difficult and a pinhead. Linus