linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Nick Piggin <npiggin@suse.de>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	Christoph Hellwig <hch@infradead.org>, Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org,
	OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Subject: Re: [patch 5/5] fat: convert to use the new truncate convention
Date: Wed, 9 Dec 2009 16:08:48 +0100	[thread overview]
Message-ID: <20091209150847.GE7044@quack.suse.cz> (raw)
In-Reply-To: <20091208084302.GE19823@wotan.suse.de>

On Tue 08-12-09 09:43:02, Nick Piggin wrote:
> Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
> Cc: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Nick Piggin <npiggin@suse.de>
  Looks good except that the code in fat_setattr could be simplified I
think.
Acked-by: Jan Kara <jack@suse.cz>

> @@ -365,7 +377,8 @@ int fat_setattr(struct dentry *dentry, s
>  	/*
>  	 * Expand the file. Since inode_setattr() updates ->i_size
>  	 * before calling the ->truncate(), but FAT needs to fill the
> -	 * hole before it.
> +	 * hole before it. XXX: this is no longer true with new truncate
> +	 * sequence.
>  	 */
>  	if (attr->ia_valid & ATTR_SIZE) {
>  		if (attr->ia_size > inode->i_size) {
  I think the content of this condition can be moved inside the ATTR_SIZE
check you've added below and the comment can be removed...

> @@ -414,15 +427,20 @@ int fat_setattr(struct dentry *dentry, s
>  			attr->ia_valid &= ~ATTR_MODE;
>  	}
>  
> -	if (attr->ia_valid)
> -		error = inode_setattr(inode, attr);
> +	if (attr->ia_valid & ATTR_SIZE) {
> +		error = fat_setsize(inode, attr->ia_size);
> +		if (error)
> +			goto out;
> +	}
> +
> +	generic_setattr(inode, attr);
> +	mark_inode_dirty(inode);

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2009-12-09 16:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-08  8:38 [patch 1/5] fs: truncate introduce new sequence Nick Piggin
2009-12-08  8:39 ` [patch 2/5] fs: convert simple fs to new truncate Nick Piggin
2009-12-09 14:39   ` Jan Kara
2009-12-10  5:15     ` Nick Piggin
2009-12-10  8:44       ` Boaz Harrosh
2009-12-10  7:57         ` Nick Piggin
2009-12-08  8:41 ` [patch 3/5] tmpfs: convert to use the new truncate convention Nick Piggin
2009-12-09 14:45   ` Jan Kara
2009-12-10  0:48     ` Nick Piggin
2009-12-08  8:42 ` [patch 4/5] ext2: " Nick Piggin
2009-12-09 14:57   ` Jan Kara
2009-12-10  1:11     ` Nick Piggin
2009-12-10 10:20       ` Jan Kara
2009-12-08  8:43 ` [patch 5/5] fat: " Nick Piggin
2009-12-09 15:08   ` Jan Kara [this message]
2009-12-09 14:38 ` [patch 1/5] fs: truncate introduce new sequence Jan Kara

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=20091209150847.GE7044@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=hch@infradead.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=npiggin@suse.de \
    --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;
as well as URLs for NNTP newsgroup(s).