Bug 208323 - specified mkfs.xfs inode size in anaconda is huge
Summary: specified mkfs.xfs inode size in anaconda is huge
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks: 207143
TreeView+ depends on / blocked
 
Reported: 2006-09-27 20:53 UTC by Eric Sandeen
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-09-27 21:20:46 UTC
Type: ---
Embargoed:


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

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


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