From: Jeff Moyer <jmoyer@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Eryu Guan <guaneryu@gmail.com>,
linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
viro@ZenIV.linux.org.uk
Subject: Re: [PATCH v3] direct-io: fix direct write stale data exposure from concurrent buffered read
Date: Tue, 24 May 2016 15:39:54 -0400 [thread overview]
Message-ID: <x49eg8r1bzp.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <20160524122455.4fc3d250b17fcd776dc15968@linux-foundation.org> (Andrew Morton's message of "Tue, 24 May 2016 12:24:55 -0700")
Andrew Morton <akpm@linux-foundation.org> writes:
> On Sat, 14 May 2016 00:25:28 +0800 Eryu Guan <guaneryu@gmail.com> wrote:
>
>> Currently direct writes inside i_size on a DIO_SKIP_HOLES filesystem are
>> not allowed to allocate blocks(get_more_blocks() sets 'create' to 0
>> before calling get_block() callback), if it's a sparse file, direct
>> writes fall back to buffered writes to avoid stale data exposure from
>> concurrent buffered read. But there're two cases that can result in
>> stale data exposure are not correctly detected.
>>
>> 1. The detection for "writing inside i_size" is not sufficient, writes
>> can be treated as "extending writes" wrongly. For example, direct write
>> 1FSB to a 1FSB sparse file on ext2/3/4, starting from offset 0, in this
>> case it's writing inside i_size, but 'create' is non-zero, because
>> 'block_in_file' and '(i_size_read(inode) >> blkbits' are both zero.
>
> um, what is an "FSB"?
File System Block, as opposed to a block device block. :)
-Jeff
prev parent reply other threads:[~2016-05-24 19:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-13 16:25 [PATCH v3] direct-io: fix direct write stale data exposure from concurrent buffered read Eryu Guan
2016-05-13 17:12 ` Jeff Moyer
2016-05-24 16:41 ` Jeff Moyer
2016-05-24 19:24 ` Andrew Morton
2016-05-24 19:39 ` Jeff Moyer [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=x49eg8r1bzp.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=guaneryu@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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).