public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Namjae Jeon <linkinjeon@gmail.com>
Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Namjae Jeon <namjae.jeon@samsung.com>,
	Amit Sahrawat <a.sahrawat@samsung.com>
Subject: Re: [PATCH v6] fat: additions to support fat_fallocate
Date: Tue, 24 Sep 2013 18:58:48 +0900	[thread overview]
Message-ID: <87mwn2bkx3.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <CAKYAXd_-W_K4=cRDevd8f4WcixT6sQTwbRmHq3brdZzmAVYzRw@mail.gmail.com> (Namjae Jeon's message of "Tue, 24 Sep 2013 13:12:39 +0900")

Namjae Jeon <linkinjeon@gmail.com> writes:

>>> We considered after your advice before. we reach for the conclusion
>>> that use this method.
>>> because, Cluster is already allocated in fat fallocate and
>>> when we write with radom offset over i_size on fallocated region, It
>>> will be hit by fat cache in fat_bmap of get_block, which mean buffer
>>> is not set to new.
>>
>> Hm, how does it hit to fat cache? I think fat_alloc_clusters() and
>> fat_chain_add() doesn't update fat cache, right? I.e. initial write
>> after fallocate() should not hit fat cache over i_size?
>
> Ah.. Sorry for wrong reply. old memory make me confusing.
> By allocating cluster in fat fallocate, when write, fat_bmap of
> get_block return physical sector number.
> So buffer is not set to new in _fat_get_block.
>
> When we fallocate with keep size on -> only clusters are added to the
> fat chain calling fat_get_cluster(),and add the cluster to cluster
> chain.
> This doesn’t call fat_get_block() .

Right.

> Now when we try to write in the fallocated region in the
> fat_write_begin() when it is called first time it checks that the
> mismatch is present between the mmu_private and mmu_actual (i.e., the
> file has pre-allocated blocks), and hence zero out the region ;
> Since buffer_new() is not set for fallocated region by fat_get_block()
> , we explicitly  zero out the lseek'ed region using
> “fat_zero_falloc_area” and normal write occurs beyond that,and i_size
> is updated accordingly.

Yes. So I'm saying fixing fat_get_block() would not be hard.

For example, add new size the disk_size, totally 3 sizes - 1) i_size 2)
mmu_private (aka, initialized size) 3) disk_size (aka, uninitialized
size).

When called fat_get_block(), it checks the region between mmu_private
and disk_size. If block hits that region, block is uninitialized area,
so return as buffer_new().

Like this, I think it is not hard. Please consider like above example
too.

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

  reply	other threads:[~2013-09-24  9:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10 14:15 [PATCH v6] fat: additions to support fat_fallocate Namjae Jeon
2013-09-21  7:43 ` OGAWA Hirofumi
2013-09-23  8:13   ` Namjae Jeon
2013-09-23 13:13     ` OGAWA Hirofumi
2013-09-24  4:12       ` Namjae Jeon
2013-09-24  9:58         ` OGAWA Hirofumi [this message]
2013-09-26 11:28           ` Namjae Jeon

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=87mwn2bkx3.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=a.sahrawat@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=linkinjeon@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namjae.jeon@samsung.com \
    /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