Re: [PATCH 02/61] vfs: change i_ino from unsigned long to u64
From: David Laight
Date: Thu Feb 26 2026 - 13:53:45 EST
On Thu, 26 Feb 2026 11:16:50 -0500
Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx> wrote:
> On 2026-02-26 10:55, Jeff Layton wrote:
> > Change the type of i_ino in struct inode from unsigned long to u64.
> >
> > On 64-bit architectures, unsigned long is already 64 bits, so this is
> > effectively a type alias change with no runtime impact. On 32-bit
> > architectures, this widens i_ino from 32 to 64 bits, allowing
> > filesystems like NFS, CIFS, XFS, Ceph, and FUSE to store their native
> > 64-bit inode numbers without folding/hashing.
> >
> > The VFS already handles 64-bit inode numbers in kstat.ino (u64) and
> > statx.stx_ino (__u64). The existing overflow checks in cp_new_stat(),
> > cp_old_stat(), and cp_compat_stat() handle narrowing to 32-bit st_ino
> > with -EOVERFLOW, so userspace ABI is preserved.
> >
> > struct inode will grow by 4 bytes on 32-bit architectures.
>
> Changing this type first without changing its associated format strings
> breaks git bisect.
Or find all the format strings, change to %llu and add (u64) casts.
That should compile and run in both 32bit and 64bit.
At the end you could delete the casts.
David
>
> One alternative would be to introduce something like the PRIu64 macro
> but for printing inode values. This would allow gradually introducing
> the change without breaking the world as you do so.
>
> Thanks,
>
> Mathieu
>