linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Filipe Manana <fdmanana@kernel.org>
To: "Марк Коренберг" <socketpair@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Major bug in BTRFS (syncs are ignored with libaio or io_uring)
Date: Fri, 28 Oct 2022 11:23:42 +0100	[thread overview]
Message-ID: <CAL3q7H7RmDV2Xe2+Fb11Jr=NqPWQtw9V=En6JR1swS6Ocr5Z-w@mail.gmail.com> (raw)
In-Reply-To: <CAEmTpZGRKbzc16fWPvxbr6AfFsQoLmz-Lcg-7OgJOZDboJ+SGQ@mail.gmail.com>

On Thu, Oct 27, 2022 at 11:08 PM Марк Коренберг <socketpair@gmail.com> wrote:
>
> 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 confirm that the syncing is not happening often when using aio
(either old aio or io_uring).
I understand why it's happening, so I'll work on a fix for that.

Thanks for the report.

>
>
> 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

  parent reply	other threads:[~2022-10-28 10:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 21:21 Major bug in BTRFS (syncs are ignored with libaio or io_uring) Марк Коренберг
2022-10-28  4:30 ` Andrei Borzenkov
2022-10-28  4:48   ` Марк Коренберг
2022-10-28 10:23 ` Filipe Manana [this message]
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='CAL3q7H7RmDV2Xe2+Fb11Jr=NqPWQtw9V=En6JR1swS6Ocr5Z-w@mail.gmail.com' \
    --to=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=socketpair@gmail.com \
    /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).