From: Baokun Li <libaokun1@huawei.com>
To: Ritesh Harjani <ritesh.list@gmail.com>
Cc: <linux-ext4@vger.kernel.org>, <tytso@mit.edu>,
<adilger.kernel@dilger.ca>, <jack@suse.cz>,
<linux-kernel@vger.kernel.org>, <yi.zhang@huawei.com>,
<yebin10@huawei.com>, <yukuai3@huawei.com>
Subject: Re: [PATCH 2/2] ext4: correct the judgment of BUG in ext4_mb_normalize_request
Date: Tue, 24 May 2022 14:09:35 +0800 [thread overview]
Message-ID: <371b06da-e3e4-f717-234c-bfb32d323b5f@huawei.com> (raw)
In-Reply-To: <20220523200844.fal3pmp7epid3rvv@riteshh-domain>
在 2022/5/24 4:08, Ritesh Harjani 写道:
> On 22/05/21 09:42PM, Baokun Li wrote:
>> When either of the "start + size <= ac->ac_o_ex.fe_logical" or
>> "start > ac->ac_o_ex.fe_logical" conditions is met, it indicates
>> that the fe_logical is not in the allocated range.
> Sounds about right to me based on the logic in ext4_mb_use_inode_pa().
> We try to allocate/preallocate such that ac->ac_o_ex.fe_logical should fall
> within the preallocated range. So if our start or start + size doesn't include
> fe_logical then it is a bug in the ext4_mb_normalize_request() logic.
Yes, exactly.
> But should we be so harsh to hit a bug_on() or make it warn_on()?
I don't think hit a bug_on() is a problem. BUG_ON is not triggered here
and will be triggered later.
> Also did you run any fs tests with this change.
Yes, I ran xfstests on ext3 and ext4 and found no problems.
> Since it looks like this
> logic existed since mballoc was introduced.
>
Yes, on our coverage report, those lines of code never seem to get there.
>> In this case, it should be bug_ON.
>>
>> Fixes: dfe076c106f6 ("ext4: get rid of code duplication")
> No, there is no issue with this patch. It correctly just removes the duplicate
> logic.
Okay, I'm going to remove this tag.
>> Signed-off-by: Baokun Li<libaokun1@huawei.com>
>> ---
>> fs/ext4/mballoc.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
>> index 32410b79b664..d0fb57970648 100644
>> --- a/fs/ext4/mballoc.c
>> +++ b/fs/ext4/mballoc.c
>> @@ -4190,7 +4190,7 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac,
>> }
>> rcu_read_unlock();
>>
>> - if (start + size <= ac->ac_o_ex.fe_logical &&
>> + if (start + size <= ac->ac_o_ex.fe_logical ||
>> start > ac->ac_o_ex.fe_logical) {
>> ext4_msg(ac->ac_sb, KERN_ERR,
>> "start %lu, size %lu, fe_logical %lu",
>> --
>> 2.31.1
>>
> .
--
With Best Regards,
Baokun Li
prev parent reply other threads:[~2022-05-24 6:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-21 13:42 [PATCH 0/2] ext4: fix two bugs in ext4_mb_normalize_request Baokun Li
2022-05-21 13:42 ` [PATCH 1/2] ext4: fix bug_on ext4_mb_use_inode_pa Baokun Li
2022-05-23 9:29 ` Jan Kara
2022-05-23 9:58 ` Lukas Czerner
[not found] ` <2525e39a-5be9-bae1-b77d-60f583892868@huawei.com>
2022-05-24 12:11 ` Lukas Czerner
2022-05-24 12:42 ` Baokun Li
2022-05-23 19:51 ` Ritesh Harjani
2022-05-21 13:42 ` [PATCH 2/2] ext4: correct the judgment of BUG in ext4_mb_normalize_request Baokun Li
2022-05-23 9:40 ` Jan Kara
[not found] ` <3755e40b-f817-83df-b239-b0697976c272@huawei.com>
2022-05-24 9:30 ` Jan Kara
2022-05-24 13:44 ` Baokun Li
2022-05-25 11:29 ` Jan Kara
2022-05-26 1:16 ` Baokun Li
2022-05-23 10:05 ` Lukas Czerner
2022-05-23 20:08 ` Ritesh Harjani
2022-05-23 21:08 ` Jan Kara
2022-05-24 6:26 ` Ritesh Harjani
2022-05-24 9:39 ` Jan Kara
2022-05-24 17:31 ` Ritesh Harjani
2022-05-25 12:12 ` Jan Kara
2022-05-24 6:09 ` Baokun Li [this message]
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=371b06da-e3e4-f717-234c-bfb32d323b5f@huawei.com \
--to=libaokun1@huawei.com \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ritesh.list@gmail.com \
--cc=tytso@mit.edu \
--cc=yebin10@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai3@huawei.com \
/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