Re: [patch 5/5] fat: convert to use the new truncate convention

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

> @@ -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@xxxxxxx>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux