Fix big endian issues

This commit is contained in:
Eric Sandeen 2011-11-08 20:40:21 -06:00
parent e0718d7ddf
commit c8c716f425
2 changed files with 53 additions and 1 deletions

View File

@ -0,0 +1,46 @@
Date: Tue, 08 Nov 2011 16:26:35 -0600
From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Subject: [PATCH] libext2: advance group in ext2fs_open2 during swapping
Without this change, we go back to getting group descriptor
"0" each time we go around the "for i" loop. It must properly
advance through the filesystem.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
(I couldn't decipher the removed comment; maybe it was typed when
you thought you would do:
gdp = ext2fs_group_desc(fs, dest, j);
which would also work ... ? It'd be clever, but I think my change
is more explicitly obvious. Either way works.
We still have failing tests but at least nothing hangs now:
Tests failed: f_mmp f_mmp_garbage m_mmp t_mmp_1on t_mmp_2off
diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index 0cefe3f..40a52c5 100644
--- a/lib/ext2fs/openfs.c
+++ b/lib/ext2fs/openfs.c
@@ -356,8 +356,8 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,
goto cleanup;
#ifdef WORDS_BIGENDIAN
for (j=0; j < groups_per_block; j++) {
- /* The below happens to work... be careful. */
- gdp = ext2fs_group_desc(fs, fs->group_desc, j);
+ gdp = ext2fs_group_desc(fs, fs->group_desc,
+ i * groups_per_block + j);
ext2fs_swap_group_desc2(fs, gdp);
}
#endif
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

View File

@ -4,7 +4,7 @@
Summary: Utilities for managing ext2, ext3, and ext4 filesystems
Name: e2fsprogs
Version: 1.42
Release: 0.5.WIP.1016%{?dist}
Release: 0.6.WIP.1016%{?dist}
# License tags based on COPYING file distinctions for various components
License: GPLv2
@ -15,6 +15,7 @@ Source0: http://prdownloads.sourceforge.net/e2fsprogs/e2fsprogs-1.42-WIP-1016.ta
Source1: ext2_types-wrapper.h
Patch1: e2fsprogs-1.40.4-sb_feature_check_ignore.patch
Patch2: e2fsprogs-1.42-bigendian-fix.patch
Url: http://e2fsprogs.sourceforge.net/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -151,6 +152,8 @@ It was originally inspired by the Multics SubSystem library.
# after an selinux install...
%patch1 -p1 -b .featurecheck
%patch2 -p1
%build
%configure --enable-elf-shlibs --enable-nls --disable-uuidd --disable-fsck \
--disable-e2initrd-helper --disable-libblkid --disable-libuuid
@ -319,6 +322,9 @@ exit 0
%{_libdir}/pkgconfig/ss.pc
%changelog
* Tue Nov 08 2011 Eric Sandeen <sandeen@redhat.com> 1.42-0.6.WIP.1016
- Fix e2fsck / make check on big endian arch
* Mon Oct 17 2011 Eric Sandeen <sandeen@redhat.com> 1.42-0.5.WIP.1016
- New upstream snapshot release