linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Марк Коренберг" <socketpair@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Major bug in BTRFS (syncs are ignored with libaio or io_uring)
Date: Fri, 28 Oct 2022 00:21:04 +0300	[thread overview]
Message-ID: <CAEmTpZGRKbzc16fWPvxbr6AfFsQoLmz-Lcg-7OgJOZDboJ+SGQ@mail.gmail.com> (raw)

How to reproduce (I tested in kernel 6.1):

2.  mkfs.btrfs over a partition.
3.  mount -o lazytime,noatime
4.  touch file.dat
5.  chattr +C file.dat # turns off compression, checksumming and COW
6.  fallocate -l1G file.dat
7.  # prefill the file with random data
    fio -ioengine=psync                      -name=test -bs=1M
-rw=write                 -filename=file.dat
8.  fio -ioengine=psync    -sync=1 -direct=1 -name=test -bs=4k
-rw=randwrite -runtime=60 -filename=file.dat  # Will show, say, 2K
IOPs
9.  fio -ioengine=io_uring -sync=1 -direct=1 -name=test -bs=4k
-rw=randwrite -runtime=60 -filename=file.dat  # Will show, say, 32K
IOPs
10. fio -ioengine=libaio   -sync=1 -direct=1 -name=test -bs=4k
-rw=randwrite -runtime=60 -filename=file.dat  # Will show, say, 32K
IOPs

Steps 9 and 10 show implausible IOPs.

This does not happen on, say, Ext4 (all the methods give roughly the same IOPs).

Removing -sync=1 on all engines on Ext4 gives immediate return (as
expected because everything gets merged and finally written very fast)

Adding/Removing -sync=1 with io_uring or libaio changes nothing on
BTRFS (it's definitely a bug)


I consider it's a bug in BTRFS. Very important bug because BTRFS
becomes default FS in Fedora server/desktop now. This bug may cause
data loss. That's why I set this bug as high priority.


*****************
https://bugzilla.redhat.com/show_bug.cgi?id=2117971
*****************


-- 
Segmentation fault

             reply	other threads:[~2022-10-27 21:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 21:21 Марк Коренберг [this message]
2022-10-28  4:30 ` Major bug in BTRFS (syncs are ignored with libaio or io_uring) Andrei Borzenkov
2022-10-28  4:48   ` Марк Коренберг
2022-10-28 10:23 ` Filipe Manana
2022-11-11 12:01   ` Filipe Manana

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=CAEmTpZGRKbzc16fWPvxbr6AfFsQoLmz-Lcg-7OgJOZDboJ+SGQ@mail.gmail.com \
    --to=socketpair@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).