Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 09 Jan 2016 07:51:22 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 206059] [ext2fs][patch] EXT4: cannot mount filesystems < 512 MiB in size: "ext2fs: no space for extra inode timestamps"
Message-ID:  <bug-206059-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206059

            Bug ID: 206059
           Summary: [ext2fs][patch] EXT4: cannot mount filesystems < 512
                    MiB in size: "ext2fs: no space for extra inode
                    timestamps"
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: damjan.jov@gmail.com
                CC: freebsd-fs@FreeBSD.org

Created attachment 165293
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D165293&action=
=3Dedit
Allow inode size < sizeof(struct ext2fs_dinode) when EXT2F_ROCOMPAT_EXTRA_I=
SIZE
is set

When making the EXT4 filesystem, mkfs.ext4 uses different inode sizes depen=
ding
on the filesystem file.

For a large filesystem, "dumpe2fs" returns these relevant fields:

Filesystem features:      has_journal ext_attr resize_inode dir_index filet=
ype
extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink
extra_isize
Inode size:               256
Required extra isize:     28
Desired extra isize:      28

For a small filesystem, "dumpe2fs" returns this instead, and "Required extra
isize" and "Desired extra isize" are missing:

Filesystem features:      has_journal ext_attr resize_inode dir_index filet=
ype
extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize
Inode size:               128

Bisection searching with different filesystem sizes ("dd if=3D/dev/zero
of=3D/tmp/filesystem bs=3D1M count=3D..." + "mkfs.ext4 /tmp/filesystem" + "=
dumpe2fs
-h /tmp/filesystem") shows inode size 256 is used for filesystems >=3D 512 =
MiB,
and smaller filesystems use inode size 128.

Attemping to mount the small filesystems fails with this error (and unless
you've patched ext2fs with the patch from bug 206056, also panics the
kernel!!):

ext2fs: no space for extra inode timestamps

That message comes from compute_sb_data() in ext2_vfsops.c, which does

       /* Check for extra isize in big inodes. */
       if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_EXTRA_ISIZE) &&
           EXT2_INODE_SIZE(fs) < sizeof(struct ext2fs_dinode)) {
               printf("ext2fs: no space for extra inode timestamps\n");
               return (EINVAL);
       }

which must be wrong, because even small filesystems have the extra_isize
feature set, yet the inode size is 128 which is smaller than sizeof(struct
ext2fs_dinode).

Since EXT2F_ROCOMPAT_EXTRA_ISIZE isn't used anywhere else in the ext2fs mod=
ule,
I've made a patch that deletes that entire section, and it gets the small
filesystems to mount and work.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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