Bug 208323

Summary: specified mkfs.xfs inode size in anaconda is huge
Product: [Fedora] Fedora Reporter: Eric Sandeen <esandeen>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED RAWHIDE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 6   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-09-27 21:20:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 207143    
Attachments:
Description Flags
patch to remove large inode size from mkfs.xfs options none

Description Eric Sandeen 2006-09-27 20:53:28 UTC
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 20:58:34 UTC
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 21:20:46 UTC
Committed, will be in rawhide tomorrw