Re: [PATCH 07/17] btrfs: allow btrfs_submit_bio to split bios

Christoph Hellwig
2022-09-12T13:58:42Z

On Wed, Sep 07, 2022 at 04:55:45PM -0400, Josef Bacik wrote:
> I'm worried about this for the ONE_ORDERED case. We specifically used the
> ONE_ORDERED thing because our file_offset was the start, but our length could go
> past the range of the ordered extent, and then we wouldn't find our ordered
> extent and things would go quite wrong.
>
> Instead we should do something like
>
> if (!(orig->bi_opf & REQ_BTRFS_ONE_ORDERED))
> orig_bbio->file_offset += map_length;
>
> I've cc'ed Omar since he's the one who added this and I'm a little confused
> about how this can happen.

I have to say I found the logic quite confusing as well, and when I
broke it during development of this series xfstests did not complain
either. So shedding some more light on the flag would be really
helpful.