summaryrefslogtreecommitdiff
path: root/lib/ext2fs
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2011-11-10 07:02:04 -0500
committerTheodore Ts'o <tytso@mit.edu>2011-11-10 07:02:04 -0500
commitfc4fd955f705bdbdf5512b1c739191f17d483135 (patch)
tree88d836f47ca66243eba35580642ade5bb5bd8d9b /lib/ext2fs
parent1e40ef8ee44cdf632958b884afe33c50e7d4c02e (diff)
downloade2fsprogs-fc4fd955f705bdbdf5512b1c739191f17d483135.tar.gz
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> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'lib/ext2fs')
-rw-r--r--lib/ext2fs/openfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index 0cefe3fd..40a52c54 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