From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH] procfs: stop using vmtruncate Date: Tue, 21 Jun 2011 03:05:26 +0100 Message-ID: <20110621020526.GY11521@ZenIV.linux.org.uk> References: <20110620224727.GA22187@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:48979 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932080Ab1FUCF1 (ORCPT ); Mon, 20 Jun 2011 22:05:27 -0400 Content-Disposition: inline In-Reply-To: <20110620224727.GA22187@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Jun 20, 2011 at 06:47:27PM -0400, Christoph Hellwig wrote: > Procfs doens't have any ->truncate instances, so all vmtruncate calls can > be replaced with truncate_setsize, given that we've just done the > inode_newsize_ok check as part of inode_change_ok just before. What files on procfs allow meaningful truncate anyway? I agree that vmtruncate() there is bogus, but AFAICT we have the following picture: * there are files with non-zero i_size (/proc/kcore and /proc/bus/pci/*/*); for any of those ATTR_SIZE should fail and I don't think it should fail silently. * the rest has size 0 and for those ATTR_SIZE to non-0 length should definitely fail with an error.