[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1435603176-63219-4-git-send-email-jaegeuk@kernel.org>
Date: Mon, 29 Jun 2015 11:39:28 -0700
From: Jaegeuk Kim <jaegeuk@...nel.org>
To: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@...nel.org>
Subject: [PATCH 04/12] f2fs: remove wrong f2fs_bug_on when merging extents
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@...nel.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists