libext2: advance group in ext2fs_open2 during swapping
PATCH 1/1 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 <[email protected]>
---
(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
lib/ext2fs/openfs.c +2 -2
@@ -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
Ted Ts'o
AppliedQuoted 5 lines · Eric Sandeen
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 <[email protected]>
Thanks, applied.
- Ted