[PATCH v3 00/12] vfs: change inode->i_ino from unsigned long to u64

Jeff Layton posted 12 patches 1 month ago
drivers/dma-buf/dma-buf.c                  |   2 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c |   4 +-
fs/9p/vfs_addr.c                           |   4 +-
fs/9p/vfs_inode.c                          |   6 +-
fs/9p/vfs_inode_dotl.c                     |   6 +-
fs/affs/amigaffs.c                         |  10 +-
fs/affs/bitmap.c                           |   2 +-
fs/affs/dir.c                              |   2 +-
fs/affs/file.c                             |  20 +-
fs/affs/inode.c                            |  12 +-
fs/affs/namei.c                            |  14 +-
fs/affs/symlink.c                          |   2 +-
fs/afs/dir.c                               |  10 +-
fs/afs/dir_search.c                        |   2 +-
fs/afs/dynroot.c                           |   2 +-
fs/afs/inode.c                             |   2 +-
fs/autofs/inode.c                          |   2 +-
fs/befs/linuxvfs.c                         |  28 +-
fs/bfs/dir.c                               |   4 +-
fs/cachefiles/io.c                         |   6 +-
fs/cachefiles/namei.c                      |  12 +-
fs/cachefiles/xattr.c                      |   2 +-
fs/ceph/crypto.c                           |   4 +-
fs/coda/dir.c                              |   2 +-
fs/coda/inode.c                            |   2 +-
fs/cramfs/inode.c                          |   2 +-
fs/crypto/crypto.c                         |   2 +-
fs/crypto/hooks.c                          |   2 +-
fs/crypto/keyring.c                        |   4 +-
fs/crypto/keysetup.c                       |   2 +-
fs/dcache.c                                |   4 +-
fs/ecryptfs/crypto.c                       |   6 +-
fs/ecryptfs/file.c                         |   2 +-
fs/efs/inode.c                             |   6 +-
fs/eventpoll.c                             |   2 +-
fs/exportfs/expfs.c                        |   4 +-
fs/ext2/dir.c                              |  10 +-
fs/ext2/ialloc.c                           |   9 +-
fs/ext2/inode.c                            |   2 +-
fs/ext2/trace.h                            |   8 +-
fs/ext2/xattr.c                            |  14 +-
fs/ext4/dir.c                              |   2 +-
fs/ext4/ext4.h                             |   4 +-
fs/ext4/extents.c                          |   8 +-
fs/ext4/extents_status.c                   |  28 +-
fs/ext4/fast_commit.c                      |   8 +-
fs/ext4/ialloc.c                           |  10 +-
fs/ext4/indirect.c                         |   2 +-
fs/ext4/inline.c                           |  14 +-
fs/ext4/inode.c                            |  22 +-
fs/ext4/ioctl.c                            |   4 +-
fs/ext4/mballoc.c                          |   6 +-
fs/ext4/migrate.c                          |   2 +-
fs/ext4/move_extent.c                      |  20 +-
fs/ext4/namei.c                            |  10 +-
fs/ext4/orphan.c                           |  16 +-
fs/ext4/page-io.c                          |  10 +-
fs/ext4/super.c                            |  22 +-
fs/ext4/xattr.c                            |  10 +-
fs/f2fs/compress.c                         |   4 +-
fs/f2fs/dir.c                              |   2 +-
fs/f2fs/extent_cache.c                     |   8 +-
fs/f2fs/f2fs.h                             |   6 +-
fs/f2fs/file.c                             |  12 +-
fs/f2fs/gc.c                               |   2 +-
fs/f2fs/inline.c                           |   4 +-
fs/f2fs/inode.c                            |  48 +--
fs/f2fs/namei.c                            |   8 +-
fs/f2fs/node.c                             |  12 +-
fs/f2fs/recovery.c                         |  10 +-
fs/f2fs/xattr.c                            |  10 +-
fs/freevxfs/vxfs_bmap.c                    |   4 +-
fs/fserror.c                               |   2 +-
fs/hfs/catalog.c                           |   2 +-
fs/hfs/extent.c                            |   4 +-
fs/hfs/inode.c                             |   4 +-
fs/hfsplus/attributes.c                    |  10 +-
fs/hfsplus/catalog.c                       |   2 +-
fs/hfsplus/dir.c                           |   6 +-
fs/hfsplus/extents.c                       |   6 +-
fs/hfsplus/inode.c                         |   8 +-
fs/hfsplus/super.c                         |   6 +-
fs/hfsplus/xattr.c                         |  10 +-
fs/hpfs/dir.c                              |   4 +-
fs/hpfs/dnode.c                            |   4 +-
fs/hpfs/ea.c                               |   4 +-
fs/hpfs/inode.c                            |   4 +-
fs/inode.c                                 |  49 ++-
fs/iomap/ioend.c                           |   2 +-
fs/iomap/trace.h                           |   8 +-
fs/isofs/compress.c                        |   2 +-
fs/isofs/dir.c                             |   2 +-
fs/isofs/inode.c                           |   6 +-
fs/isofs/namei.c                           |   2 +-
fs/jbd2/journal.c                          |   4 +-
fs/jbd2/transaction.c                      |   2 +-
fs/jffs2/dir.c                             |   4 +-
fs/jffs2/file.c                            |   4 +-
fs/jffs2/fs.c                              |  18 +-
fs/jfs/inode.c                             |   2 +-
fs/jfs/jfs_imap.c                          |   2 +-
fs/jfs/jfs_metapage.c                      |   2 +-
fs/lockd/svclock.c                         |   8 +-
fs/lockd/svcsubs.c                         |   2 +-
fs/locks.c                                 |   6 +-
fs/minix/inode.c                           |  10 +-
fs/nfs/dir.c                               |  20 +-
fs/nfs/file.c                              |   8 +-
fs/nfs/filelayout/filelayout.c             |   8 +-
fs/nfs/flexfilelayout/flexfilelayout.c     |   8 +-
fs/nfs/inode.c                             |   6 +-
fs/nfs/nfs4proc.c                          |   4 +-
fs/nfs/pnfs.c                              |  12 +-
fs/nfsd/export.c                           |   2 +-
fs/nfsd/nfs4state.c                        |   4 +-
fs/nfsd/nfsfh.c                            |   4 +-
fs/nfsd/vfs.c                              |   2 +-
fs/nilfs2/alloc.c                          |  10 +-
fs/nilfs2/bmap.c                           |   2 +-
fs/nilfs2/btnode.c                         |   2 +-
fs/nilfs2/btree.c                          |  12 +-
fs/nilfs2/dir.c                            |  12 +-
fs/nilfs2/direct.c                         |   4 +-
fs/nilfs2/gcinode.c                        |   2 +-
fs/nilfs2/inode.c                          |   8 +-
fs/nilfs2/mdt.c                            |   2 +-
fs/nilfs2/namei.c                          |   2 +-
fs/nilfs2/segment.c                        |   2 +-
fs/notify/fdinfo.c                         |   4 +-
fs/nsfs.c                                  |   4 +-
fs/ntfs3/super.c                           |   2 +-
fs/ocfs2/alloc.c                           |   2 +-
fs/ocfs2/aops.c                            |   4 +-
fs/ocfs2/dir.c                             |   8 +-
fs/ocfs2/dlmfs/dlmfs.c                     |  10 +-
fs/ocfs2/extent_map.c                      |  12 +-
fs/ocfs2/inode.c                           |   2 +-
fs/ocfs2/quota_local.c                     |   2 +-
fs/ocfs2/refcounttree.c                    |  10 +-
fs/ocfs2/xattr.c                           |   4 +-
fs/orangefs/inode.c                        |   2 +-
fs/overlayfs/export.c                      |   2 +-
fs/overlayfs/namei.c                       |   4 +-
fs/overlayfs/util.c                        |   2 +-
fs/pipe.c                                  |   2 +-
fs/proc/fd.c                               |   2 +-
fs/proc/task_mmu.c                         |   4 +-
fs/qnx4/inode.c                            |   4 +-
fs/qnx6/inode.c                            |   2 +-
fs/ubifs/debug.c                           |   8 +-
fs/ubifs/dir.c                             |  28 +-
fs/ubifs/file.c                            |  28 +-
fs/ubifs/journal.c                         |   6 +-
fs/ubifs/super.c                           |  16 +-
fs/ubifs/tnc.c                             |   4 +-
fs/ubifs/xattr.c                           |  14 +-
fs/udf/directory.c                         |  18 +-
fs/udf/file.c                              |   2 +-
fs/udf/inode.c                             |  12 +-
fs/udf/namei.c                             |   8 +-
fs/udf/super.c                             |   2 +-
fs/ufs/balloc.c                            |   6 +-
fs/ufs/dir.c                               |  10 +-
fs/ufs/ialloc.c                            |   6 +-
fs/ufs/inode.c                             |  18 +-
fs/ufs/ufs_fs.h                            |   6 +-
fs/ufs/util.c                              |   2 +-
fs/verity/init.c                           |   2 +-
fs/zonefs/super.c                          |   8 +-
fs/zonefs/trace.h                          |  18 +-
include/linux/audit.h                      |   2 +-
include/linux/fs.h                         |  28 +-
include/net/sock.h                         |   4 +-
include/trace/events/cachefiles.h          |  18 +-
include/trace/events/ext4.h                | 544 ++++++++++++++---------------
include/trace/events/f2fs.h                | 242 ++++++-------
include/trace/events/filelock.h            |  34 +-
include/trace/events/filemap.h             |  20 +-
include/trace/events/fs_dax.h              |  20 +-
include/trace/events/fsverity.h            |  30 +-
include/trace/events/hugetlbfs.h           |  42 +--
include/trace/events/netfs.h               |   8 +-
include/trace/events/nilfs2.h              |  12 +-
include/trace/events/readahead.h           |  18 +-
include/trace/events/timestamp.h           |  16 +-
include/trace/events/writeback.h           | 162 ++++-----
kernel/audit.h                             |  13 +-
kernel/audit_fsnotify.c                    |   4 +-
kernel/audit_watch.c                       |  12 +-
kernel/auditsc.c                           |   4 +-
kernel/events/uprobes.c                    |   4 +-
net/ax25/af_ax25.c                         |   2 +-
net/bluetooth/af_bluetooth.c               |   4 +-
net/can/bcm.c                              |   2 +-
net/ipv4/ping.c                            |   2 +-
net/ipv4/raw.c                             |   2 +-
net/ipv4/tcp_ipv4.c                        |   2 +-
net/ipv4/udp.c                             |   2 +-
net/ipv6/datagram.c                        |   2 +-
net/ipv6/tcp_ipv6.c                        |   2 +-
net/key/af_key.c                           |   2 +-
net/netlink/af_netlink.c                   |   2 +-
net/netlink/diag.c                         |   2 +-
net/netrom/af_netrom.c                     |   4 +-
net/packet/af_packet.c                     |   2 +-
net/packet/diag.c                          |   2 +-
net/phonet/socket.c                        |   4 +-
net/rose/af_rose.c                         |   4 +-
net/sctp/proc.c                            |   4 +-
net/socket.c                               |   2 +-
net/unix/af_unix.c                         |   2 +-
net/unix/diag.c                            |   6 +-
net/x25/x25_proc.c                         |   4 +-
net/xdp/xsk_diag.c                         |   2 +-
security/apparmor/apparmorfs.c             |   4 +-
security/integrity/integrity_audit.c       |   2 +-
security/ipe/audit.c                       |   2 +-
security/lsm_audit.c                       |  10 +-
security/selinux/hooks.c                   |  10 +-
security/smack/smack_lsm.c                 |  12 +-
220 files changed, 1282 insertions(+), 1283 deletions(-)
[PATCH v3 00/12] vfs: change inode->i_ino from unsigned long to u64
Posted by Jeff Layton 1 month ago
This version squashes all of the format-string changes and the i_ino
type change into the same patch. This results in a giant 600+ line patch
at the end of the series, but it does remain bisectable.  Because the
patchset was reorganized (again) some of the R-b's and A-b's have been
dropped.

The entire pile is in the "iino-u64" branch of my tree, if anyone is
interested in testing this.

    https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/

Original cover letter follows:

----------------------8<-----------------------

Christian said [1] to "just do it" when I proposed this, so here we are!

For historical reasons, the inode->i_ino field is an unsigned long,
which means that it's 32 bits on 32 bit architectures. This has caused a
number of filesystems to implement hacks to hash a 64-bit identifier
into a 32-bit field, and deprives us of a universal identifier field for
an inode.

This patchset changes the inode->i_ino field from an unsigned long to a
u64. This shouldn't make any material difference on 64-bit hosts, but
32-bit hosts will see struct inode grow by at least 4 bytes. This could
have effects on slabcache sizes and field alignment.

The bulk of the changes are to format strings and tracepoints, since the
kernel itself doesn't care that much about the i_ino field. The first
patch changes some vfs function arguments, so check that one out
carefully.

With this change, we may be able to shrink some inode structures. For
instance, struct nfs_inode has a fileid field that holds the 64-bit
inode number. With this set of changes, that field could be eliminated.
I'd rather leave that sort of cleanups for later just to keep this
simple.

Much of this set was generated by LLM, but I attributed it to myself
since I consider this to be in the "menial tasks" category of LLM usage.

[1]: https://lore.kernel.org/linux-fsdevel/20260219-portrait-winkt-959070cee42f@brauner/

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Changes in v3:
- reorganize set for fewer patches, drop kino_t typedef and PRIino macro
- reorganize more TP_struct fields for better packing
- clean up ext4 goal calculation in ext4_ext_migrate()
- make audit_inode_hash() take a 64-bit argument
- Link to v2: https://lore.kernel.org/r/20260302-iino-u64-v2-0-e5388800dae0@kernel.org

Changes in v2:
- Use a typedef and macro and do the change in two steps to make it cleanly bisectable
- Fix check_for_busy_inodes() in fscrypt
- Added patch to reorganize tracepoint structs for better packing
- Added patch to change sock.sk_ino to u64
- Added patch to clean up internal handling of inode numbers in audit subsystem
- Drop some unnecessary casts
- Link to v1: https://lore.kernel.org/r/20260226-iino-u64-v1-0-ccceff366db9@kernel.org

---
Jeff Layton (12):
      vfs: widen inode hash/lookup functions to u64
      audit: widen ino fields to u64
      net: change sock.sk_ino and sock_i_ino() to u64
      vfs: widen trace event i_ino fields to u64
      cachefiles: widen trace event i_ino fields to u64
      ext2: widen trace event i_ino fields to u64
      hugetlbfs: widen trace event i_ino fields to u64
      zonefs: widen trace event i_ino fields to u64
      ext4: widen trace event i_ino fields to u64
      f2fs: widen trace event i_ino fields to u64
      nilfs2: widen trace event i_ino fields to u64
      treewide: change inode->i_ino from unsigned long to u64

 drivers/dma-buf/dma-buf.c                  |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c |   4 +-
 fs/9p/vfs_addr.c                           |   4 +-
 fs/9p/vfs_inode.c                          |   6 +-
 fs/9p/vfs_inode_dotl.c                     |   6 +-
 fs/affs/amigaffs.c                         |  10 +-
 fs/affs/bitmap.c                           |   2 +-
 fs/affs/dir.c                              |   2 +-
 fs/affs/file.c                             |  20 +-
 fs/affs/inode.c                            |  12 +-
 fs/affs/namei.c                            |  14 +-
 fs/affs/symlink.c                          |   2 +-
 fs/afs/dir.c                               |  10 +-
 fs/afs/dir_search.c                        |   2 +-
 fs/afs/dynroot.c                           |   2 +-
 fs/afs/inode.c                             |   2 +-
 fs/autofs/inode.c                          |   2 +-
 fs/befs/linuxvfs.c                         |  28 +-
 fs/bfs/dir.c                               |   4 +-
 fs/cachefiles/io.c                         |   6 +-
 fs/cachefiles/namei.c                      |  12 +-
 fs/cachefiles/xattr.c                      |   2 +-
 fs/ceph/crypto.c                           |   4 +-
 fs/coda/dir.c                              |   2 +-
 fs/coda/inode.c                            |   2 +-
 fs/cramfs/inode.c                          |   2 +-
 fs/crypto/crypto.c                         |   2 +-
 fs/crypto/hooks.c                          |   2 +-
 fs/crypto/keyring.c                        |   4 +-
 fs/crypto/keysetup.c                       |   2 +-
 fs/dcache.c                                |   4 +-
 fs/ecryptfs/crypto.c                       |   6 +-
 fs/ecryptfs/file.c                         |   2 +-
 fs/efs/inode.c                             |   6 +-
 fs/eventpoll.c                             |   2 +-
 fs/exportfs/expfs.c                        |   4 +-
 fs/ext2/dir.c                              |  10 +-
 fs/ext2/ialloc.c                           |   9 +-
 fs/ext2/inode.c                            |   2 +-
 fs/ext2/trace.h                            |   8 +-
 fs/ext2/xattr.c                            |  14 +-
 fs/ext4/dir.c                              |   2 +-
 fs/ext4/ext4.h                             |   4 +-
 fs/ext4/extents.c                          |   8 +-
 fs/ext4/extents_status.c                   |  28 +-
 fs/ext4/fast_commit.c                      |   8 +-
 fs/ext4/ialloc.c                           |  10 +-
 fs/ext4/indirect.c                         |   2 +-
 fs/ext4/inline.c                           |  14 +-
 fs/ext4/inode.c                            |  22 +-
 fs/ext4/ioctl.c                            |   4 +-
 fs/ext4/mballoc.c                          |   6 +-
 fs/ext4/migrate.c                          |   2 +-
 fs/ext4/move_extent.c                      |  20 +-
 fs/ext4/namei.c                            |  10 +-
 fs/ext4/orphan.c                           |  16 +-
 fs/ext4/page-io.c                          |  10 +-
 fs/ext4/super.c                            |  22 +-
 fs/ext4/xattr.c                            |  10 +-
 fs/f2fs/compress.c                         |   4 +-
 fs/f2fs/dir.c                              |   2 +-
 fs/f2fs/extent_cache.c                     |   8 +-
 fs/f2fs/f2fs.h                             |   6 +-
 fs/f2fs/file.c                             |  12 +-
 fs/f2fs/gc.c                               |   2 +-
 fs/f2fs/inline.c                           |   4 +-
 fs/f2fs/inode.c                            |  48 +--
 fs/f2fs/namei.c                            |   8 +-
 fs/f2fs/node.c                             |  12 +-
 fs/f2fs/recovery.c                         |  10 +-
 fs/f2fs/xattr.c                            |  10 +-
 fs/freevxfs/vxfs_bmap.c                    |   4 +-
 fs/fserror.c                               |   2 +-
 fs/hfs/catalog.c                           |   2 +-
 fs/hfs/extent.c                            |   4 +-
 fs/hfs/inode.c                             |   4 +-
 fs/hfsplus/attributes.c                    |  10 +-
 fs/hfsplus/catalog.c                       |   2 +-
 fs/hfsplus/dir.c                           |   6 +-
 fs/hfsplus/extents.c                       |   6 +-
 fs/hfsplus/inode.c                         |   8 +-
 fs/hfsplus/super.c                         |   6 +-
 fs/hfsplus/xattr.c                         |  10 +-
 fs/hpfs/dir.c                              |   4 +-
 fs/hpfs/dnode.c                            |   4 +-
 fs/hpfs/ea.c                               |   4 +-
 fs/hpfs/inode.c                            |   4 +-
 fs/inode.c                                 |  49 ++-
 fs/iomap/ioend.c                           |   2 +-
 fs/iomap/trace.h                           |   8 +-
 fs/isofs/compress.c                        |   2 +-
 fs/isofs/dir.c                             |   2 +-
 fs/isofs/inode.c                           |   6 +-
 fs/isofs/namei.c                           |   2 +-
 fs/jbd2/journal.c                          |   4 +-
 fs/jbd2/transaction.c                      |   2 +-
 fs/jffs2/dir.c                             |   4 +-
 fs/jffs2/file.c                            |   4 +-
 fs/jffs2/fs.c                              |  18 +-
 fs/jfs/inode.c                             |   2 +-
 fs/jfs/jfs_imap.c                          |   2 +-
 fs/jfs/jfs_metapage.c                      |   2 +-
 fs/lockd/svclock.c                         |   8 +-
 fs/lockd/svcsubs.c                         |   2 +-
 fs/locks.c                                 |   6 +-
 fs/minix/inode.c                           |  10 +-
 fs/nfs/dir.c                               |  20 +-
 fs/nfs/file.c                              |   8 +-
 fs/nfs/filelayout/filelayout.c             |   8 +-
 fs/nfs/flexfilelayout/flexfilelayout.c     |   8 +-
 fs/nfs/inode.c                             |   6 +-
 fs/nfs/nfs4proc.c                          |   4 +-
 fs/nfs/pnfs.c                              |  12 +-
 fs/nfsd/export.c                           |   2 +-
 fs/nfsd/nfs4state.c                        |   4 +-
 fs/nfsd/nfsfh.c                            |   4 +-
 fs/nfsd/vfs.c                              |   2 +-
 fs/nilfs2/alloc.c                          |  10 +-
 fs/nilfs2/bmap.c                           |   2 +-
 fs/nilfs2/btnode.c                         |   2 +-
 fs/nilfs2/btree.c                          |  12 +-
 fs/nilfs2/dir.c                            |  12 +-
 fs/nilfs2/direct.c                         |   4 +-
 fs/nilfs2/gcinode.c                        |   2 +-
 fs/nilfs2/inode.c                          |   8 +-
 fs/nilfs2/mdt.c                            |   2 +-
 fs/nilfs2/namei.c                          |   2 +-
 fs/nilfs2/segment.c                        |   2 +-
 fs/notify/fdinfo.c                         |   4 +-
 fs/nsfs.c                                  |   4 +-
 fs/ntfs3/super.c                           |   2 +-
 fs/ocfs2/alloc.c                           |   2 +-
 fs/ocfs2/aops.c                            |   4 +-
 fs/ocfs2/dir.c                             |   8 +-
 fs/ocfs2/dlmfs/dlmfs.c                     |  10 +-
 fs/ocfs2/extent_map.c                      |  12 +-
 fs/ocfs2/inode.c                           |   2 +-
 fs/ocfs2/quota_local.c                     |   2 +-
 fs/ocfs2/refcounttree.c                    |  10 +-
 fs/ocfs2/xattr.c                           |   4 +-
 fs/orangefs/inode.c                        |   2 +-
 fs/overlayfs/export.c                      |   2 +-
 fs/overlayfs/namei.c                       |   4 +-
 fs/overlayfs/util.c                        |   2 +-
 fs/pipe.c                                  |   2 +-
 fs/proc/fd.c                               |   2 +-
 fs/proc/task_mmu.c                         |   4 +-
 fs/qnx4/inode.c                            |   4 +-
 fs/qnx6/inode.c                            |   2 +-
 fs/ubifs/debug.c                           |   8 +-
 fs/ubifs/dir.c                             |  28 +-
 fs/ubifs/file.c                            |  28 +-
 fs/ubifs/journal.c                         |   6 +-
 fs/ubifs/super.c                           |  16 +-
 fs/ubifs/tnc.c                             |   4 +-
 fs/ubifs/xattr.c                           |  14 +-
 fs/udf/directory.c                         |  18 +-
 fs/udf/file.c                              |   2 +-
 fs/udf/inode.c                             |  12 +-
 fs/udf/namei.c                             |   8 +-
 fs/udf/super.c                             |   2 +-
 fs/ufs/balloc.c                            |   6 +-
 fs/ufs/dir.c                               |  10 +-
 fs/ufs/ialloc.c                            |   6 +-
 fs/ufs/inode.c                             |  18 +-
 fs/ufs/ufs_fs.h                            |   6 +-
 fs/ufs/util.c                              |   2 +-
 fs/verity/init.c                           |   2 +-
 fs/zonefs/super.c                          |   8 +-
 fs/zonefs/trace.h                          |  18 +-
 include/linux/audit.h                      |   2 +-
 include/linux/fs.h                         |  28 +-
 include/net/sock.h                         |   4 +-
 include/trace/events/cachefiles.h          |  18 +-
 include/trace/events/ext4.h                | 544 ++++++++++++++---------------
 include/trace/events/f2fs.h                | 242 ++++++-------
 include/trace/events/filelock.h            |  34 +-
 include/trace/events/filemap.h             |  20 +-
 include/trace/events/fs_dax.h              |  20 +-
 include/trace/events/fsverity.h            |  30 +-
 include/trace/events/hugetlbfs.h           |  42 +--
 include/trace/events/netfs.h               |   8 +-
 include/trace/events/nilfs2.h              |  12 +-
 include/trace/events/readahead.h           |  18 +-
 include/trace/events/timestamp.h           |  16 +-
 include/trace/events/writeback.h           | 162 ++++-----
 kernel/audit.h                             |  13 +-
 kernel/audit_fsnotify.c                    |   4 +-
 kernel/audit_watch.c                       |  12 +-
 kernel/auditsc.c                           |   4 +-
 kernel/events/uprobes.c                    |   4 +-
 net/ax25/af_ax25.c                         |   2 +-
 net/bluetooth/af_bluetooth.c               |   4 +-
 net/can/bcm.c                              |   2 +-
 net/ipv4/ping.c                            |   2 +-
 net/ipv4/raw.c                             |   2 +-
 net/ipv4/tcp_ipv4.c                        |   2 +-
 net/ipv4/udp.c                             |   2 +-
 net/ipv6/datagram.c                        |   2 +-
 net/ipv6/tcp_ipv6.c                        |   2 +-
 net/key/af_key.c                           |   2 +-
 net/netlink/af_netlink.c                   |   2 +-
 net/netlink/diag.c                         |   2 +-
 net/netrom/af_netrom.c                     |   4 +-
 net/packet/af_packet.c                     |   2 +-
 net/packet/diag.c                          |   2 +-
 net/phonet/socket.c                        |   4 +-
 net/rose/af_rose.c                         |   4 +-
 net/sctp/proc.c                            |   4 +-
 net/socket.c                               |   2 +-
 net/unix/af_unix.c                         |   2 +-
 net/unix/diag.c                            |   6 +-
 net/x25/x25_proc.c                         |   4 +-
 net/xdp/xsk_diag.c                         |   2 +-
 security/apparmor/apparmorfs.c             |   4 +-
 security/integrity/integrity_audit.c       |   2 +-
 security/ipe/audit.c                       |   2 +-
 security/lsm_audit.c                       |  10 +-
 security/selinux/hooks.c                   |  10 +-
 security/smack/smack_lsm.c                 |  12 +-
 220 files changed, 1282 insertions(+), 1283 deletions(-)
---
base-commit: 842cfe0733c5a03982a7ae496de6fdc0dd661a41
change-id: 20260224-iino-u64-b44a3a72543c

Best regards,
-- 
Jeff Layton <jlayton@kernel.org>
Re: [PATCH v3 00/12] vfs: change inode->i_ino from unsigned long to u64
Posted by Woody Suwalski 1 month ago
Jeff Layton wrote:
> This version squashes all of the format-string changes and the i_ino
> type change into the same patch. This results in a giant 600+ line patch
> at the end of the series, but it does remain bisectable.  Because the
> patchset was reorganized (again) some of the R-b's and A-b's have been
> dropped.
>
> The entire pile is in the "iino-u64" branch of my tree, if anyone is
> interested in testing this.
>
>      https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/
>
> Original cover letter follows:
>
> ----------------------8<-----------------------
>
> Christian said [1] to "just do it" when I proposed this, so here we are!
>
> For historical reasons, the inode->i_ino field is an unsigned long,
> which means that it's 32 bits on 32 bit architectures. This has caused a
> number of filesystems to implement hacks to hash a 64-bit identifier
> into a 32-bit field, and deprives us of a universal identifier field for
> an inode.
>
> This patchset changes the inode->i_ino field from an unsigned long to a
> u64. This shouldn't make any material difference on 64-bit hosts, but
> 32-bit hosts will see struct inode grow by at least 4 bytes. This could
> have effects on slabcache sizes and field alignment.
>
> The bulk of the changes are to format strings and tracepoints, since the
> kernel itself doesn't care that much about the i_ino field. The first
> patch changes some vfs function arguments, so check that one out
> carefully.
>
> With this change, we may be able to shrink some inode structures. For
> instance, struct nfs_inode has a fileid field that holds the 64-bit
> inode number. With this set of changes, that field could be eliminated.
> I'd rather leave that sort of cleanups for later just to keep this
> simple.
>
> Much of this set was generated by LLM, but I attributed it to myself
> since I consider this to be in the "menial tasks" category of LLM usage.
>
> [1]: https://lore.kernel.org/linux-fsdevel/20260219-portrait-winkt-959070cee42f@brauner/
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
>
Jeff, would you be able to "guestimate" how much extra memory 
requirement will it impose on 32-bit architectures? Probably nothing 
critical, but good to know :-)

Thanks, Woody
Re: [PATCH v3 00/12] vfs: change inode->i_ino from unsigned long to u64
Posted by Jeff Layton 1 month ago
On Wed, 2026-03-04 at 12:03 -0500, Woody Suwalski wrote:
> Jeff Layton wrote:
> > This version squashes all of the format-string changes and the i_ino
> > type change into the same patch. This results in a giant 600+ line patch
> > at the end of the series, but it does remain bisectable.  Because the
> > patchset was reorganized (again) some of the R-b's and A-b's have been
> > dropped.
> > 
> > The entire pile is in the "iino-u64" branch of my tree, if anyone is
> > interested in testing this.
> > 
> >      https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/
> > 
> > Original cover letter follows:
> > 
> > ----------------------8<-----------------------
> > 
> > Christian said [1] to "just do it" when I proposed this, so here we are!
> > 
> > For historical reasons, the inode->i_ino field is an unsigned long,
> > which means that it's 32 bits on 32 bit architectures. This has caused a
> > number of filesystems to implement hacks to hash a 64-bit identifier
> > into a 32-bit field, and deprives us of a universal identifier field for
> > an inode.
> > 
> > This patchset changes the inode->i_ino field from an unsigned long to a
> > u64. This shouldn't make any material difference on 64-bit hosts, but
> > 32-bit hosts will see struct inode grow by at least 4 bytes. This could
> > have effects on slabcache sizes and field alignment.
> > 
> > The bulk of the changes are to format strings and tracepoints, since the
> > kernel itself doesn't care that much about the i_ino field. The first
> > patch changes some vfs function arguments, so check that one out
> > carefully.
> > 
> > With this change, we may be able to shrink some inode structures. For
> > instance, struct nfs_inode has a fileid field that holds the 64-bit
> > inode number. With this set of changes, that field could be eliminated.
> > I'd rather leave that sort of cleanups for later just to keep this
> > simple.
> > 
> > Much of this set was generated by LLM, but I attributed it to myself
> > since I consider this to be in the "menial tasks" category of LLM usage.
> > 
> > [1]: https://lore.kernel.org/linux-fsdevel/20260219-portrait-winkt-959070cee42f@brauner/
> > 
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > 
> Jeff, would you be able to "guestimate" how much extra memory 
> requirement will it impose on 32-bit architectures? Probably nothing 
> critical, but good to know :-)
> 
> Thanks, Woody

It's hard to say since inode counts can vary widely depending on
workload, memory sizing and tuning:

If you have a particular machine in mind, you can look at the first
column in /proc/sys/fs/inode-state to get a current count of allocated
inodes on your system. Multiply that by 4 bytes and you get a best case
for the memory increase.

The real increase might be worse however -- this can have slabcache
alignment effects (and different filesystems have different inode
sizes). We may end up being able to mitigate this to some degree
however.

For instance, nfs (like many filesystems) carries a separate "fileid"
field in struct nfs_inode. That could now be dropped in favor of i_ino
since we always know it's a u64.

This set doesn't go that far because I want to keep this changeset as
small as possible, but there is a lot of that sort of low-hanging
cleanup that should be possible after this set goes in.
-- 
Jeff Layton <jlayton@kernel.org>
Re: [PATCH v3 00/12] vfs: change inode->i_ino from unsigned long to u64
Posted by Christian Brauner 1 month ago
On Wed, 04 Mar 2026 10:32:30 -0500, Jeff Layton wrote:
> Christian said [1] to "just do it" when I proposed this, so here we are!
> 
> For historical reasons, the inode->i_ino field is an unsigned long,
> which means that it's 32 bits on 32 bit architectures. This has caused a
> number of filesystems to implement hacks to hash a 64-bit identifier
> into a 32-bit field, and deprives us of a universal identifier field for
> an inode.
> 
> [...]

This series makes me happy. We've been talking about this conversion for
a while and I'm thankful that you did this work. Without the automation
available this probably wouldn't have happened as quickly as it did now.
Let's see what bits and pieces it missed.

---

Applied to the vfs-7.1.kino branch of the vfs/vfs.git tree.
Patches in the vfs-7.1.kino branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.1.kino

[01/12] vfs: widen inode hash/lookup functions to u64
        https://git.kernel.org/vfs/vfs/c/2412a9fa518a
[02/12] audit: widen ino fields to u64
        https://git.kernel.org/vfs/vfs/c/a5e863be4d02
[03/12] net: change sock.sk_ino and sock_i_ino() to u64
        https://git.kernel.org/vfs/vfs/c/c21144a0a33f
[04/12] vfs: widen trace event i_ino fields to u64
        https://git.kernel.org/vfs/vfs/c/5e5c380870b2
[05/12] cachefiles: widen trace event i_ino fields to u64
        https://git.kernel.org/vfs/vfs/c/25291f67aad7
[06/12] ext2: widen trace event i_ino fields to u64
        https://git.kernel.org/vfs/vfs/c/797d04a355e3
[07/12] hugetlbfs: widen trace event i_ino fields to u64
        https://git.kernel.org/vfs/vfs/c/3c976fb36a9a
[08/12] zonefs: widen trace event i_ino fields to u64
        https://git.kernel.org/vfs/vfs/c/988f68c01b3a
[09/12] ext4: widen trace event i_ino fields to u64
        https://git.kernel.org/vfs/vfs/c/1c1427c79bc2
[10/12] f2fs: widen trace event i_ino fields to u64
        https://git.kernel.org/vfs/vfs/c/6e62bf74bd8a
[11/12] nilfs2: widen trace event i_ino fields to u64
        https://git.kernel.org/vfs/vfs/c/6ce73711525a
[12/12] treewide: change inode->i_ino from unsigned long to u64
        https://git.kernel.org/vfs/vfs/c/af82d143e869
Re: [PATCH v3 00/12] vfs: change inode->i_ino from unsigned long to u64
Posted by Mimi Zohar 4 weeks ago
[ I/O socket time out.  Trimming the To list.]

On Wed, 2026-03-04 at 10:32 -0500, Jeff Layton wrote:
> This version squashes all of the format-string changes and the i_ino
> type change into the same patch. This results in a giant 600+ line patch
> at the end of the series, but it does remain bisectable.  Because the
> patchset was reorganized (again) some of the R-b's and A-b's have been
> dropped.
> 
> The entire pile is in the "iino-u64" branch of my tree, if anyone is
> interested in testing this.
> 
>     https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/
> 
> Original cover letter follows:
> 
> ----------------------8<-----------------------
> 
> Christian said [1] to "just do it" when I proposed this, so here we are!
> 
> For historical reasons, the inode->i_ino field is an unsigned long,
> which means that it's 32 bits on 32 bit architectures. This has caused a
> number of filesystems to implement hacks to hash a 64-bit identifier
> into a 32-bit field, and deprives us of a universal identifier field for
> an inode.
> 
> This patchset changes the inode->i_ino field from an unsigned long to a
> u64. This shouldn't make any material difference on 64-bit hosts, but
> 32-bit hosts will see struct inode grow by at least 4 bytes. This could
> have effects on slabcache sizes and field alignment.
> 
> The bulk of the changes are to format strings and tracepoints, since the
> kernel itself doesn't care that much about the i_ino field. The first
> patch changes some vfs function arguments, so check that one out
> carefully.
> 
> With this change, we may be able to shrink some inode structures. For
> instance, struct nfs_inode has a fileid field that holds the 64-bit
> inode number. With this set of changes, that field could be eliminated.
> I'd rather leave that sort of cleanups for later just to keep this
> simple.
> 
> Much of this set was generated by LLM, but I attributed it to myself
> since I consider this to be in the "menial tasks" category of LLM usage.
> 
> [1]: https://lore.kernel.org/linux-fsdevel/20260219-portrait-winkt-959070cee42f@brauner/
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Jeff, missing from this patch set is EVM.  In hmac_add_misc() EVM copies the
i_ino and calculates either an HMAC or file meta-data hash, which is then
signed. 

Mimi
Re: [PATCH v3 00/12] vfs: change inode->i_ino from unsigned long to u64
Posted by Jeff Layton 4 weeks ago
On Mon, 2026-03-09 at 13:47 -0400, Mimi Zohar wrote:
> [ I/O socket time out.  Trimming the To list.]
> 
> On Wed, 2026-03-04 at 10:32 -0500, Jeff Layton wrote:
> > This version squashes all of the format-string changes and the i_ino
> > type change into the same patch. This results in a giant 600+ line patch
> > at the end of the series, but it does remain bisectable.  Because the
> > patchset was reorganized (again) some of the R-b's and A-b's have been
> > dropped.
> > 
> > The entire pile is in the "iino-u64" branch of my tree, if anyone is
> > interested in testing this.
> > 
> >     https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/
> > 
> > Original cover letter follows:
> > 
> > ----------------------8<-----------------------
> > 
> > Christian said [1] to "just do it" when I proposed this, so here we are!
> > 
> > For historical reasons, the inode->i_ino field is an unsigned long,
> > which means that it's 32 bits on 32 bit architectures. This has caused a
> > number of filesystems to implement hacks to hash a 64-bit identifier
> > into a 32-bit field, and deprives us of a universal identifier field for
> > an inode.
> > 
> > This patchset changes the inode->i_ino field from an unsigned long to a
> > u64. This shouldn't make any material difference on 64-bit hosts, but
> > 32-bit hosts will see struct inode grow by at least 4 bytes. This could
> > have effects on slabcache sizes and field alignment.
> > 
> > The bulk of the changes are to format strings and tracepoints, since the
> > kernel itself doesn't care that much about the i_ino field. The first
> > patch changes some vfs function arguments, so check that one out
> > carefully.
> > 
> > With this change, we may be able to shrink some inode structures. For
> > instance, struct nfs_inode has a fileid field that holds the 64-bit
> > inode number. With this set of changes, that field could be eliminated.
> > I'd rather leave that sort of cleanups for later just to keep this
> > simple.
> > 
> > Much of this set was generated by LLM, but I attributed it to myself
> > since I consider this to be in the "menial tasks" category of LLM usage.
> > 
> > [1]: https://lore.kernel.org/linux-fsdevel/20260219-portrait-winkt-959070cee42f@brauner/
> > 
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> 
> Jeff, missing from this patch set is EVM.  In hmac_add_misc() EVM copies the
> i_ino and calculates either an HMAC or file meta-data hash, which is then
> signed. 
> 
> 

Thanks Mimi, good catch.

It looks like we should just be able to change the ino field to a u64
alongside everything else. Something like this:

diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c
index c0ca4eedb0fe..77b6c2fa345e 100644
--- a/security/integrity/evm/evm_crypto.c
+++ b/security/integrity/evm/evm_crypto.c
@@ -144,7 +144,7 @@ static void hmac_add_misc(struct shash_desc *desc, struct inode *inode,
                          char type, char *digest)
 {
        struct h_misc {
-               unsigned long ino;
+               u64 ino;
                __u32 generation;
                uid_t uid;
                gid_t gid;



That should make no material difference on 64-bit hosts. What's the
effect on 32-bit? Will they just need to remeasure everything or would
the consequences be more dire? Do we have any clue whether anyone is
using EVM in 32-bit environments?

Thanks,
-- 
Jeff Layton <jlayton@kernel.org>
Re: [PATCH v3 00/12] vfs: change inode->i_ino from unsigned long to u64
Posted by Mimi Zohar 4 weeks ago
On Mon, 2026-03-09 at 13:59 -0400, Jeff Layton wrote:
> On Mon, 2026-03-09 at 13:47 -0400, Mimi Zohar wrote:
> > [ I/O socket time out.  Trimming the To list.]
> > 
> > On Wed, 2026-03-04 at 10:32 -0500, Jeff Layton wrote:
> > > This version squashes all of the format-string changes and the i_ino
> > > type change into the same patch. This results in a giant 600+ line patch
> > > at the end of the series, but it does remain bisectable.  Because the
> > > patchset was reorganized (again) some of the R-b's and A-b's have been
> > > dropped.
> > > 
> > > The entire pile is in the "iino-u64" branch of my tree, if anyone is
> > > interested in testing this.
> > > 
> > >     https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/
> > > 
> > > Original cover letter follows:
> > > 
> > > ----------------------8<-----------------------
> > > 
> > > Christian said [1] to "just do it" when I proposed this, so here we are!
> > > 
> > > For historical reasons, the inode->i_ino field is an unsigned long,
> > > which means that it's 32 bits on 32 bit architectures. This has caused a
> > > number of filesystems to implement hacks to hash a 64-bit identifier
> > > into a 32-bit field, and deprives us of a universal identifier field for
> > > an inode.
> > > 
> > > This patchset changes the inode->i_ino field from an unsigned long to a
> > > u64. This shouldn't make any material difference on 64-bit hosts, but
> > > 32-bit hosts will see struct inode grow by at least 4 bytes. This could
> > > have effects on slabcache sizes and field alignment.
> > > 
> > > The bulk of the changes are to format strings and tracepoints, since the
> > > kernel itself doesn't care that much about the i_ino field. The first
> > > patch changes some vfs function arguments, so check that one out
> > > carefully.
> > > 
> > > With this change, we may be able to shrink some inode structures. For
> > > instance, struct nfs_inode has a fileid field that holds the 64-bit
> > > inode number. With this set of changes, that field could be eliminated.
> > > I'd rather leave that sort of cleanups for later just to keep this
> > > simple.
> > > 
> > > Much of this set was generated by LLM, but I attributed it to myself
> > > since I consider this to be in the "menial tasks" category of LLM usage.
> > > 
> > > [1]: https://lore.kernel.org/linux-fsdevel/20260219-portrait-winkt-959070cee42f@brauner/
> > > 
> > > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > 
> > Jeff, missing from this patch set is EVM.  In hmac_add_misc() EVM copies the
> > i_ino and calculates either an HMAC or file meta-data hash, which is then
> > signed. 
> > 
> > 
> 
> Thanks Mimi, good catch.
> 
> It looks like we should just be able to change the ino field to a u64
> alongside everything else. Something like this:
> 
> diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c
> index c0ca4eedb0fe..77b6c2fa345e 100644
> --- a/security/integrity/evm/evm_crypto.c
> +++ b/security/integrity/evm/evm_crypto.c
> @@ -144,7 +144,7 @@ static void hmac_add_misc(struct shash_desc *desc, struct inode *inode,
>                           char type, char *digest)
>  {
>         struct h_misc {
> -               unsigned long ino;
> +               u64 ino;
>                 __u32 generation;
>                 uid_t uid;
>                 gid_t gid;
> 

Agreed.

> 
> That should make no material difference on 64-bit hosts. What's the
> effect on 32-bit? Will they just need to remeasure everything or would
> the consequences be more dire? Do we have any clue whether anyone is
> using EVM in 32-bit environments?

All good questions. Unfortunately I don't know the answer to most of them. What
we do know: changing the size of the i_ino field would affect EVM file metadata
verification and would require relabeling the filesystem.  Even packages
containing EVM portable signatures, which don't include or verify the i_ino
number, would be affected.

Mimi
Re: [PATCH v3 00/12] vfs: change inode->i_ino from unsigned long to u64
Posted by Jeff Layton 4 weeks ago
On Mon, 2026-03-09 at 15:00 -0400, Mimi Zohar wrote:
> On Mon, 2026-03-09 at 13:59 -0400, Jeff Layton wrote:
> > On Mon, 2026-03-09 at 13:47 -0400, Mimi Zohar wrote:
> > > [ I/O socket time out.  Trimming the To list.]
> > > 
> > > On Wed, 2026-03-04 at 10:32 -0500, Jeff Layton wrote:
> > > > This version squashes all of the format-string changes and the i_ino
> > > > type change into the same patch. This results in a giant 600+ line patch
> > > > at the end of the series, but it does remain bisectable.  Because the
> > > > patchset was reorganized (again) some of the R-b's and A-b's have been
> > > > dropped.
> > > > 
> > > > The entire pile is in the "iino-u64" branch of my tree, if anyone is
> > > > interested in testing this.
> > > > 
> > > >     https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/
> > > > 
> > > > Original cover letter follows:
> > > > 
> > > > ----------------------8<-----------------------
> > > > 
> > > > Christian said [1] to "just do it" when I proposed this, so here we are!
> > > > 
> > > > For historical reasons, the inode->i_ino field is an unsigned long,
> > > > which means that it's 32 bits on 32 bit architectures. This has caused a
> > > > number of filesystems to implement hacks to hash a 64-bit identifier
> > > > into a 32-bit field, and deprives us of a universal identifier field for
> > > > an inode.
> > > > 
> > > > This patchset changes the inode->i_ino field from an unsigned long to a
> > > > u64. This shouldn't make any material difference on 64-bit hosts, but
> > > > 32-bit hosts will see struct inode grow by at least 4 bytes. This could
> > > > have effects on slabcache sizes and field alignment.
> > > > 
> > > > The bulk of the changes are to format strings and tracepoints, since the
> > > > kernel itself doesn't care that much about the i_ino field. The first
> > > > patch changes some vfs function arguments, so check that one out
> > > > carefully.
> > > > 
> > > > With this change, we may be able to shrink some inode structures. For
> > > > instance, struct nfs_inode has a fileid field that holds the 64-bit
> > > > inode number. With this set of changes, that field could be eliminated.
> > > > I'd rather leave that sort of cleanups for later just to keep this
> > > > simple.
> > > > 
> > > > Much of this set was generated by LLM, but I attributed it to myself
> > > > since I consider this to be in the "menial tasks" category of LLM usage.
> > > > 
> > > > [1]: https://lore.kernel.org/linux-fsdevel/20260219-portrait-winkt-959070cee42f@brauner/
> > > > 
> > > > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > > 
> > > Jeff, missing from this patch set is EVM.  In hmac_add_misc() EVM copies the
> > > i_ino and calculates either an HMAC or file meta-data hash, which is then
> > > signed. 
> > > 
> > > 
> > 
> > Thanks Mimi, good catch.
> > 
> > It looks like we should just be able to change the ino field to a u64
> > alongside everything else. Something like this:
> > 
> > diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c
> > index c0ca4eedb0fe..77b6c2fa345e 100644
> > --- a/security/integrity/evm/evm_crypto.c
> > +++ b/security/integrity/evm/evm_crypto.c
> > @@ -144,7 +144,7 @@ static void hmac_add_misc(struct shash_desc *desc, struct inode *inode,
> >                           char type, char *digest)
> >  {
> >         struct h_misc {
> > -               unsigned long ino;
> > +               u64 ino;
> >                 __u32 generation;
> >                 uid_t uid;
> >                 gid_t gid;
> > 
> 
> Agreed.
>
> > 
> > That should make no material difference on 64-bit hosts. What's the
> > effect on 32-bit? Will they just need to remeasure everything or would
> > the consequences be more dire? Do we have any clue whether anyone is
> > using EVM in 32-bit environments?
> 
> All good questions. Unfortunately I don't know the answer to most of them. What
> we do know: changing the size of the i_ino field would affect EVM file metadata
> verification and would require relabeling the filesystem.  Even packages
> containing EVM portable signatures, which don't include or verify the i_ino
> number, would be affected.
> 

Ouch. Technically, I guess this is ABI...

While converting to u64 seems like the ideal thing to do, the other
option might be to just keep this as an unsigned long for now.

No effect on 64-bit, but that could keep things working 32-bit when the
i_ino casts properly to a u32. ext4 would be fine since they don't
issue inode numbers larger than UINT_MAX. xfs and btrfs are a bit more
iffy, but worst case they'd just need to be relabeled (which is what
they'll need to do anyway).

If we do that, then we should probably add a comment to this function
explaining why it's an unsigned long.

Thoughts?
-- 
Jeff Layton <jlayton@kernel.org>
Re: [PATCH v3 00/12] vfs: change inode->i_ino from unsigned long to u64
Posted by Mimi Zohar 4 weeks ago
On Mon, 2026-03-09 at 15:33 -0400, Jeff Layton wrote:
> On Mon, 2026-03-09 at 15:00 -0400, Mimi Zohar wrote:
> > On Mon, 2026-03-09 at 13:59 -0400, Jeff Layton wrote:
> > > On Mon, 2026-03-09 at 13:47 -0400, Mimi Zohar wrote:
> > > > [ I/O socket time out.  Trimming the To list.]
> > > > 
> > > > On Wed, 2026-03-04 at 10:32 -0500, Jeff Layton wrote:
> > > > > This version squashes all of the format-string changes and the i_ino
> > > > > type change into the same patch. This results in a giant 600+ line patch
> > > > > at the end of the series, but it does remain bisectable.  Because the
> > > > > patchset was reorganized (again) some of the R-b's and A-b's have been
> > > > > dropped.
> > > > > 
> > > > > The entire pile is in the "iino-u64" branch of my tree, if anyone is
> > > > > interested in testing this.
> > > > > 
> > > > >     https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/
> > > > > 
> > > > > Original cover letter follows:
> > > > > 
> > > > > ----------------------8<-----------------------
> > > > > 
> > > > > Christian said [1] to "just do it" when I proposed this, so here we are!
> > > > > 
> > > > > For historical reasons, the inode->i_ino field is an unsigned long,
> > > > > which means that it's 32 bits on 32 bit architectures. This has caused a
> > > > > number of filesystems to implement hacks to hash a 64-bit identifier
> > > > > into a 32-bit field, and deprives us of a universal identifier field for
> > > > > an inode.
> > > > > 
> > > > > This patchset changes the inode->i_ino field from an unsigned long to a
> > > > > u64. This shouldn't make any material difference on 64-bit hosts, but
> > > > > 32-bit hosts will see struct inode grow by at least 4 bytes. This could
> > > > > have effects on slabcache sizes and field alignment.
> > > > > 
> > > > > The bulk of the changes are to format strings and tracepoints, since the
> > > > > kernel itself doesn't care that much about the i_ino field. The first
> > > > > patch changes some vfs function arguments, so check that one out
> > > > > carefully.
> > > > > 
> > > > > With this change, we may be able to shrink some inode structures. For
> > > > > instance, struct nfs_inode has a fileid field that holds the 64-bit
> > > > > inode number. With this set of changes, that field could be eliminated.
> > > > > I'd rather leave that sort of cleanups for later just to keep this
> > > > > simple.
> > > > > 
> > > > > Much of this set was generated by LLM, but I attributed it to myself
> > > > > since I consider this to be in the "menial tasks" category of LLM usage.
> > > > > 
> > > > > [1]: https://lore.kernel.org/linux-fsdevel/20260219-portrait-winkt-959070cee42f@brauner/
> > > > > 
> > > > > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > > > 
> > > > Jeff, missing from this patch set is EVM.  In hmac_add_misc() EVM copies the
> > > > i_ino and calculates either an HMAC or file meta-data hash, which is then
> > > > signed. 
> > > > 
> > > > 
> > > 
> > > Thanks Mimi, good catch.
> > > 
> > > It looks like we should just be able to change the ino field to a u64
> > > alongside everything else. Something like this:
> > > 
> > > diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c
> > > index c0ca4eedb0fe..77b6c2fa345e 100644
> > > --- a/security/integrity/evm/evm_crypto.c
> > > +++ b/security/integrity/evm/evm_crypto.c
> > > @@ -144,7 +144,7 @@ static void hmac_add_misc(struct shash_desc *desc, struct inode *inode,
> > >                           char type, char *digest)
> > >  {
> > >         struct h_misc {
> > > -               unsigned long ino;
> > > +               u64 ino;
> > >                 __u32 generation;
> > >                 uid_t uid;
> > >                 gid_t gid;
> > > 
> > 
> > Agreed.
> > 
> > > 
> > > That should make no material difference on 64-bit hosts. What's the
> > > effect on 32-bit? Will they just need to remeasure everything or would
> > > the consequences be more dire? Do we have any clue whether anyone is
> > > using EVM in 32-bit environments?
> > 
> > All good questions. Unfortunately I don't know the answer to most of them. What
> > we do know: changing the size of the i_ino field would affect EVM file metadata
> > verification and would require relabeling the filesystem.  Even packages
> > containing EVM portable signatures, which don't include or verify the i_ino
> > number, would be affected.
> > 
> 
> Ouch. Technically, I guess this is ABI...
> 
> While converting to u64 seems like the ideal thing to do, the other
> option might be to just keep this as an unsigned long for now.
> 
> No effect on 64-bit, but that could keep things working 32-bit when the
> i_ino casts properly to a u32. ext4 would be fine since they don't
> issue inode numbers larger than UINT_MAX. xfs and btrfs are a bit more
> iffy, but worst case they'd just need to be relabeled (which is what
> they'll need to do anyway).
> 
> If we do that, then we should probably add a comment to this function
> explaining why it's an unsigned long.

Agreed.

> 
> Thoughts?

My concern would be embedded/IoT devices, but I don't have any insight into who
might be using it on 32 bit.

Mimi
Re: [PATCH v3 00/12] vfs: change inode->i_ino from unsigned long to u64
Posted by Jeff Layton 4 weeks ago
On Mon, 2026-03-09 at 16:11 -0400, Mimi Zohar wrote:
> On Mon, 2026-03-09 at 15:33 -0400, Jeff Layton wrote:
> > On Mon, 2026-03-09 at 15:00 -0400, Mimi Zohar wrote:
> > > On Mon, 2026-03-09 at 13:59 -0400, Jeff Layton wrote:
> > > > On Mon, 2026-03-09 at 13:47 -0400, Mimi Zohar wrote:
> > > > > [ I/O socket time out.  Trimming the To list.]
> > > > > 
> > > > > On Wed, 2026-03-04 at 10:32 -0500, Jeff Layton wrote:
> > > > > > This version squashes all of the format-string changes and the i_ino
> > > > > > type change into the same patch. This results in a giant 600+ line patch
> > > > > > at the end of the series, but it does remain bisectable.  Because the
> > > > > > patchset was reorganized (again) some of the R-b's and A-b's have been
> > > > > > dropped.
> > > > > > 
> > > > > > The entire pile is in the "iino-u64" branch of my tree, if anyone is
> > > > > > interested in testing this.
> > > > > > 
> > > > > >     https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git/
> > > > > > 
> > > > > > Original cover letter follows:
> > > > > > 
> > > > > > ----------------------8<-----------------------
> > > > > > 
> > > > > > Christian said [1] to "just do it" when I proposed this, so here we are!
> > > > > > 
> > > > > > For historical reasons, the inode->i_ino field is an unsigned long,
> > > > > > which means that it's 32 bits on 32 bit architectures. This has caused a
> > > > > > number of filesystems to implement hacks to hash a 64-bit identifier
> > > > > > into a 32-bit field, and deprives us of a universal identifier field for
> > > > > > an inode.
> > > > > > 
> > > > > > This patchset changes the inode->i_ino field from an unsigned long to a
> > > > > > u64. This shouldn't make any material difference on 64-bit hosts, but
> > > > > > 32-bit hosts will see struct inode grow by at least 4 bytes. This could
> > > > > > have effects on slabcache sizes and field alignment.
> > > > > > 
> > > > > > The bulk of the changes are to format strings and tracepoints, since the
> > > > > > kernel itself doesn't care that much about the i_ino field. The first
> > > > > > patch changes some vfs function arguments, so check that one out
> > > > > > carefully.
> > > > > > 
> > > > > > With this change, we may be able to shrink some inode structures. For
> > > > > > instance, struct nfs_inode has a fileid field that holds the 64-bit
> > > > > > inode number. With this set of changes, that field could be eliminated.
> > > > > > I'd rather leave that sort of cleanups for later just to keep this
> > > > > > simple.
> > > > > > 
> > > > > > Much of this set was generated by LLM, but I attributed it to myself
> > > > > > since I consider this to be in the "menial tasks" category of LLM usage.
> > > > > > 
> > > > > > [1]: https://lore.kernel.org/linux-fsdevel/20260219-portrait-winkt-959070cee42f@brauner/
> > > > > > 
> > > > > > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > > > > 
> > > > > Jeff, missing from this patch set is EVM.  In hmac_add_misc() EVM copies the
> > > > > i_ino and calculates either an HMAC or file meta-data hash, which is then
> > > > > signed. 
> > > > > 
> > > > > 
> > > > 
> > > > Thanks Mimi, good catch.
> > > > 
> > > > It looks like we should just be able to change the ino field to a u64
> > > > alongside everything else. Something like this:
> > > > 
> > > > diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c
> > > > index c0ca4eedb0fe..77b6c2fa345e 100644
> > > > --- a/security/integrity/evm/evm_crypto.c
> > > > +++ b/security/integrity/evm/evm_crypto.c
> > > > @@ -144,7 +144,7 @@ static void hmac_add_misc(struct shash_desc *desc, struct inode *inode,
> > > >                           char type, char *digest)
> > > >  {
> > > >         struct h_misc {
> > > > -               unsigned long ino;
> > > > +               u64 ino;
> > > >                 __u32 generation;
> > > >                 uid_t uid;
> > > >                 gid_t gid;
> > > > 
> > > 
> > > Agreed.
> > > 
> > > > 
> > > > That should make no material difference on 64-bit hosts. What's the
> > > > effect on 32-bit? Will they just need to remeasure everything or would
> > > > the consequences be more dire? Do we have any clue whether anyone is
> > > > using EVM in 32-bit environments?
> > > 
> > > All good questions. Unfortunately I don't know the answer to most of them. What
> > > we do know: changing the size of the i_ino field would affect EVM file metadata
> > > verification and would require relabeling the filesystem.  Even packages
> > > containing EVM portable signatures, which don't include or verify the i_ino
> > > number, would be affected.
> > > 
> > 
> > Ouch. Technically, I guess this is ABI...
> > 
> > While converting to u64 seems like the ideal thing to do, the other
> > option might be to just keep this as an unsigned long for now.
> > 
> > No effect on 64-bit, but that could keep things working 32-bit when the
> > i_ino casts properly to a u32. ext4 would be fine since they don't
> > issue inode numbers larger than UINT_MAX. xfs and btrfs are a bit more
> > iffy, but worst case they'd just need to be relabeled (which is what
> > they'll need to do anyway).
> > 
> > If we do that, then we should probably add a comment to this function
> > explaining why it's an unsigned long.
> 
> Agreed.
> 

For now, I think that's the best approach. I'll spin up a patch to add
the comment.

> > 
> > Thoughts?
> 
> My concern would be embedded/IoT devices, but I don't have any insight into who
> might be using it on 32 bit.
> 

Yep. This LWN article on Arnd's talk lays out the state of things:

    https://lwn.net/Articles/1035727/

The upshot is that it's hard to buy 32-bit CPUs these days, and will
only get harder. But, there are still a fair number of 32-bit devices
out in the field and will be for some time.

The big question is how many of those EVM users that intend to run new
kernels. I have no idea how to answer that.

-- 
Jeff Layton <jlayton@kernel.org>