From: Josef Bacik <josef@toxicpanda.com>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>,
David Sterba <dsterba@suse.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 2/3] btrfs: zoned: fix compressed writes
Date: Sun, 23 May 2021 10:13:40 -0400 [thread overview]
Message-ID: <563c1ac3-abf3-3f60-dbdf-362ebc69eb28@toxicpanda.com> (raw)
In-Reply-To: <1220142568f5b5f0d06fbc3ee28a08060afc0a53.1621351444.git.johannes.thumshirn@wdc.com>
On 5/18/21 11:40 AM, Johannes Thumshirn wrote:
> When multiple processes write data to the same block group on a compressed
> zoned filesystem, the underlying device could report I/O errors and data
> corruption is possible.
>
> This happens because on a zoned file system, compressed data writes where
> sent to the device via a REQ_OP_WRITE instead of a REQ_OP_ZONE_APPEND
> operation. But with REQ_OP_WRITE and parallel submission it cannot be
> guaranteed that the data is always submitted aligned to the underlying
> zone's write pointer.
>
> The change to using REQ_OP_ZONE_APPEND instead of REQ_OP_WRITE on a zoned
> filesystem is non intrusive on a regular file system or when submitting to
> a conventional zone on a zoned filesystem, as it is guarded by
> btrfs_use_zone_append.
>
> Reported-by: David Sterba <dsterba@suse.com>
> Fixes: 9d294a685fbc ("btrfs: zoned: enable to mount ZONED incompat flag")
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
This one is causing panics with btrfs/027 with -o compress. I bisected it to
something else earlier, but it was still happening today and I bisected again
and this is what popped out. I also went the extra step to revert the patch as
I have already fucked this up once, and the problem didn't re-occur with this
patch reverted. The panic looks like this
May 22 00:33:16 xfstests2 kernel: BTRFS critical (device dm-9): mapping failed
logical 22429696 bio len 53248 len 49152
May 22 00:33:16 xfstests2 kernel: ------------[ cut here ]------------
May 22 00:33:16 xfstests2 kernel: kernel BUG at fs/btrfs/volumes.c:6643!
May 22 00:33:16 xfstests2 kernel: invalid opcode: 0000 [#1] SMP NOPTI
May 22 00:33:16 xfstests2 kernel: CPU: 1 PID: 2236088 Comm: kworker/u4:4 Not
tainted 5.13.0-rc2+ #240
May 22 00:33:16 xfstests2 kernel: Hardware name: QEMU Standard PC (Q35 + ICH9,
2009), BIOS 1.13.0-2.fc32 04/01/2014
May 22 00:33:16 xfstests2 kernel: Workqueue: btrfs-delalloc btrfs_work_helper
May 22 00:33:16 xfstests2 kernel: RIP: 0010:btrfs_map_bio.cold+0x58/0x5a
May 22 00:33:16 xfstests2 kernel: Code: 50 e8 6b 83 ff ff e8 5b 0d 88 ff 48 83
c4 18 e9 94 8f 88 ff 48 8b 3c 24 4c 89 f1 4c 89 fa 48 c7 c6 f8 db 62 96 e8 47 83
ff ff <0f> 0b 4c 89 e7 e8 52 1f 83 ff e9 03 98 88 ff 49 8b 7a 50 44 89 f2
May 22 00:33:16 xfstests2 kernel: RSP: 0018:ffffb310c1de7c88 EFLAGS: 00010282
May 22 00:33:16 xfstests2 kernel: RAX: 0000000000000055 RBX: 0000000000000000
RCX: 0000000000000000
May 22 00:33:16 xfstests2 kernel: RDX: ffff9b9a7bd27540 RSI: ffff9b9a7bd18e10
RDI: ffff9b9a7bd18e10
May 22 00:33:16 xfstests2 kernel: RBP: ffff9b9a482ad7f8 R08: 0000000000000000
R09: 0000000000000000
May 22 00:33:16 xfstests2 kernel: R10: ffffb310c1de7a48 R11: ffffffff96973748
R12: 0000000000000000
May 22 00:33:16 xfstests2 kernel: R13: ffff9b9a001e7300 R14: 000000000000d000
R15: 0000000001564000
May 22 00:33:16 xfstests2 kernel: FS: 0000000000000000(0000)
GS:ffff9b9a7bd00000(0000) knlGS:0000000000000000
May 22 00:33:16 xfstests2 kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
May 22 00:33:16 xfstests2 kernel: CR2: 00005621fe4566e0 CR3: 000000013943a005
CR4: 0000000000370ee0
May 22 00:33:16 xfstests2 kernel: Call Trace:
May 22 00:33:16 xfstests2 kernel: btrfs_submit_compressed_write+0x2d7/0x470
May 22 00:33:16 xfstests2 kernel: submit_compressed_extents+0x364/0x420
May 22 00:33:16 xfstests2 kernel: ? lock_acquire+0x15d/0x380
May 22 00:33:16 xfstests2 kernel: ? lock_release+0x1cd/0x2a0
May 22 00:33:16 xfstests2 kernel: ? submit_compressed_extents+0x420/0x420
May 22 00:33:16 xfstests2 kernel: btrfs_work_helper+0x133/0x520
May 22 00:33:16 xfstests2 kernel: process_one_work+0x26b/0x570
May 22 00:33:16 xfstests2 kernel: worker_thread+0x55/0x3c0
May 22 00:33:16 xfstests2 kernel: ? process_one_work+0x570/0x570
May 22 00:33:16 xfstests2 kernel: kthread+0x134/0x150
May 22 00:33:16 xfstests2 kernel: ? __kthread_bind_mask+0x60/0x60
May 22 00:33:16 xfstests2 kernel: ret_from_fork+0x1f/0x30
Thanks,
Josef
next prev parent reply other threads:[~2021-05-23 14:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-18 15:40 [PATCH v2 0/3] btrfs: zoned: fix writes on a compressed zoned filesystem Johannes Thumshirn
2021-05-18 15:40 ` [PATCH v2 1/3] btrfs: zoned: pass start block to btrfs_use_zone_append Johannes Thumshirn
2021-05-18 15:40 ` [PATCH v2 2/3] btrfs: zoned: fix compressed writes Johannes Thumshirn
2021-05-23 14:13 ` Josef Bacik [this message]
2021-05-23 23:09 ` Qu Wenruo
2021-05-24 13:04 ` Qu Wenruo
2021-05-24 13:30 ` David Sterba
2021-05-25 6:31 ` Johannes Thumshirn
2021-05-25 5:46 ` Johannes Thumshirn
2021-06-10 7:27 ` Qu Wenruo
2021-06-10 7:36 ` Damien Le Moal
2021-06-10 7:41 ` Qu Wenruo
2021-06-10 7:45 ` Damien Le Moal
2021-06-10 7:51 ` Qu Wenruo
2021-06-10 8:28 ` Johannes Thumshirn
2021-05-18 15:40 ` [PATCH v2 3/3] btrfs: zoned: factor out zoned device lookup Johannes Thumshirn
2021-05-24 10:00 ` Qu Wenruo
2021-05-25 9:11 ` Johannes Thumshirn
2021-05-20 15:05 ` [PATCH v2 0/3] btrfs: zoned: fix writes on a compressed zoned filesystem David Sterba
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=563c1ac3-abf3-3f60-dbdf-362ebc69eb28@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=dsterba@suse.com \
--cc=johannes.thumshirn@wdc.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).