Thread: [ext2resize] Releasing version 1.1.20?
Status: Inactive
Brought to you by:
adilger
From: Petter R. <pe...@hu...> - 2006-06-10 07:00:38
|
I believe it is time to release a new version of ext2prepare. I've compared CVS with the patches in the Debian package, and the only two remaining ones is the big endian fix and the disabling of offline resizing support in ext2online. I believe 1.1.20 should be released when a decision regarding these two patches have been reached. This is the current content in NEWS. Can those of you which did commit changes since 2004-09-30 check if the summary is correct and complete. I've written it by looking at the CVS log, and might have misunderstood something. Version 1.1.20 (2006-XX-XX) * Fixed a few compiler warnings. * Fix typos in the documentation and manual. * Correct handling of endian issues. * Adjust handling of ioctl BLKGETSIZE64 to match recent kernels. * Teach ext2prepare how to handle file systems over 2 TiB. * Update ext2prepare to use the same resize_inode format as mke2fs. * Renamed some functions to make the code easier to read. * Fix bug in ext2 metainfo handling (use correct offset). * Corrected and improved program output. Version 1.1.19 (2004-09-30) [news summary were not recored at the time] Friendly, -- Petter Reinholdtsen |
From: Petter R. <pe...@hu...> - 2006-06-10 21:15:22
|
[Andreas Dilger] > Actually, there are two more changes that need including. One is to > handle the blocks referenced by i_file_acl, and the second is to > handle large inodes. Do they need to be included in this release? The ones I propose have been tested alrady in the debian package. If I got it right, the two you propose have not been tested yet. I suggest we release 1.1.20 this weekend with the current CVS and the two patches for big endian fixes and the new resize_inode format, and test the others a bit more before releasing a new version with them included. I'm not sure if I will be able to test acl and large inode patches properly this weekend, so unless someone else can verify that they work as they should, I believe we should postpone them. Who is doing the release? Should I do it, or is there someone else willing to take care of releasing version 1.1.20? |
From: Andreas D. <ad...@cl...> - 2006-06-12 05:45:45
|
On Jun 10, 2006 23:15 +0200, Petter Reinholdtsen wrote: > [Andreas Dilger] > > Actually, there are two more changes that need including. One is to > > handle the blocks referenced by i_file_acl, and the second is to > > handle large inodes. > > Do they need to be included in this release? The ones I propose have > been tested alrady in the debian package. If I got it right, the two > you propose have not been tested yet. I suggest we release 1.1.20 > this weekend with the current CVS and the two patches for big endian > fixes and the new resize_inode format, and test the others a bit more > before releasing a new version with them included. If we decide not to include these patches, we should then remove support for the EXT2_FEATURE_COMPAT_EXT_ATTR flag, because the code does not actually support properly preparing or resizing filesystems with EAs (though online resize is OK). Secondly, prepare and resize should be denied for s_inode_size that isn't EXT2_GOOD_OLD_INODE_SIZE. Cheers, Andreas -- Andreas Dilger Principal Software Engineer Cluster File Systems, Inc. |
From: Andreas D. <ad...@cl...> - 2006-06-10 18:17:44
|
On Jun 10, 2006 09:00 +0200, Petter Reinholdtsen wrote: > I believe it is time to release a new version of ext2prepare. I've > compared CVS with the patches in the Debian package, and the only two > remaining ones is the big endian fix and the disabling of offline > resizing support in ext2online. I believe 1.1.20 should be released > when a decision regarding these two patches have been reached. Actually, there are two more changes that need including. One is to handle the blocks referenced by i_file_acl, and the second is to handle large inodes. I'll post patches separately. Cheers, Andreas -- Andreas Dilger Principal Software Engineer Cluster File Systems, Inc. |
From: Andreas D. <ad...@cl...> - 2006-06-10 18:28:54
|
This patch fixes handling of the EXT2_FEATURE_COMPAT_EA feature. The block referenced by i_file_acl needs to be checked for remapping during filesystem preparation/resize. Patch is proof of concept only, it has not been tested. Suggested method for testing: - create a new (small) filesystem w/o preparation - add an extended attribute on the root inode (should use first available block in first group) with setfattr and/or setfacl - run ext2prepare and/or ext2resize on this filesystem to grow it to need another group descriptor block (which should conflict with the EA block) - without patch it should get a failure because the block isn't relocated - with patch it should relocate the EA block and update the inode (use "debugfs -R 'stat <2>' {dev}" to verify before/after ============================================================================= diff -u -p -r1.34 ext2_block_relocator.c --- src/ext2_block_relocator.c 10 Jun 2006 07:45:55 -0000 1.34 +++ src/ext2_block_relocator.c 10 Jun 2006 18:07:21 -0000 @@ -261,6 +261,12 @@ static int doinode(struct ext2_fs *fs, s blk_t inodeblock; inodeoffset = ext2_get_inode_offset(fs, ino, &inodeblock); + if (inode->i_file_acl) + if (!doblock(fs, state, inode->i_file_acl, inodeblock, + inodeoffset + offsetof(struct ext2_inode, + i_file_acl, 0))) + return 0; + for (i = 0; i < EXT2_NDIR_BLOCKS; i++) if ((blk = inode->i_block[i])) if (!doblock(fs, state, blk, inodeblock, diff -u -p -r1.18 ext2_inode_relocator.c --- src/ext2_inode_relocator.c 10 Jun 2006 07:45:55 -0000 1.18 +++ src/ext2_inode_relocator.c 10 Jun 2006 18:07:21 -0000 @@ -208,6 +208,10 @@ static int dotindblock(struct ext2_fs *f if (S_ISDIR(inode->i_mode)) { blk_t blk; + if (inode->i_file_acl) + if (!doblock(fs, state, inode->i_file_acl)) + return 0; + for (i = 0; i < EXT2_NDIR_BLOCKS; i++) if ((blk = inode->i_block[i])) if (!doblock(fs, state, blk)) Cheers, Andreas -- Andreas Dilger Principal Software Engineer Cluster File Systems, Inc. |
From: Petter R. <pe...@hu...> - 2006-06-11 09:07:28
|
[Andreas Dilger] > This patch fixes handling of the EXT2_FEATURE_COMPAT_EA feature. > The block referenced by i_file_acl needs to be checked for remapping > during filesystem preparation/resize. Patch is proof of concept > only, it has not been tested. It fail to build with this error when I apply it to the current CVS: ext2_block_relocator.c: In function `doblock': ext2_block_relocator.c:142: warning: unused parameter `fs' ext2_block_relocator.c:267:74: macro "offsetof" passed 3 arguments, but takes just 2 ext2_block_relocator.c: In function `doinode': ext2_block_relocator.c:266: error: `offsetof' undeclared (first use in this function) ext2_block_relocator.c:266: error: (Each undeclared identifier is reported only once ext2_block_relocator.c:266: error: for each function it appears in.) ext2_block_relocator.c:266: error: too few arguments to function `doblock' ext2_block_relocator.c: In function `inode_block_scan': ext2_block_relocator.c:327: warning: comparison between signed and unsigned ext2_block_relocator.c: In function `ext2_block_relocator_grab_blocks': ext2_block_relocator.c:524: warning: comparison between signed and unsigned ext2_block_relocator.c: In function `ext2_block_relocate_grow': ext2_block_relocator.c:688: warning: comparison between signed and unsigned ext2_block_relocator.c:691: warning: comparison between signed and unsigned ext2_block_relocator.c: In function `ext2_block_relocate_shrink': ext2_block_relocator.c:869: warning: comparison between signed and unsigned ext2_block_relocator.c:879: warning: comparison between signed and unsigned ext2_block_relocator.c:879: warning: comparison between signed and unsigned ext2_block_relocator.c:880: warning: comparison between signed and unsigned ext2_block_relocator.c:886: warning: comparison between signed and unsigned ext2_block_relocator.c:896: warning: comparison between signed and unsigned I guess this patch need more work too. :) Friendly, -- Petter Reinholdtsen |
From: Andreas D. <ad...@cl...> - 2006-06-10 18:36:36
|
This patch adds handling for large inodes to resizing. It uses a buffer large enough for the maximum inode size for the few places we read inodes, and reads and writes the full inode size instead of just the main body. Patch is untested. Suggested method for testing: - create small new filesystem with large inodes (-I 256) - mount with newer kernel (at least 2.6.10) - create new files in root dir, add EA with setfattr - unmount - verify with debugfs -R "stat <inum>" that EA is in inode - resize or prepare filesystem to add new group block - verify with debugfs -R "stat <inum>" that EA was moved with inode (or mount and use getfattr) ============================================================================ diff -u -p -r1.34 ext2.c --- src/ext2.c 10 Jun 2006 07:45:55 -0000 1.34 +++ src/ext2.c 10 Jun 2006 18:07:21 -0000 @@ -220,9 +220,7 @@ off_t ext2_get_inode_offset(struct ext2_ inode--; group = inode / fs->sb.s_inodes_per_group; - offset = (inode % fs->sb.s_inodes_per_group) * - (fs->sb.s_rev_level == EXT2_GOOD_OLD_REV ? - EXT2_GOOD_OLD_INODE_SIZE : fs->sb.s_inode_size); + offset = (inode % fs->sb.s_inodes_per_group) * fs->inode_size; *block = fs->gd[group].bg_inode_table + (offset >> fs->logsize); @@ -256,7 +254,7 @@ void ext2_read_inode(struct ext2_fs *fs, off = ext2_get_inode_offset(fs, ino, &blk); bh = ext2_bread(fs, blk); - memcpy(inode, bh->data + off, sizeof(struct ext2_inode)); + memcpy(inode, bh->data + off, fs->inode_size); ext2_brelse(bh, 0); } @@ -454,21 +454,21 @@ void ext2_write_inode(struct ext2_fs *fs if (fs->flags & FL_ONLINE) { fs->devhandle->ops->direct_write(fs->devhandle->cookie, (const void *)inode, (loff_t)blk * fs->blocksize + off, - sizeof(struct ext2_inode)); + fs->inode_size); } else { bh = ext2_bread(fs, blk); bh->dirty = 1; - memcpy(bh->data + off, inode, sizeof(struct ext2_inode)); + memcpy(bh->data + off, inode, fs->inode_size); ext2_brelse(bh, 0); } } void ext2_zero_inode(struct ext2_fs *fs, ino_t ino) { - struct ext2_inode inode; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; - memset(&inode, 0, sizeof(struct ext2_inode)); - ext2_write_inode(fs, ino, &inode); + memset(inode_buf, 0, fs->inode_size); + ext2_write_inode(fs, ino, (void *)inode_buf); } unsigned int ext2_list_backups(struct ext2_fs *fs, unsigned int *three, @@ -860,7 +860,8 @@ struct ext2_fs *ext2_open(struct ext2_de int flags) { struct ext2_fs *fs; - struct ext2_inode inode; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; int maxgroups; blk_t devsize; blk_t residue; @@ -942,6 +943,19 @@ struct ext2_fs *ext2_open(struct ext2_de fs->blocksize = 1 << fs->logsize; fs->u32perblock = fs->blocksize >> 2; + if (fs->sb.s_rev_level > EXT2_GOOD_OLD_REV) { + fs->inode_size = fs->sb.s_inode_size; + if (fs->inode_size < EXT2_GOOD_OLD_INODE_SIZE || + fs->inode_size & (fs->inode_size - 1) || + fs->inode_size > fs->blocksize) { + fprintf(stderr, "superblock inode size %u is invalid\n", + fs->inode_size); + goto error_free_fs; + } + } else { + fs->inode_size = EXT2_GOOD_OLD_INODE_SIZE; + } + devsize = handle->ops->get_size(fs->devhandle->cookie); if (newblocks == 0) newblocks = devsize; @@ -956,8 +970,8 @@ struct ext2_fs *ext2_open(struct ext2_de fs->sb.s_blocks_per_group); fs->gdblocks = howmany(fs->numgroups * sizeof(struct ext2_group_desc), fs->blocksize); - fs->inodeblocks = howmany(fs->sb.s_inodes_per_group * - sizeof(struct ext2_inode), fs->blocksize); + fs->inodeblocks = howmany(fs->sb.s_inodes_per_group * fs->inode_size, + fs->blocksize); fs->r_frac = howmany(100 * (loff_t)fs->sb.s_r_blocks_count, fs->sb.s_blocks_count); @@ -1011,8 +1025,8 @@ struct ext2_fs *ext2_open(struct ext2_de if (!ext2_determine_itoffset(fs)) goto error_free_gd; - ext2_read_inode(fs, EXT2_BAD_INO, &inode); - if (inode.i_blocks > 0) { + ext2_read_inode(fs, EXT2_BAD_INO, inode); + if (inode->i_blocks > 0) { fprintf(stderr, "%s: ext2_open: Can't handle fs with bad blocks!!\n" "Contact <ext...@li...> to " @@ -1021,8 +1035,8 @@ struct ext2_fs *ext2_open(struct ext2_de } /* Bring in Mr. Bond */ - ext2_read_inode(fs, EXT2_RESIZE_INO, &inode); - fs->resgdblocks = ext2_get_reserved(fs, &inode); + ext2_read_inode(fs, EXT2_RESIZE_INO, inode); + fs->resgdblocks = ext2_get_reserved(fs, inode); #if 0 ext2_journal_init(fs); diff -u -p -r1.28 ext2.h --- src/ext2.h 10 Jun 2006 07:45:55 -0000 1.28 +++ src/ext2.h 10 Jun 2006 18:07:21 -0000 @@ -115,6 +115,7 @@ struct ext2_fs int flags; /* See FL_* defines */ int blocksize; + int inode_size; /* inode size in bytes */ int u32perblock; /* #blocks per indirect block */ int logsize; /* base 2 log of blocksize */ blk_t newblocks; /* blocks in resized fs */ diff -u -p -r1.22 ext2_block_relocator.c --- src/ext2_block_relocator.c 10 Jun 2006 07:45:55 -0000 1.22 +++ src/ext2_block_relocator.c 10 Jun 2006 18:07:21 -0000 @@ -249,8 +249,8 @@ static int dotindblock(struct ext2_fs *f static int doinode(struct ext2_fs *fs, struct ext2_block_relocator_state *state, ino_t ino) { - struct ext2_inode tmp; - struct ext2_inode *inode = &tmp; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; ext2_read_inode(fs, ino, inode); @@ -628,8 +634,8 @@ static int ext2_block_relocator_mark(str static int ext2_block_relocate_grow(struct ext2_fs *fs, struct ext2_block_relocator_state *state) { - struct ext2_inode tmp; - struct ext2_inode *inode = &tmp; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; int newitoffset; blk_t start; int group; @@ -793,8 +799,8 @@ static int ext2_block_relocate_grow(stru static int ext2_block_relocate_shrink(struct ext2_fs *fs, struct ext2_block_relocator_state *state) { - struct ext2_inode tmp; - struct ext2_inode *inode = &tmp; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; int group; blk_t start; diff -u -p -r1.8 ext2_fs.h --- src/ext2_fs.h 3 Jul 2002 17:52:24 -0000 1.8 +++ src/ext2_fs.h 10 Jun 2006 18:07:21 -0000 @@ -75,7 +75,7 @@ * Macro-instructions used to manage several block sizes */ #define EXT2_MIN_BLOCK_LOG_SIZE 10 /* 1024 */ -#define EXT2_MAX_BLOCK_LOG_SIZE 13 /* 8192 */ +#define EXT2_MAX_BLOCK_LOG_SIZE 16 /* 8192 */ #define EXT2_MIN_BLOCK_SIZE (1 << EXT2_MIN_BLOCK_LOG_SIZE) #define EXT2_MAX_BLOCK_SIZE (1 << EXT2_MAX_BLOCK_LOG_SIZE) #ifdef __KERNEL__ diff -u -p -r1.18 ext2_inode_relocator.c --- src/ext2_inode_relocator.c 10 Jun 2006 07:45:55 -0000 1.18 +++ src/ext2_inode_relocator.c 10 Jun 2006 18:07:21 -0000 @@ -208,11 +208,10 @@ static int dotindblock(struct ext2_fs *f static int doinode(struct ext2_fs *fs, struct ext2_inode_relocator_state *state, ino_t ino) { - struct ext2_inode tmp; - struct ext2_inode *inode = &tmp; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; int i; - ext2_read_inode(fs, ino, inode); if (S_ISDIR(inode->i_mode)) { @@ -306,7 +309,8 @@ static void ext2_inode_relocator_copy(st int i; for (i = 0; i < state->used_entries; i++) { - struct ext2_inode inode; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; struct ext2_inode_entry *entry; entry = &state->inode[i]; @@ -315,10 +319,10 @@ static void ext2_inode_relocator_copy(st ext2_get_inode_state(fs, entry->dest)) fprintf(stderr, "inode bitmap error\n"); - ext2_read_inode(fs, entry->ino, &inode); - ext2_write_inode(fs, entry->dest, &inode); + ext2_read_inode(fs, entry->ino, inode); + ext2_write_inode(fs, entry->dest, inode); - entry->isdir = S_ISDIR(inode.i_mode) ? 1 : 0; + entry->isdir = S_ISDIR(inode->i_mode) ? 1 : 0; } if (fs->flags & FL_SAFE) @@ -472,21 +476,22 @@ static int ext2_inode_relocator_mark(str struct ext2_inode_relocator_state *state, ino_t ino) { - struct ext2_inode inode; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; struct ext2_inode_entry *ent; void *adv; void *rec; int i; - ext2_read_inode(fs, ino, &inode); + ext2_read_inode(fs, ino, inode); adv = state->inode + state->used_entries + 1; - rec = state->last - inode.i_links_count; + rec = state->last - inode->i_links_count; if (adv >= rec) ext2_inode_relocator_flush(fs, state); - state->last -= inode.i_links_count; + state->last -= inode->i_links_count; ent = &state->inode[state->used_entries]; ent->ino = ino; diff -u -p -r1.11 ext2_journal.c --- src/ext2_journal.c 10 Oct 2000 18:34:33 -0000 1.11 +++ src/ext2_journal.c 10 Jun 2006 18:07:21 -0000 @@ -50,7 +50,8 @@ struct ext2_journal static int create_journal_inode(struct ext2_fs *fs, struct ext2_journal *j) { - struct ext2_inode inode; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; ino_t inodenum; if (!fs->sb.s_free_inodes_count) { @@ -60,21 +61,21 @@ static int create_journal_inode(struct e inodenum = ext2_find_free_inode(fs); - memset(&inode, 0, sizeof(inode)); - inode.i_mode = 0100400; - inode.i_size = 4 << fs->logsize; - inode.i_atime = JOURNAL_SIG0; - inode.i_ctime = JOURNAL_SIG1; - inode.i_mtime = JOURNAL_SIG2; - inode.i_dtime = JOURNAL_SIG3; - inode.i_links_count = 1; - inode.i_blocks = 8 << fs->logsize; - inode.i_block[0] = j->block[0]; - inode.i_block[1] = j->block[1]; - inode.i_block[2] = j->block[2]; - inode.i_block[3] = j->block[3]; + memset(inode, 0, fs->inode_size); + inode->i_mode = 0100400; + inode->i_size = 4 << fs->logsize; + inode->i_atime = JOURNAL_SIG0; + inode->i_ctime = JOURNAL_SIG1; + inode->i_mtime = JOURNAL_SIG2; + inode->i_dtime = JOURNAL_SIG3; + inode->i_links_count = 1; + inode->i_blocks = 8 << fs->logsize; + inode->i_block[0] = j->block[0]; + inode->i_block[1] = j->block[1]; + inode->i_block[2] = j->block[2]; + inode->i_block[3] = j->block[3]; - ext2_write_inode(fs, inodenum, &inode); + ext2_write_inode(fs, inodenum, inode); ext2_set_inode_state(fs, inodenum, 1, 1); return 1; @@ -85,13 +86,14 @@ static ino_t find_journal_inode(struct e ino_t i; for (i = 1; i < fs->sb.s_inodes_count; i++) { - struct ext2_inode inode; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; - ext2_read_inode(fs, i, &inode); - if (inode.i_atime == JOURNAL_SIG0 && - inode.i_ctime == JOURNAL_SIG1 && - inode.i_mtime == JOURNAL_SIG2) { - if (inode.i_dtime != JOURNAL_SIG3) + ext2_read_inode(fs, i, inode); + if (inode->i_atime == JOURNAL_SIG0 && + inode->i_ctime == JOURNAL_SIG1 && + inode->i_mtime == JOURNAL_SIG2) { + if (inode->i_dtime != JOURNAL_SIG3) fprintf(stderr, "you ran e2fsck after ext2resize crashed? Hm.\n"); diff -u -p -r1.10 ext2_mkfs.c --- src/ext2_mkfs.c 4 Sep 2001 18:13:49 -0000 1.10 +++ src/ext2_mkfs.c 10 Jun 2006 18:07:21 -0000 @@ -115,9 +115,12 @@ void ext2_mkfs_write_meta(struct ext2_de blocksize = 1 << (sb->s_log_block_size + 13); - numgroups = howmany(sb->s_blocks_count - sb->s_first_data_block, sb->s_blocks_per_group); - itsize = howmany(sizeof(struct ext2_inode) * sb->s_inodes_per_group, (1024 << sb->s_log_block_size)); - gdtsize = howmany(sizeof(struct ext2_group_desc) * numgroups, (1024 << sb->s_log_block_size)); + numgroups = howmany(sb->s_blocks_count - sb->s_first_data_block, + sb->s_blocks_per_group); + itsize = howmany(sb->s_inode_size * sb->s_inodes_per_group, + (1024 << sb->s_log_block_size)); + gdtsize = howmany(sizeof(struct ext2_group_desc) * numgroups, + (1024 << sb->s_log_block_size)); bb = malloc(1024 << sb->s_log_block_size); ib = malloc(1024 << sb->s_log_block_size); @@ -199,7 +202,8 @@ int ext2_mkfs_create_lost_and_found_inod blk_t blocks[12]; __u32 data[fs->blocksize / 4]; int i; - struct ext2_inode inode; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; for (i = 0; i < EXT2_NDIR_BLOCKS; i++) { if (!(blocks[i] = ext2_find_free_block(fs))) @@ -230,16 +234,16 @@ int ext2_mkfs_create_lost_and_found_inod ext2_brelse(bh, 1); } - memset(&inode, 0, sizeof(struct ext2_inode)); - inode.i_mode = S_IFDIR | 0755; - inode.i_size = EXT2_NDIR_BLOCKS * fs->blocksize; - inode.i_atime = inode.i_ctime = inode.i_mtime = time(NULL); - inode.i_links_count = 2; - inode.i_blocks = (EXT2_NDIR_BLOCKS * fs->blocksize) >> 9; + memset(inode, 0, fs->inode_size); + inode->i_mode = S_IFDIR | 0755; + inode->i_size = EXT2_NDIR_BLOCKS * fs->blocksize; + inode->i_atime = inode->i_ctime = inode->i_mtime = time(NULL); + inode->i_links_count = 2; + inode->i_blocks = (EXT2_NDIR_BLOCKS * fs->blocksize) >> 9; for (i = 0; i < EXT2_NDIR_BLOCKS; i++) - inode.i_block[i] = blocks[i]; + inode->i_block[i] = blocks[i]; - ext2_write_inode(fs, EXT2_GOOD_OLD_FIRST_INO, &inode); + ext2_write_inode(fs, EXT2_GOOD_OLD_FIRST_INO, inode); ext2_set_inode_state(fs, EXT2_GOOD_OLD_FIRST_INO, 1, 1); fs->gd[0].bg_used_dirs_count++; fs->metadirty |= EXT2_META_GD; @@ -252,7 +256,8 @@ int ext2_mkfs_create_root_inode(struct e struct ext2_buffer_head *bh; blk_t block; __u32 data[fs->blocksize / 4]; - struct ext2_inode inode; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; if (!(block = ext2_find_free_block(fs))) return 0; @@ -275,15 +280,15 @@ int ext2_mkfs_create_root_inode(struct e bh->dirty = 1; ext2_brelse(bh, 1); - memset(&inode, 0, sizeof(struct ext2_inode)); - inode.i_mode = S_IFDIR | 0755; - inode.i_size = fs->blocksize; - inode.i_atime = inode.i_ctime = inode.i_mtime = time(NULL); - inode.i_links_count = 3; - inode.i_blocks = fs->blocksize >> 9; - inode.i_block[0] = block; + memset(inode, 0, fs->inode_size); + inode->i_mode = S_IFDIR | 0755; + inode->i_size = fs->blocksize; + inode->i_atime = inode->i_ctime = inode->i_mtime = time(NULL); + inode->i_links_count = 3; + inode->i_blocks = fs->blocksize >> 9; + inode->i_block[0] = block; - ext2_write_inode(fs, 2, &inode); + ext2_write_inode(fs, 2, inode); fs->gd[0].bg_used_dirs_count++; fs->metadirty |= EXT2_META_GD; @@ -370,11 +375,11 @@ struct ext2_fs *ext2_mkfs(struct ext2_de sb.s_lastcheck = 0; sb.s_checkinterval = 0; sb.s_creator_os = 0; - sb.s_rev_level = 0; + sb.s_rev_level = EXT2_DYNAMIC_REV; sb.s_def_resuid = 0; sb.s_def_resgid = 0; sb.s_first_ino = 12; - sb.s_inode_size = 128; + sb.s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; sb.s_block_group_nr = 0; sb.s_feature_compat = 0; sb.s_feature_incompat = 0; Index: src/ext2_resize.c =================================================================== RCS file: /cvsroot/ext2resize/ext2resize/src/ext2_resize.c,v retrieving revision 1.19 diff -u -p -r1.19 ext2_resize.c --- src/ext2_resize.c 10 Jun 2006 06:45:22 -0000 1.19 +++ src/ext2_resize.c 10 Jun 2006 18:07:21 -0000 @@ -28,8 +28,8 @@ static const char _ext2_resize_c[] = "$I static int ext2_add_group(struct ext2_fs *fs, blk_t bpg) { - struct ext2_inode tmp; - struct ext2_inode *inode = &tmp; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; blk_t admin; int group = fs->numgroups; blk_t start; @@ -225,8 +225,8 @@ static int ext2_del_group(struct ext2_fs sizeof(struct ext2_group_desc), fs->blocksize); if (new_gdblocks != fs->gdblocks) { - struct ext2_inode tmp; - struct ext2_inode *inode = &tmp; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; blk_t start; ext2_read_inode(fs, EXT2_RESIZE_INO, inode); diff -u -p -r1.21 ext2prepare.c --- src/ext2prepare.c 10 Jun 2006 07:15:24 -0000 1.21 +++ src/ext2prepare.c 10 Jun 2006 18:07:21 -0000 @@ -129,8 +129,8 @@ static int check_inode_ind(struct ext2_f static int create_resize_inode(struct ext2_fs *fs) { - struct ext2_inode tmp; - struct ext2_inode *inode = &tmp; + char inode_buf[EXT2_MAX_BLOCK_SIZE]; + struct ext2_inode *inode = (void *)inode_buf; int diff; int i; blk_t block; @@ -143,7 +143,7 @@ static int create_resize_inode(struct ex if (fs->flags & FL_VERBOSE) printf("creating resize inode (%03d)\n", EXT2_RESIZE_INO); - memset(inode, 0, sizeof(struct ext2_inode)); + memset(inode, 0, fs->inode_size); inode->i_mode = S_IFREG | S_IRUSR | S_IWUSR; inode->i_ctime = time(NULL); inode->i_links_count = 1; Cheers, Andreas -- Andreas Dilger Principal Software Engineer Cluster File Systems, Inc. |
From: Petter R. <pe...@hu...> - 2006-06-11 09:00:57
|
[Andreas Dilger] > This patch adds handling for large inodes to resizing. It uses a buffer > large enough for the maximum inode size for the few places we read inodes, > and reads and writes the full inode size instead of just the main body. This patch fail to compile. This is the error: ext2_inode_relocator.c: I funktionen 'ext2_inode_relocator_mark': ext2_inode_relocator.c:495: error: request for member `i_links_count' in something not a structure or union I guess it need more work before it should be commited? Friendly, -- Petter Reinholdtsen |
From: Petter R. <pe...@hu...> - 2006-06-11 08:50:34
|
[Petter Reinholdtsen] > Who is doing the release? Should I do it, or is there someone else > willing to take care of releasing version 1.1.20? I did 'make dist' with the current cvs content, to get a test package. Please have a look at <URL:http://folk.uio.no/pre/ext2resize-1.1.20-test1-20060611.tar.gz>, and let me know if there are problems with it. Friendly, -- Petter Reinholdtsen |
From: Petter R. <pe...@hu...> - 2006-06-11 19:15:37
|
[Petter Reinholdtsen] > Who is doing the release? Should I do it, or is there someone else > willing to take care of releasing version 1.1.20? I just realised. I lack the project privileges to do releases on sourceforge. So if I am to do it, I would have to do it from one of my web pages. I suggest someone with the privileges do it instead. > I did 'make dist' with the current cvs content, to get a test > package. Please have a look at > <URL:http://folk.uio.no/pre/ext2resize-1.1.20-test1-20060611.tar.gz>, > and let me know if there are problems with it. I guess no-one found time to look at it? :) I'm trying to test the new patches, but still do not really understand how to check that they are correct. Will continue looking at it. :) Friendly, -- Petter Reinholdtsen |