From owner-freebsd-bugs@freebsd.org Sat Jan 9 07:51:22 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBA99A68D90 for ; Sat, 9 Jan 2016 07:51:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD0C1158D for ; Sat, 9 Jan 2016 07:51:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u097pMOT050390 for ; Sat, 9 Jan 2016 07:51:22 GMT (envelope-from bugzilla-noreply@freebsd.org) 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" Date: Sat, 09 Jan 2016 07:51:22 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: damjan.jov@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter cc attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 07:51:22 -0000 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.=