[PATCH 1/7] libext2fs: rec_len is set incorrect in ext2fs_process_dir_inline_data
From: Zheng Liu <hidden>
Date: 2012-11-15 08:01:09
Subsystem:
library code, the rest · Maintainers:
Andrew Morton, Linus Torvalds
From: Zheng Liu <hidden>
Date: 2012-11-15 08:01:09
Subsystem:
library code, the rest · Maintainers:
Andrew Morton, Linus Torvalds
From: Zheng Liu <redacted> A new dir doesn't be created in the parent dir with inline data due to this bug because rec_len is set incorrect. It will cause a wrong offset, and no free room can be found. Signed-off-by: Zheng Liu <redacted> --- lib/ext2fs/dir_iterate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/ext2fs/dir_iterate.c b/lib/ext2fs/dir_iterate.c
index 3f94ad4..198c5aa 100644
--- a/lib/ext2fs/dir_iterate.c
+++ b/lib/ext2fs/dir_iterate.c@@ -335,7 +335,8 @@ int ext2fs_process_dir_inline_data(ext2_filsys fs, entry++; if (ret & DIRENT_CHANGED) { - dirent->rec_len = rec_len; + if (ext2fs_get_rec_len(fs, dirent, &rec_len)) + return BLOCK_ABORT; changed++; } if (ret & DIRENT_ABORT) {
--
1.7.12.rc2.18.g61b472e