[PATCH 1/7] libext2fs: rec_len is set incorrect in ext2fs_process_dir_inline_data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Zheng Liu <wenqing.lz@xxxxxxxxxx>

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 <wenqing.lz@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux