linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marco Stornelli <marco.stornelli@gmail.com>
To: Richard Weinberger <richard@nod.at>
Cc: Jeff Dike <jdike@addtoit.com>,
	user-mode-linux-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] hostfs: fix a not needed double check
Date: Sun, 18 Nov 2012 09:59:46 +0100	[thread overview]
Message-ID: <50A8A382.7020400@gmail.com> (raw)
In-Reply-To: <508276D3.5000708@gmail.com>

Il 20/10/2012 12:02, Marco Stornelli ha scritto:
> With the commit 3be2be0a32c18b0fd6d623cda63174a332ca0de1 we removed vmtruncate,
> but actaully there is no need to call inode_newsize_ok() because the checks are
> already done in inode_change_ok() at the begin of the function.
>
> Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
> ---
>   fs/hostfs/hostfs_kern.c |    9 +--------
>   1 files changed, 1 insertions(+), 8 deletions(-)
>
> diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
> index 457addc..c9d5254 100644
> --- a/fs/hostfs/hostfs_kern.c
> +++ b/fs/hostfs/hostfs_kern.c
> @@ -845,15 +845,8 @@ int hostfs_setattr(struct dentry *dentry, struct iattr *attr)
>   		return err;
>
>   	if ((attr->ia_valid & ATTR_SIZE) &&
> -	    attr->ia_size != i_size_read(inode)) {
> -		int error;
> -
> -		error = inode_newsize_ok(inode, attr->ia_size);
> -		if (error)
> -			return error;
> -
> +	    attr->ia_size != i_size_read(inode))
>   		truncate_setsize(inode, attr->ia_size);
> -	}
>
>   	setattr_copy(inode, attr);
>   	mark_inode_dirty(inode);
>

Any feedback for this patch?

Marco

  reply	other threads:[~2012-11-18  8:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-20 10:02 [PATCH] hostfs: fix a not needed double check Marco Stornelli
2012-11-18  8:59 ` Marco Stornelli [this message]
2012-11-24  9:02   ` Marco Stornelli
2012-11-24  9:12     ` Richard Weinberger
2012-11-24  9:08       ` Marco Stornelli

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=50A8A382.7020400@gmail.com \
    --to=marco.stornelli@gmail.com \
    --cc=hch@infradead.org \
    --cc=jdike@addtoit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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;
as well as URLs for NNTP newsgroup(s).