All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: npiggin@suse.de
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [patch 3/6] [PATCH] fs: convert simple fs to new truncate
Date: Thu, 27 May 2010 12:59:29 +0100	[thread overview]
Message-ID: <20100527115929.GC31073@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20100526151541.707741651@suse.de>

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.

  reply	other threads:[~2010-05-27 11:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-26 15:05 [patch 0/6] truncate patches npiggin
2010-05-26 15:05 ` [patch 1/6] [PATCH] fs: introduce new truncate sequence npiggin
2010-05-26 15:05 ` [patch 2/6] [PATCH] kill spurious reference to vmtruncate npiggin
2010-05-26 15:05 ` [patch 3/6] [PATCH] fs: convert simple fs to new truncate npiggin
2010-05-27 11:59   ` Al Viro [this message]
2010-05-27 12:42     ` Nick Piggin
2010-05-27 13:01       ` Al Viro
2010-05-26 15:05 ` [patch 4/6] [PATCH] tmpfs: convert to use the new truncate convention npiggin
2010-05-26 15:05 ` [patch 5/6] [PATCH] ext2: " npiggin
2010-05-26 15:05 ` [patch 6/6] [PATCH] fat: " npiggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100527115929.GC31073@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=npiggin@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.