Re: [PATCH] btrfs: fix NULL end_io call when submitting a repair read fails

From: Miroslav Cimerman

Date: Mon Nov 23 2026 - 18:17:26 EST


Qu Wenruo <wqu@xxxxxxxx> wrote:

> This looks overkilled to me.
>
> If the end_io is no-op, why not just define a no-op end_io for it?

A no-op end_io avoids the NULL call, but then btrfs_end_repair_bio()
never runs for that repair bio. The original read waits for it and never
finishes, and no other mirror is tried. I tried it with the same
test-only injection, and the read hung in 5 of 5 runs. A direct call to
btrfs_end_repair_bio() would nest once per mirror, and on RAID6 the
number of mirrors is the number of devices. So it is queued on the end
I/O workqueue.

Miroslav