From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 04/12] f2fs: remove wrong f2fs_bug_on when merging extents
Date: Mon, 29 Jun 2015 11:39:28 -0700 [thread overview]
Message-ID: <1435603176-63219-4-git-send-email-jaegeuk@kernel.org> (raw)
In-Reply-To: <1435603176-63219-1-git-send-email-jaegeuk@kernel.org>
In f2fs_update_extent_tree, if there is existing extent, f2fs tries to split
it with two parts.
In each trial, __insert_extent_tree checks __is_front/back_mergeable, and then
if it hits to go, there is f2fs_bug_on(!den), which triggers a kernel panic.
Actually, we don't need to check this. Instead, we can do __try_back_merge only
when there exists a den pointer.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/data.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 9bedfa8..7817167 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -519,19 +519,19 @@ static struct extent_node *__insert_extent_tree(struct f2fs_sb_info *sbi,
if (ei->fofs < en->ei.fofs) {
if (__is_front_mergeable(ei, &en->ei)) {
- f2fs_bug_on(sbi, !den);
en->ei.fofs = ei->fofs;
en->ei.blk = ei->blk;
en->ei.len += ei->len;
- *den = __try_back_merge(sbi, et, en);
+ if (den)
+ *den = __try_back_merge(sbi, et, en);
return en;
}
p = &(*p)->rb_left;
} else if (ei->fofs >= en->ei.fofs + en->ei.len) {
if (__is_back_mergeable(ei, &en->ei)) {
- f2fs_bug_on(sbi, !den);
en->ei.len += ei->len;
- *den = __try_front_merge(sbi, et, en);
+ if (den)
+ *den = __try_front_merge(sbi, et, en);
return en;
}
p = &(*p)->rb_right;
--
2.1.1
next prev parent reply other threads:[~2015-06-29 18:42 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-29 18:39 [PATCH 01/12] f2fs: avoid freed stat information Jaegeuk Kim
2015-06-29 18:39 ` [PATCH 02/12] f2fs: avoid to use failed inode immediately Jaegeuk Kim
2015-06-30 2:54 ` [f2fs-dev] " Chao Yu
2015-06-29 18:39 ` [PATCH 03/12] f2fs: convert inline_data for various fallocate Jaegeuk Kim
2015-06-30 2:58 ` [f2fs-dev] " Chao Yu
2015-06-29 18:39 ` Jaegeuk Kim [this message]
2015-06-30 3:00 ` [f2fs-dev] [PATCH 04/12] f2fs: remove wrong f2fs_bug_on when merging extents Chao Yu
2015-07-01 1:02 ` Jaegeuk Kim
2015-06-29 18:39 ` [PATCH 05/12] f2fs: fix wrong block address calculation for a split extent Jaegeuk Kim
2015-06-30 3:08 ` [f2fs-dev] " Chao Yu
2015-06-29 18:39 ` [PATCH 06/12] f2fs: update on-disk extents even under extent_cache Jaegeuk Kim
2015-06-30 3:10 ` [f2fs-dev] " Chao Yu
2015-06-29 18:39 ` [PATCH 07/12] f2fs: set cached_en after checking finally Jaegeuk Kim
2015-06-30 3:26 ` [f2fs-dev] " Chao Yu
2015-06-29 18:39 ` [PATCH 08/12] f2fs: introduce a shrinker for mounted fs Jaegeuk Kim
2015-06-30 3:43 ` [f2fs-dev] " Chao Yu
2015-07-01 1:28 ` Jaegeuk Kim
2015-07-02 12:32 ` Chao Yu
2015-07-04 4:51 ` Jaegeuk Kim
2015-06-29 18:39 ` [PATCH 09/12] f2fs: shrink nat_cache entries Jaegeuk Kim
2015-07-02 12:33 ` [f2fs-dev] " Chao Yu
2015-06-29 18:39 ` [PATCH 10/12] f2fs: shrink extent_cache entries Jaegeuk Kim
2015-07-02 12:34 ` [f2fs-dev] " Chao Yu
2015-06-29 18:39 ` [PATCH 11/12] f2fs: add noextent_cache mount option Jaegeuk Kim
2015-07-02 12:35 ` [f2fs-dev] " Chao Yu
2015-07-04 4:57 ` Jaegeuk Kim
2015-06-29 18:39 ` [PATCH 12/12] f2fs: use extent_cache by default Jaegeuk Kim
2015-07-02 12:36 ` [f2fs-dev] " Chao Yu
2015-07-04 5:16 ` Jaegeuk Kim
2015-07-04 6:30 ` Chao Yu
2015-07-06 12:26 ` Chao Yu
2015-06-30 2:45 ` [f2fs-dev] [PATCH 01/12] f2fs: avoid freed stat information Chao Yu
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=1435603176-63219-4-git-send-email-jaegeuk@kernel.org \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome