From: Francis Moreau <francis.moro@gmail.com>
To: Niu_Yawei@emc.com
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: Question regarding concurrent accesses through block device and fs
Date: Mon, 16 Feb 2009 10:03:05 +0100 [thread overview]
Message-ID: <38b2ab8a0902160103i5a6a1aafr8c8d8f71d7eb668@mail.gmail.com> (raw)
In-Reply-To: <7659DC78F120014CAC3C03E93F3DC2A32A4907@CORPUSMX90B.corp.emc.com>
Hello,
2009/2/16 <Niu_Yawei@emc.com>:
>> I don't see any issues to this but looking at __block_prepare_write(),
>> it seems that we don't want this to happen since it does:
>>
>> [...]
>> if (buffer_new(bh)) {
>> unmap_underlying_metadata(bh->b_bdev,
>> bh->b_blocknr);
>>
>>
>> [...]
>> }
>>
>> where unmap_underlying_metadata() unmaps the blockdev buffer
>> which maps b_blocknr block. Also this call seems unneeded if
>> __block_prepare_write() is called when writing through the block
>> dev since we already know that the buffer doesn't exist (we are
>> here to create it).
>>
>> Could anybody why this is needed at all ?
>
> I think it's not necessary for block device too.
Do you mean that the call to unmap_underlying_metadata() is not needed
for both cases (blockdev and fs accesses) ?
>> Also I'm wondering if the block is written first through the file
>> system (but the data are still in the page cache, not commited to the
>> disk) and another process try to read the same block through the
>> block device. Does it get stale data ?
>>
>
> Yes, I think so. Kernel can't guarantee such kind of consistency.
So why trying to keep consistency for file systems accesses ?
thanks
--
Francis
prev parent reply other threads:[~2009-02-16 9:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-13 20:25 Question regarding concurrent accesses through block device and fs Francis Moreau
2009-02-16 3:00 ` Niu_Yawei
2009-02-16 9:03 ` Francis Moreau [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=38b2ab8a0902160103i5a6a1aafr8c8d8f71d7eb668@mail.gmail.com \
--to=francis.moro@gmail.com \
--cc=Niu_Yawei@emc.com \
--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).