Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Sep 2008 19:57:28 -0400
From:      jT <toyj@union.edu>
To:        "Wesley Shields" <wxs@freebsd.org>
Cc:        Kostik Belousov <kostikbel@gmail.com>, freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: 256-byte inode support
Message-ID:  <9f8af95f0809131657q6c3e2339uebc2a9a4b2e2f5de@mail.gmail.com>
In-Reply-To: <20080909131442.GL62357@atarininja.org>
References:  <9f8af95f0809061626q22bc8f60i48fd95b32cef3d04@mail.gmail.com> <20080907150747.GB62357@atarininja.org> <20080909115351.GJ39652@deviant.kiev.zoral.com.ua> <20080909122917.GK62357@atarininja.org> <20080909123746.GK39652@deviant.kiev.zoral.com.ua> <20080909131442.GL62357@atarininja.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Kostik, Wesley,

   I've been using this patch since Wesley made me aware of it -- it
has been 100% fine for me atm --  there are a few small modifications
to it and it applies cleanly to -CURRENT -- a bunch of my friends who
run all linux boxen (and i'm changing their minds about that slowly
but surely) use it and I have also _not_ heard a peep from them about
any failures / weirdness -- and most of their data exists on ext2fs :)
-- so thats a good sign -- i've attached the updated patch

--- ./ext2_fs.h.orig	2008-09-13 23:25:32.000000000 +0100
+++ ./ext2_fs.h	2008-09-13 23:25:45.000000000 +0100
@@ -150,7 +150,7 @@
 #else /* !notyet */
 #define	EXT2_INODES_PER_BLOCK(s)	((s)->s_inodes_per_block) /* Should
be sizeof(struct ext2_inode): */
-#define EXT2_INODE_SIZE                        128
+#define EXT2_INODE_SIZE(s)             ((s)->s_es->s_inode_size)
 #define EXT2_FIRST_INO			11
 #endif /* notyet */

--- ./ext2_inode.c.orig	2008-09-13 23:25:53.000000000 +0100
+++ ./ext2_inode.c	2008-09-13 23:26:06.000000000 +0100
@@ -91,7 +91,7 @@
 		return (error);
 	}
 	ext2_i2ei(ip, (struct ext2_inode *)((char *)bp->b_data +
-	    EXT2_INODE_SIZE * ino_to_fsbo(fs, ip->i_number)));
+	    EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)));
 	if (waitfor && (vp->v_mount->mnt_kern_flag & MNTK_ASYNC) == 0)
 		return (bwrite(bp));
 	else {
--- ./ext2_vfsops.c.orig	2008-09-13 23:26:13.000000000 +0100
+++ ./ext2_vfsops.c	2008-09-13 23:26:55.000000000 +0100
@@ -424,7 +424,7 @@
     V(s_frags_per_group)
     fs->s_inodes_per_group = es->s_inodes_per_group;
     V(s_inodes_per_group)
-    fs->s_inodes_per_block = fs->s_blocksize / EXT2_INODE_SIZE;
+    fs->s_inodes_per_block = fs->s_blocksize / EXT2_INODE_SIZE(fs);
     V(s_inodes_per_block)
     fs->s_itb_per_group = fs->s_inodes_per_group /fs->s_inodes_per_block;
     V(s_itb_per_group)
@@ -578,7 +578,7 @@
 			return (error);
 		}
 		ext2_ei2i((struct ext2_inode *) ((char *)bp->b_data +
-		    EXT2_INODE_SIZE * ino_to_fsbo(fs, ip->i_number)), ip);
+		    EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)), ip);
 		brelse(bp);
 		VOP_UNLOCK(vp, 0);
 		vrele(vp);
@@ -1013,7 +1013,7 @@
 		return (error);
 	}
 	/* convert ext2 inode to dinode */
-	ext2_ei2i((struct ext2_inode *) ((char *)bp->b_data + EXT2_INODE_SIZE *
+	ext2_ei2i((struct ext2_inode *) ((char *)bp->b_data + EXT2_INODE_SIZE(fs) *
 			ino_to_fsbo(fs, ino)), ip);
 	ip->i_block_group = ino_to_cg(fs, ino);
 	ip->i_next_alloc_block = 0;

/jT

http://git.zen-sources.org/?p=kernel/zenmm.git;a=summary
On Tue, Sep 9, 2008 at 9:14 AM, Wesley Shields <wxs@freebsd.org> wrote:
> On Tue, Sep 09, 2008 at 03:37:47PM +0300, Kostik Belousov wrote:
>> On Tue, Sep 09, 2008 at 08:29:17AM -0400, Wesley Shields wrote:
>> > On Tue, Sep 09, 2008 at 02:53:51PM +0300, Kostik Belousov wrote:
>> > > On Sun, Sep 07, 2008 at 11:07:47AM -0400, Wesley Shields wrote:
>> > > > On Sat, Sep 06, 2008 at 07:26:27PM -0400, jT wrote:
>> > > > > hackers,
>> > > > >
>> > > > >     since tytso had updated ext3 -- i've noticed that i can't use my
>> > > > > 265-byte inode ext3 drives -- is there any effort to update it?  If
>> > > > > not -- if you know where i should attempt to start please let me know
>> > > > > so i can start working on support (i have a few other people i know
>> > > > > interested in this) -- thanks and hope everyone is well
>> > > >
>> > > > There was a PR submitted for it and eventually a patch added to the PR.
>> > > > I've tested the patch given in the URL at the port and it works.  We
>> > > > will start to see more of this as the newer version becomes more common
>> > > > in the wild.
>> > > >
>> > > > http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/124621
>> > > >
>> > > > Would be nice to see this fixed in 7.1 but it may be too late for that.
>> > >
>> > > What was the reason for increasing inode size ? I think it is rather
>> > > pointless to increase the size without using newly added space for some
>> > > data. Is inode format the same for the first 128 bytes, and does data
>> > > at the second 128 bytes should be used to correctly interpret inode ?
>> >
>> > I honestly don't know the answer.  Though I do agree that it is
>> > pointless to increase the size without using the new space.
>> >
>> > All I know is that I was unable to read an ext filesystem made with -I
>> > 256 (which is the default when using the most recent
>> > sysutils/e2fsprogs).
>>
>> I think it is too dangerous for the user data to commit this patch,
>> without investigating this first.
>
> I think that's a fair assessment to make.  The patch is certainly simple
> enough but I'm not familiar with what it's doing to make an accurate
> assessment.  I know it worked for the simple test case I provided in my
> previous message.  If I can be of any further assistance please let me
> know.
>
> -- WXS
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9f8af95f0809131657q6c3e2339uebc2a9a4b2e2f5de>