linux-um archives
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Marco Stornelli <marco.stornelli@gmail.com>
Cc: Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	Al Viro <viro@ZenIV.linux.org.uk>, Jeff Dike <jdike@addtoit.com>,
	Richard Weinberger <richard@nod.at>,
	user-mode-linux-devel@lists.sourceforge.net,
	user-mode-linux-user@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 14/22] hostfs: drop vmtruncate
Date: Sat, 13 Oct 2012 12:22:21 -0400	[thread overview]
Message-ID: <20121013162221.GF19899@infradead.org> (raw)
In-Reply-To: <506FEC51.3020205@gmail.com>

> +++ b/fs/hostfs/hostfs_kern.c
> @@ -848,9 +848,11 @@ int hostfs_setattr(struct dentry *dentry, struct iattr *attr)
>  	    attr->ia_size != i_size_read(inode)) {
>  		int error;
>  
> -		error = vmtruncate(inode, attr->ia_size);
> -		if (err)
> -			return err;
> +		error = inode_newsize_ok(inode, attr->ia_size);
> +		if (error)
> +			return error;
> +
> +		truncate_setsize(inode, attr->ia_size);

The inode_change_ok call here is superflous, it's already done by
inode_change_ok at the beginning of the function.  Even if that wasn't
done doing it aftet set_attr() would be too late anyway.


      reply	other threads:[~2012-10-13 16:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-06  8:31 [PATCH 14/22] hostfs: drop vmtruncate Marco Stornelli
2012-10-13 16:22 ` Christoph Hellwig [this message]

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=20121013162221.GF19899@infradead.org \
    --to=hch@infradead.org \
    --cc=jdike@addtoit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco.stornelli@gmail.com \
    --cc=richard@nod.at \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=user-mode-linux-user@lists.sourceforge.net \
    --cc=viro@ZenIV.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox