From: Nick Piggin <npiggin@suse.de>
To: Tao Ma <tao.ma@oracle.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Joel Becker <joel.becker@oracle.com>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2] ocfs2: Let ocfs2_setattr use new truncate sequence.
Date: Thu, 10 Jun 2010 14:42:35 +1000 [thread overview]
Message-ID: <20100610044234.GD26335@laptop> (raw)
In-Reply-To: <1276141986-9200-1-git-send-email-tao.ma@oracle.com>
On Thu, Jun 10, 2010 at 11:53:06AM +0800, Tao Ma wrote:
> Let ocfs2 use the new truncate sequence. The changes include:
> 1. Remove the extra check for inode_newsize_ok since Christoph
> has moved it into inode_change_ok. So we will check it at the
> beginning of ocfs2_setattr.
So this deals with our questions regarding check of i_size outside
the inode cluster lock? (see fsdevel discussion)
> 2. Use truncate_setsize directly since we don't implement our
> own ->truncate and what we need is "update i_size and
> truncate_pagecache" which truncate_setsize now does.
> 3. For direct write, ocfs2 actually don't allow write to pass
> i_size(see ocfs2_prepare_inode_for_write), so we don't have
> a chance to increase i_size. So remove the bogus check.
>
> Cc: Joel Becker <joel.becker@oracle.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Nick Piggin <npiggin@suse.de>
> Signed-off-by: Tao Ma <tao.ma@oracle.com>
> ---
> fs/ocfs2/file.c | 34 +++++-----------------------------
> 1 files changed, 5 insertions(+), 29 deletions(-)
>
> diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
> index 1fb0985..764fffb 100644
> --- a/fs/ocfs2/file.c
> +++ b/fs/ocfs2/file.c
> @@ -983,10 +983,6 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
> }
>
> if (size_change && attr->ia_size != i_size_read(inode)) {
> - status = inode_newsize_ok(inode, attr->ia_size);
> - if (status)
> - goto bail_unlock;
> -
> if (i_size_read(inode) > attr->ia_size) {
While you're here, you should be able to use inode->i_size if you're
under i_mutex, no?
next prev parent reply other threads:[~2010-06-10 4:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-10 3:53 [PATCH v2] ocfs2: Let ocfs2_setattr use new truncate sequence Tao Ma
2010-06-10 4:42 ` Nick Piggin [this message]
2010-06-10 5:06 ` Tao Ma
2010-06-10 5:08 ` [PATCH v3] " Tao Ma
2010-06-10 5:58 ` Joel Becker
2010-06-10 8:27 ` Christoph Hellwig
2010-06-10 8:44 ` Tao Ma
2010-06-10 8:47 ` Joel Becker
2010-06-10 12:09 ` Tao Ma
2010-06-10 12:09 ` Tao Ma
2010-06-10 12:28 ` Nick Piggin
2010-06-10 18:11 ` Joel Becker
2010-06-11 0:00 ` Tao Ma
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=20100610044234.GD26335@laptop \
--to=npiggin@suse.de \
--cc=hch@lst.de \
--cc=joel.becker@oracle.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tao.ma@oracle.com \
/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.