Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ece5803
)
e2fsck: skip sorting extents if there are no valid extents
author
Harshad Shirwadkar
<harshadshirwadkar@gmail.com>
Wed, 17 Nov 2021 16:50:15 +0000
(08:50 -0800)
committer
Theodore Ts'o
<tytso@mit.edu>
Fri, 3 Dec 2021 19:56:18 +0000
(14:56 -0500)
At the end of a fast commit replay, e2fsck tries merging extents in a
inode. This patch fixes a bug in this logic where we were continuing
this action even if there were no extents to merge resulting in
accessing illegal memory.
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
e2fsck/journal.c
patch
|
blob
|
history
diff --git
a/e2fsck/journal.c
b/e2fsck/journal.c
index
fe4e018
..
2e86723
100644
(file)
--- a/
e2fsck/journal.c
+++ b/
e2fsck/journal.c
@@
-464,6
+464,9
@@
static void ex_sort_and_merge(struct extent_list *list)
}
}
+ if (list->count == 0)
+ return;
+
/* Now sort by logical offset */
qsort(list->extents, list->count, sizeof(list->extents[0]),
ex_compar);