Skip to contentSkip to conversation

libext2fs: last of the incorrect direct group_desc accesses

PATCH Applied Eric Sandeen 2 participants 2 messages Sep 3, 2009 – Sep 6, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libext2fs: last of the incorrect direct group_desc accesses

This should be, I hope, the last of the fixes for accessing the group descriptors directly in libext2fs, at least.

Soon we should make it opaque to avoid this mess.

---

lib/ext2fs/openfs.c +1 -1
Index: e2fsprogs/lib/ext2fs/openfs.c
===================================================================
@@ -355,7 +355,7 @@ errcode_t ext2fs_open2(const char *name,
 		for (group = 0; group < fs->group_desc_count; group++) {
 			ext2fs_bg_flag_clear(fs, group, EXT2_BG_BLOCK_UNINIT);
 			ext2fs_bg_flag_clear(fs, group, EXT2_BG_INODE_UNINIT);
-			fs->group_desc[group].bg_itable_unused = 0;
+			ext2fs_bg_itable_unused_set(fs, group, 0);
 		}
 		ext2fs_mark_super_dirty(fs);
 	}
e2fsck/pass2.c +1 -1
Index: e2fsprogs/e2fsck/pass2.c
===================================================================
@@ -1003,7 +1003,7 @@ out_htree:
 		} else if (dirent->inode >= first_unused_inode) {
 			pctx.num = dirent->inode;
 			if (fix_problem(ctx, PR_2_INOREF_IN_UNUSED, &cd->pctx)){
-				fs->group_desc[group].bg_itable_unused = 0;
+				ext2fs_bg_itable_unused_set(fs, group, 0);
 				ext2fs_mark_super_dirty(fs);
 				ctx->flags |= E2F_FLAG_RESTART_LATER;
 			} else {
Applied
#1 lore raw
Quoted 2 lines · Eric Sandeen

This should be, I hope, the last of the fixes for accessing the group descriptors directly in libext2fs, at least.

Applied to the 64-bit patch set / pu branch of e2fsprogs.

- Ted