From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [patch 3/6] [PATCH] fs: convert simple fs to new truncate Date: Thu, 27 May 2010 12:59:29 +0100 Message-ID: <20100527115929.GC31073@ZenIV.linux.org.uk> References: <20100526150532.718322484@suse.de> <20100526151541.707741651@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , linux-fsdevel@vger.kernel.org, Christoph Hellwig To: npiggin@suse.de Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:58584 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757332Ab0E0L7h (ORCPT ); Thu, 27 May 2010 07:59:37 -0400 Content-Disposition: inline In-Reply-To: <20100526151541.707741651@suse.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, May 27, 2010 at 01:05:35AM +1000, npiggin@suse.de wrote: > =================================================================== > --- linux-2.6.orig/fs/configfs/inode.c > +++ linux-2.6/fs/configfs/inode.c > @@ -78,9 +78,13 @@ int configfs_setattr(struct dentry * den > if (error) > return error; > > - error = inode_setattr(inode, iattr); > - if (error) > - return error; > + if (iattr->ia_valid & ATTR_SIZE) { > + error = simple_setsize(inode, iattr->ia_size); > + if (error) > + return error; > + } > + > + generic_setattr(inode, iattr); > > if (!sd_iattr) { > /* setting attributes for the first time, allocate now */ That should use simple_setattr() instead of generic_setattr(); look at the check just before this chunk... > +++ linux-2.6/fs/block_dev.c > @@ -172,8 +172,9 @@ blkdev_direct_IO(int rw, struct kiocb *i > struct file *file = iocb->ki_filp; > struct inode *inode = file->f_mapping->host; > > - return blockdev_direct_IO_no_locking(rw, iocb, inode, I_BDEV(inode), > - iov, offset, nr_segs, blkdev_get_blocks, NULL); > + return blockdev_direct_IO_no_locking_newtrunc(rw, iocb, inode, > + I_BDEV(inode), iov, offset, nr_segs, > + blkdev_get_blocks, NULL); > } > > int __sync_blockdev(struct block_device *bdev, int wait) > @@ -309,8 +310,8 @@ static int blkdev_write_begin(struct fil > struct page **pagep, void **fsdata) > { > *pagep = NULL; > - return block_write_begin(file, mapping, pos, len, flags, pagep, fsdata, > - blkdev_get_block); > + return block_write_begin_newtrunc(file, mapping, pos, len, flags, > + pagep, fsdata, blkdev_get_block); > } And that should be folded back into the patch #1.