lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <73ce25dd-ce6e-4482-8537-b4f2166bbc47@kernel.org>
Date: Mon, 1 Sep 2025 15:51:23 +0900
From: Damien Le Moal <dlemoal@...nel.org>
To: Yu Kuai <yukuai1@...weicloud.com>, Yu Kuai <hailan@...uai.org.cn>,
 axboe@...nel.dk, tj@...nel.org, josef@...icpanda.com, song@...nel.org,
 neil@...wn.name, akpm@...ux-foundation.org, hch@...radead.org,
 colyli@...nel.org, hare@...e.de, tieren@...as.com
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
 cgroups@...r.kernel.org, linux-raid@...r.kernel.org, yi.zhang@...wei.com,
 yangerkun@...wei.com, johnny.chenyi@...wei.com,
 "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH RFC v2 09/10] block: fix disordered IO in the case
 recursive split

On 9/1/25 11:40 AM, Yu Kuai wrote:
> Hi,
> 
> 在 2025/08/30 12:28, Yu Kuai 写道:
>>>> @@ -745,12 +745,16 @@ void submit_bio_noacct_nocheck(struct bio *bio)
>>>>        * to collect a list of requests submited by a ->submit_bio method while
>>>>        * it is active, and then process them after it returned.
>>>>        */
>>>> -    if (current->bio_list)
>>>> -        bio_list_add(&current->bio_list[0], bio);
>>>> -    else if (!bdev_test_flag(bio->bi_bdev, BD_HAS_SUBMIT_BIO))
>>>> +    if (current->bio_list) {
>>>> +        if (split)
>>>> +            bio_list_add_head(&current->bio_list[0], bio);
>>>> +        else
>>>> +            bio_list_add(&current->bio_list[0], bio);
>>> This really needs a comment clarifying why we do an add at tail instead of
>>> keeping the original order with a add at head. I am also scared that this may
>>> break sequential write ordering for zoned devices.
>>
>> I think add at head is exactly what we do here to keep the orginal order for
>> the case bio split. Other than split, if caller do generate multiple sequential
>> bios, we should keep the order by add at tail.
>>
>> Not sure about zoned devices for now, I'll have a look in details.
> 
> For zoned devices, can we somehow trigger this recursive split? I
> suspect bio disordered will apear in this case but I don't know for
> now and I can't find a way to reporduce it.

dm-linear can be stacked on e.g. dm-crypt, or the reverse. So recursive
splitting may be possible. Though since for DM everything is zone aligned, it
may be hard to find a reproducer. Though dm-crypt will always split BIOs to
BIO_MAX_VECS << PAGE_SECTORS_SHIFT sectors, so it may be possible with very
large BIOs. Would need to try, but really overloaded with other things right now.

> 
> Perhaps I can bypass zoned devices for now, and if we really met the
> recursive split case and there is a problem, we can fix it later:
> 
> if (split && !bdev_is_zoned(bio->bi_bdev))
>     bio_list_add_head()
> 
> Thanks,
> Kuai
> 


-- 
Damien Le Moal
Western Digital Research

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ