From: Francis Moreau <francis.moro@gmail.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Question regarding concurrent accesses through block device and fs
Date: Mon, 2 Mar 2009 14:30:18 +0100 [thread overview]
Message-ID: <38b2ab8a0903020530j18921202r32f73382ff5f0aa@mail.gmail.com> (raw)
In-Reply-To: <200903021811.43653.nickpiggin@yahoo.com.au>
Nick Piggin <nickpiggin@yahoo.com.au> writes:
> On Monday 02 March 2009 08:07:30 Francis Moreau wrote:
>> This is the case where I can't find when the metadata are actually
>> written back to the disk by the flushers. I looked at
>> writback_inodes() but I fail to find this out.
>>
>> Could you point out the place in the code where this happen ?
>
> I guess it picks them up via their block device inodes.
Probably but I don't find the actual place.
I looked at the place where page are normally written back to disk (ie
in background_writeout()) but I can see only the writeback of data, not
metadata...
>> This sounds very weird to me but I need to learn how things work
>> before doing any serious comments.
>
> Why would they? They just operate on their metadata, and the buffer
> cache is basically a transparent writeback cache to them.
Well the fact that metadata are written back to disk at an unknown point
in the time means that we don't know in which order metadata and data
are written. So it means that data can be written before or after
metadata or they can be mixed up.
And this sounds just weird to me. But as I said I'm just a noob so I
need to think and study more on this area and I really have to see where
the actual writes of metadata happen in the code.
> In the same way, an application doesn't really know or care when
> exactly its data is under writeback.
Except when dealing with metadata of the fs, we can corrupt the whole
thing, I think.
> unmap_underlying_metadata is the important exception because Linux
> pagecache otherwise doesn't have a good way to keep pagecache of
> different mappings coherent. So if a block switches from buffercache
> to file mapping, it needs to be made coherent.
>
> When switching back the other way, the truncate code actually makes
> sure of this, that there won't be blocks under writeout after
> being deallocated.
>
> Things do get more complicated with journalling file systems.
>
I think I'll just forget about them, things are currently enough
complicated to make them more obscure ;)
thanks
--
Francis
next prev parent reply other threads:[~2009-03-02 13:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m2hc2yulrw.fsf@gmail.com>
2009-02-19 11:07 ` Francis Moreau
2009-02-19 13:44 ` Nick Piggin
2009-02-20 14:10 ` Francis Moreau
2009-02-23 3:58 ` Nick Piggin
2009-03-01 14:42 ` Francis Moreau
2009-03-01 15:32 ` Nick Piggin
2009-03-01 21:07 ` Francis Moreau
2009-03-02 7:11 ` Nick Piggin
2009-03-02 13:30 ` Francis Moreau [this message]
2009-03-03 3:52 ` Nick Piggin
2009-03-12 8:05 ` Francis Moreau
2009-03-12 8:22 ` Nick Piggin
2009-03-12 9:00 ` Francis Moreau
2009-03-12 9:12 ` Nick Piggin
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=38b2ab8a0903020530j18921202r32f73382ff5f0aa@mail.gmail.com \
--to=francis.moro@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
/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
all inboxes | Powered by JetHome®