[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dc394cf0-337d-a216-2fb2-8813e4c82575@huaweicloud.com>
Date: Wed, 29 May 2024 14:08:20 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: Christoph Hellwig <hch@...radead.org>, Li Nan <linan666@...weicloud.com>
Cc: song@...nel.org, linux-raid@...r.kernel.org,
linux-kernel@...r.kernel.org, yi.zhang@...wei.com, houtao1@...wei.com,
yangerkun@...wei.com, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH v2] md: make md_flush_request() more readable
Hi,
在 2024/05/29 13:44, Christoph Hellwig 写道:
> On Tue, May 28, 2024 at 09:49:44PM +0800, Li Nan wrote:
>>
>>
>> 在 2024/5/28 21:23, Christoph Hellwig 写道:
>>> Looks good:
>>>
>>> Reviewed-by: Christoph Hellwig <hch@....de>
>>>
>>> .
>> As suggested by Kuai, I will use bio_sectors instead of bi_size in v3.
>>
>> - if (bio->bi_iter.bi_size == 0) {
>> + if (!bio_sectors(bio)) {
>
> That looks weird. bio_sectors literally just shifts
> bio->bi_iter.bi_size to be in units of sectors, which doesn't
> matter for comparing with 0.
The block layer use the same code several times to check if flush bio
contain data, for example:
submit_bio_noacct
if (op_is_flush(bio->bi_opf))
if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
if (!bio_sectors(bio))
bio_endio(bio);
Or will the bi_size to be less than one sector?
Thanks,
Kuai
>
> .
>
Powered by blists - more mailing lists