From mboxrd@z Thu Jan 1 00:00:00 1970 From: Namjae Jeon Subject: RE: [PATCH v7 3/4] fat: permit to return phy block number by fibmap in fallocated region Date: Tue, 02 Dec 2014 10:31:46 +0900 Message-ID: <000101d00dcf$bc3a8ed0$34afac70$@samsung.com> References: <000301cffed2$1fad92d0$5f08b870$@samsung.com> <87bnnuxai0.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 mailout1.samsung.com ([203.254.224.24]:42760 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932150AbaLBBbs (ORCPT ); Mon, 1 Dec 2014 20:31:48 -0500 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NFX00E2QLKYD710@mailout1.samsung.com> for linux-fsdevel@vger.kernel.org; Tue, 02 Dec 2014 10:31:46 +0900 (KST) In-reply-to: <87bnnuxai0.fsf@devron.myhome.or.jp> Content-language: ko Sender: linux-fsdevel-owner@vger.kernel.org List-ID: > > Hi, > > Sorry for long delay. > > > +static int fat_get_block_bmap(struct inode *inode, sector_t iblock, > > + struct buffer_head *bh_result, int create) > > +{ > > + struct super_block *sb = inode->i_sb; > > + unsigned long max_blocks = bh_result->b_size >> inode->i_blkbits; > > + int err; > > + sector_t bmap, last_block; > > + unsigned long mapped_blocks; > > + > > + BUG_ON(create != 0); > > + > > + last_block = inode->i_blocks >> (sb->s_blocksize_bits - 9); > > + > > + if (iblock >= last_block) > > + return 0; > > + > > + err = fat_get_mapped_cluster(inode, iblock, last_block, &mapped_blocks, > > + &bmap); > > + if (err) > > + return err; > Hi OGAWA. > Probably, we are missing rootdir check here? If it is fat12/fat16, > rootdir has to treat as special, because it doesn't have cluster chain. > > So, how about to pass flags to fat_bmap()? For example, > > /* Check EOF for excluding bmap() ioctl path */ > static int is_exceed_eof() > { > ... > } > > fat_bmap(..., from_bmap) > { > ... > > if (!from_bmap && is_exceed_eof(inode, sector, create)) > return 0; > > ... > } > > or such. Right, root dir check is missing, we need to put it here. And I will change it as you suggest. Thanks for your review:) > > Thanks. > -- > OGAWA Hirofumi