From: brookxu <brookxu.cn@gmail.com>
To: adilger.kernel@dilger.ca, tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: [PATCH v2] ext4: delete invalid ac_b_extent backup inside ext4_mb_use_best_found()
Date: Fri, 7 Aug 2020 19:32:20 +0800 [thread overview]
Message-ID: <0c77de22-c0d0-4c1b-645a-865bcd2edc0a@gmail.com> (raw)
Delete invalid ac_b_extent backup inside ext4_mb_use_best_found(),
we have done this operation in ext4_mb_new_group_pa() and
ext4_mb_new_inode_pa().
Signed-off-by: Chunguang Xu <brookxu@tencent.com>
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 9b1c3ad..fb63e9f 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -1704,10 +1704,6 @@ static void ext4_mb_use_best_found(struct ext4_allocation_context *ac,
ac->ac_b_ex.fe_logical = ac->ac_g_ex.fe_logical;
ret = mb_mark_used(e4b, &ac->ac_b_ex);
- /* preallocation can change ac_b_ex, thus we store actually
- * allocated blocks for history */
- ac->ac_f_ex = ac->ac_b_ex;
-
ac->ac_status = AC_STATUS_FOUND;
ac->ac_tail = ret & 0xffff;
ac->ac_buddy = ret >> 16;
@@ -1726,8 +1722,8 @@ static void ext4_mb_use_best_found(struct ext4_allocation_context *ac,
/* store last allocated for subsequent stream allocation */
if (ac->ac_flags & EXT4_MB_STREAM_ALLOC) {
spin_lock(&sbi->s_md_lock);
- sbi->s_mb_last_group = ac->ac_f_ex.fe_group;
- sbi->s_mb_last_start = ac->ac_f_ex.fe_start;
+ sbi->s_mb_last_group = ac->ac_b_ex.fe_group;
+ sbi->s_mb_last_start = ac->ac_b_ex.fe_start;
spin_unlock(&sbi->s_md_lock);
}
/*
--
1.8.3.1
next reply other threads:[~2020-08-07 11:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-07 11:32 brookxu [this message]
2020-08-13 8:44 ` [PATCH v2] ext4: delete invalid ac_b_extent backup inside ext4_mb_use_best_found() Andreas Dilger
2020-08-13 9:08 ` brookxu
2020-08-13 11:01 ` Ritesh Harjani
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=0c77de22-c0d0-4c1b-645a-865bcd2edc0a@gmail.com \
--to=brookxu.cn@gmail.com \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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