Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: kreijack@inwind.it, linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: BUG: BTRFS and O_DIRECT could lead to wrong checksum and wrong data
Date: Fri, 15 Sep 2017 06:55:54 +0300	[thread overview]
Message-ID: <3fc175a8-a61b-6060-5c78-abbbe2e61037@gmail.com> (raw)
In-Reply-To: <cf8a733f-2c9d-7ffe-e865-4c13d99dfb60@libero.it>

15.09.2017 01:00, Goffredo Baroncelli пишет:
> 
> 2) The second bug, is a more severe bug. If during a writing of a buffer with O_DIRECT, the buffer is updated at the same time by a second process, the checksum may be incorrect.
> 

Is it btrfs specific? If buffer is updated before it was actually
consumed by kernel, this likely means data corruption on any filesystem.
I.e. there should be clear indication from kernel that buffer can be
reused by application, in your example - when pwrite returns. So when
data corruption happens - during pwrite or after? If data is corrupted
during pwrite, it is arguably application fault - it should disallow
concurrent access.

  parent reply	other threads:[~2017-09-15  3:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14 22:00 BUG: BTRFS and O_DIRECT could lead to wrong checksum and wrong data Goffredo Baroncelli
2017-09-14 22:18 ` Hugo Mills
2017-09-15  6:04   ` Goffredo Baroncelli
2017-09-15  8:26     ` Hugo Mills
2017-09-15  9:50       ` Marat Khalili
2017-09-15 10:12         ` Paul Jones
2017-09-15 17:37         ` Goffredo Baroncelli
2017-09-15 17:14       ` Goffredo Baroncelli
2017-09-15  3:55 ` Andrei Borzenkov [this message]
2017-09-15  5:50   ` Goffredo Baroncelli
2017-09-15 17:01     ` Andrei Borzenkov
2017-09-15 17:30       ` Goffredo Baroncelli
2017-09-15 17:01 ` Liu Bo
2017-09-15 18:57   ` Goffredo Baroncelli
2017-09-15 19:14     ` Liu Bo

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=3fc175a8-a61b-6060-5c78-abbbe2e61037@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=kreijack@inwind.it \
    --cc=linux-btrfs@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