From: Namjae Jeon <namjae.jeon@samsung.com>
To: 'OGAWA Hirofumi' <hirofumi@mail.parknet.co.jp>
Cc: 'Andrew Morton' <akpm@linux-foundation.org>,
linux-fsdevel@vger.kernel.org
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 [thread overview]
Message-ID: <000101d00dcf$bc3a8ed0$34afac70$@samsung.com> (raw)
In-Reply-To: <87bnnuxai0.fsf@devron.myhome.or.jp>
>
> 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 <hirofumi@mail.parknet.co.jp>
prev parent reply other threads:[~2014-12-02 1:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-12 23:41 [PATCH v7 3/4] fat: permit to return phy block number by fibmap in fallocated region Namjae Jeon
2014-11-26 15:11 ` OGAWA Hirofumi
2014-12-02 1:31 ` Namjae Jeon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000101d00dcf$bc3a8ed0$34afac70$@samsung.com' \
--to=namjae.jeon@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=hirofumi@mail.parknet.co.jp \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).