From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: Re: Filesystem setattr/truncate notes and problems Date: Thu, 3 Jun 2010 19:26:53 +1000 Message-ID: <20100603092653.GC6822@laptop> References: <20100601133923.GT9453@laptop> <20100601134801.GA11061@lst.de> <20100601135655.GU9453@laptop> <20100602195538.GG6152@laptop> <20100602200855.GH6152@laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Al Viro , linux-fsdevel@vger.kernel.org, Miklos Szeredi To: Christoph Hellwig Return-path: Received: from cantor.suse.de ([195.135.220.2]:37721 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850Ab0FCJ1B (ORCPT ); Thu, 3 Jun 2010 05:27:01 -0400 Content-Disposition: inline In-Reply-To: <20100602200855.GH6152@laptop> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Jun 03, 2010 at 06:08:55AM +1000, Nick Piggin wrote: > Interesting specific filesystem questions: (not comprehensive) > > ecryptfs improve mtime/ctime handling for truncate of lower inode > > fuse, should be setting ctime on truncate? > > gfs2, mtime and ctime should only be set in truncate if the ATTR_?TIME > are set. > > hostfs, don't ignore ATTR_SIZE. ftruncate/truncate have interesting > different semantics for timestamp updates, so don't use fd != -1 for > these (could use utimes for this, but it causes an atomicity/error > handling issue). > > hpfs could use cont_expand to do expanding truncates? > > ncpfs, nfs smbfs, cifs seems to perform inode size checks > (inode_newsize_ok) after truncating the file on the server?? > > ntfs does not do inode size checks properly. > > logfs logfs_truncate without doing inode_change_ok, inode_newsize_ok etc > can fail inode_setattr after successful truncate (truncate(2) would > return failure and yet the file would be truncated). > > procfs why not return -EPERM rather than setting size? > > reiserfs should do all setattr checks early as possible > (inode_change_ok, inode_newsize_ok). > > ubifs should not update access times unconditionally when ATTR_SIZE is > set > > ufs simple_setsize still destroys the pagecache and causes concurrent > reads to go EOF past updated i_size. Restoring old i_size is too late > I think. Should do those checks first (in fairness lots of filesystems > have bit problems with error handling, but ufs attempts a little bit and > gets it wrong). > > xfs in the 0 length file shortcut, isn't this missing suid kill case? > (ftruncate mandatory mtime update seems like it wasn't working right > there either before this patch). > > nfsd should not change attributes in the case of truncated file with no > size change? ceph doesn't seem to call inode_newsize_ok (so it's missing the rlimit check).