Bug 2117971 - io_uring / libaio on non-COW files on btrfs seems ignore data flush requests(sync).
Summary: io_uring / libaio on non-COW files on btrfs seems ignore data flush requests(...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: fedora-kernel-btrfs
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-13 00:32 UTC by Коренберг Марк
Modified: 2023-06-10 21:53 UTC (History)
21 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-10 21:53:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Коренберг Марк 2022-08-13 00:32:58 UTC
How to reproduce (I tested in Fedora 36 (kernel 5.19.2) and also on rawhide 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.

Comment 1 Коренберг Марк 2022-08-24 21:32:09 UTC
https://bugzilla.kernel.org/show_bug.cgi?id=216408- I made the same bug report here.

Comment 2 Chris Murphy 2022-10-27 01:23:59 UTC
Does this reproduce on a 6.0 or 6.1 kernel? e.g. kernel 6.0.5 is available in koji for f35, f36, f37: https://koji.fedoraproject.org/koji/packageinfo?packageID=8 pick the release version then pick the kernel files for your architecture: kernel, kernel-core, kernel-modules are usually all that's needed; then cd to the download directory and 'dnf install *rpm'

Comment 3 Chris Murphy 2022-10-27 01:28:12 UTC
Also, ideally btrfs bugs get reported in both rhbz (for attachments and tracking patches if needed), and also the upstream mailing list: https://btrfs.wiki.kernel.org/index.php/Btrfs_mailing_list
Not much of the kernel is actually tracked on the kernel.org bugzilla these days :\ But also the upstream list will usually want to know if the problem happens with most recent stable (6.0 series) or mainline (6.1 series).

Comment 4 Коренберг Марк 2022-10-27 21:17:18 UTC
I have checked on rawhide's kernel 6.1.0-0.rc2.21.fc38.x86_64

Bug is till triggered.

Comment 5 tslanyse 2022-10-28 08:26:49 UTC
Yeah, me neither!

any updates?


Note You need to log in before you can comment on or make changes to this bug.