From: Namjae Jeon Subject: RE: [PATCH] fat: fix data past EOF resulting from fsx testsuite Date: Mon, 10 Nov 2014 14:07:34 +0900 Message-ID: <002c01cffca4$3d222e00$b7668a00$@samsung.com> References: <000001cff3fe$effbc0d0$cff34270$@samsung.com> <87sihsnz1e.fsf@devron.myhome.or.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: 'Andrew Morton' , linux-fsdevel@vger.kernel.org To: 'OGAWA Hirofumi' Return-path: Received: from mailout3.samsung.com ([203.254.224.33]:8232 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751178AbaKJFHh (ORCPT ); Mon, 10 Nov 2014 00:07:37 -0500 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NET0075E4WNOYE0@mailout3.samsung.com> for linux-fsdevel@vger.kernel.org; Mon, 10 Nov 2014 14:07:35 +0900 (KST) In-reply-to: <87sihsnz1e.fsf@devron.myhome.or.jp> Content-language: ko Sender: linux-fsdevel-owner@vger.kernel.org List-ID: > > > > /* 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