RE: [PATCH] fat: fix data past EOF resulting from fsx testsuite

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

 



> >
> >  /* fat/inode.c */
> > +extern int fat_block_truncate_page(struct inode *inode, loff_t from);
> 
Hi OGAWA.
> We can't use "static" for fat_block_truncate_page()?
Block_truncate_page(., .., get_block) takes get_block as one of
its arguments and in case of fat, fat_get_block is defined and
marked static in fat/inode.c. We cannot use block_truncate_page()
directly in fat/file.c.
> 
> > --- a/fs/fat/file.c
> > +++ b/fs/fat/file.c
> > @@ -526,6 +526,8 @@ int fat_setattr(struct dentry *dentry, struct iattr *attr)
> >  		down_write(&MSDOS_I(inode)->truncate_lock);
> >  		truncate_setsize(inode, attr->ia_size);
> >  		fat_truncate_blocks(inode, attr->ia_size);
> > +		if (inode->i_size & (inode->i_sb->s_blocksize - 1))
> > +			fat_block_truncate_page(inode, inode->i_size);
> >  		up_write(&MSDOS_I(inode)->truncate_lock);
> >  	}
> 
> Let's remove block alignment, because it was done in block_truncate_page().
> Then, move fat_block_truncate_page() before truncate_setsize().
> Looks like other fs calls it before truncate_setsize().
Yes, Right. I will change it.
Thanks for review.
> 
> Thanks.
> --
> 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