Bug 208323 - specified mkfs.xfs inode size in anaconda is huge
specified mkfs.xfs inode size in anaconda is huge
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Anaconda Maintenance Team
Mike McLean
:
Depends On:
Blocks: 207143
  Show dependency treegraph
 
Reported: 2006-09-27 16:53 EDT by Eric Sandeen
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-09-27 17:20:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to remove large inode size from mkfs.xfs options (1009 bytes, patch)
2006-09-27 16:58 EDT, Eric Sandeen
no flags Details | Diff

  None (edit)
Description Eric Sandeen 2006-09-27 16:53:28 EDT
Anaconda is making -huge- xfs inode sizes when it calls mkfs.xfs:

        xfsBytesPerInode = 2048
        if entry.bytesPerInode < 2048:
            xfsBytesPerInode = entry.bytesPerInode

        rc = iutil.execWithRedirect("/usr/sbin/mkfs.xfs",
                                    ["-f", "-l", "internal", "-i",
                                     "size=" + str(xfsBytesPerInode),
                                     "-i", "attr=2", devicePath],
                                    stdout = "/dev/tty5",
                                    stderr = "/dev/tty5")

It is using the e2fsprogs/mke2fs concept of "bytes per inode" - i.e. for every X
bytes of size of the filesystem, create 1 inode:

       -i bytes-per-inode
              Specify  the  bytes/inode ratio.  mke2fs creates an inode for
              every bytes-per-inode bytes of space on the disk.

and using that value for the -size- of the xfs inode.

This was broken at first because ext2 used "4096" bytes per inode, which is too
big for an xfs inode size.  So this patch went in:

[esandeen@neon cvs]$ cvs diff -u -r1.246 -r1.247 anaconda/fsset.py
Index: anaconda/fsset.py
===================================================================
RCS file: /usr/local/CVS/anaconda/fsset.py,v
retrieving revision 1.246
retrieving revision 1.247
diff -u -r1.246 -r1.247
--- anaconda/fsset.py   9 Mar 2005 22:03:01 -0000       1.246
+++ anaconda/fsset.py   23 Mar 2005 23:06:04 -0000      1.247
@@ -419,9 +419,13 @@
     def formatDevice(self, entry, progress, chroot='/'):
         devicePath = entry.device.setupDevice(chroot)

+        xfsBytesPerInode = 2048
+        if entry.bytesPerInode < 2048:
+            xfsBytesPerInode = entry.bytesPerInode
+
         rc = iutil.execWithRedirect("/usr/sbin/mkfs.xfs",
                                     ["mkfs.xfs", "-f", "-l", "internal",
-                                     "-i size=" + str(entry.bytesPerInode),
+                                     "-i", "size=" + str(xfsBytesPerInode),
                                      devicePath ],
                                     stdout = "/dev/tty5",
                                     stderr = "/dev/tty5")

to cap it at the maximum possible xfs inode size.  The end result is anaconda
always makes xfs with the maximal inode size, which is quite unnecessary and
probably hurts performance.  I'll attach a patch to back this out, the default
inode size should be fine.
Comment 1 Eric Sandeen 2006-09-27 16:58:34 EDT
Created attachment 137249 [details]
patch to remove large inode size from mkfs.xfs options

(untested) patch to remove the inode size setting in anaconda's mkfs.xfs
invocations.
Comment 2 Jeremy Katz 2006-09-27 17:20:46 EDT
Committed, will be in rawhide tomorrw

Note You need to log in before you can comment on or make changes to this bug.