Re: [PATCH v4 1/6] fat: add i_disksize to represent uninitialized size

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

 



Namjae Jeon <linkinjeon@xxxxxxxxx> writes:

> diff --git a/fs/fat/file.c b/fs/fat/file.c
> index 9b104f5..0bf0d28 100644
> --- a/fs/fat/file.c
> +++ b/fs/fat/file.c
> @@ -300,8 +300,10 @@ void fat_truncate_blocks(struct inode *inode, loff_t offset)
>  	 * This protects against truncating a file bigger than it was then
>  	 * trying to write into the hole.
>  	 */
> -	if (MSDOS_I(inode)->mmu_private > offset)
> +	if (MSDOS_I(inode)->i_disksize > offset) {
>  		MSDOS_I(inode)->mmu_private = offset;
> +		MSDOS_I(inode)->i_disksize = offset;

like inode initialization, we would need to set i_disksize to block boundary?

> +	}
>  
>  	nr_clusters = (offset + (cluster_size - 1)) >> sbi->cluster_bits;
>  
-- 
OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
--
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