diff options
| author | Jeff Layton <jlayton@kernel.org> | 2026-03-04 10:32:42 -0500 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-03-06 14:31:28 +0100 |
| commit | 0b2600f81cefcdfcda58d50df7be8fd48ada8ce2 (patch) | |
| tree | c372fc873b29e01e4262c2cdc19bef7c85e0321c /fs/hpfs | |
| parent | d84c70c6eab10e56d22c394e3a250c1c6fde8d6e (diff) | |
treewide: change inode->i_ino from unsigned long to u64
On 32-bit architectures, unsigned long is only 32 bits wide, which
causes 64-bit inode numbers to be silently truncated. Several
filesystems (NFS, XFS, BTRFS, etc.) can generate inode numbers that
exceed 32 bits, and this truncation can lead to inode number collisions
and other subtle bugs on 32-bit systems.
Change the type of inode->i_ino from unsigned long to u64 to ensure that
inode numbers are always represented as 64-bit values regardless of
architecture. Update all format specifiers treewide from %lu/%lx to
%llu/%llx to match the new type, along with corresponding local variable
types.
This is the bulk treewide conversion. Earlier patches in this series
handled trace events separately to allow trace field reordering for
better struct packing on 32-bit.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20260304-iino-u64-v3-12-2257ad83d372@kernel.org
Acked-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/hpfs')
| -rw-r--r-- | fs/hpfs/dir.c | 4 | ||||
| -rw-r--r-- | fs/hpfs/dnode.c | 4 | ||||
| -rw-r--r-- | fs/hpfs/ea.c | 4 | ||||
| -rw-r--r-- | fs/hpfs/inode.c | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c index ceb50b2dc91a..3bf11202e2d3 100644 --- a/fs/hpfs/dir.c +++ b/fs/hpfs/dir.c @@ -96,8 +96,8 @@ static int hpfs_readdir(struct file *file, struct dir_context *ctx) } if (!fnode_is_dir(fno)) { e = 1; - hpfs_error(inode->i_sb, "not a directory, fnode %08lx", - (unsigned long)inode->i_ino); + hpfs_error(inode->i_sb, "not a directory, fnode %08llx", + inode->i_ino); } if (hpfs_inode->i_dno != le32_to_cpu(fno->u.external[0].disk_secno)) { e = 1; diff --git a/fs/hpfs/dnode.c b/fs/hpfs/dnode.c index dde764ebe246..8c6aa060fd87 100644 --- a/fs/hpfs/dnode.c +++ b/fs/hpfs/dnode.c @@ -550,9 +550,9 @@ static void delete_empty_dnode(struct inode *i, dnode_secno dno) if (hpfs_sb(i->i_sb)->sb_chk) if (up != i->i_ino) { hpfs_error(i->i_sb, - "bad pointer to fnode, dnode %08x, pointing to %08x, should be %08lx", + "bad pointer to fnode, dnode %08x, pointing to %08x, should be %08llx", dno, up, - (unsigned long)i->i_ino); + i->i_ino); return; } if ((d1 = hpfs_map_dnode(i->i_sb, down, &qbh1))) { diff --git a/fs/hpfs/ea.c b/fs/hpfs/ea.c index 2149d3ca530b..4664f9ab06ee 100644 --- a/fs/hpfs/ea.c +++ b/fs/hpfs/ea.c @@ -245,8 +245,8 @@ void hpfs_set_ea(struct inode *inode, struct fnode *fnode, const char *key, fnode->ea_offs = cpu_to_le16(0xc4); } if (le16_to_cpu(fnode->ea_offs) < 0xc4 || le16_to_cpu(fnode->ea_offs) + le16_to_cpu(fnode->acl_size_s) + le16_to_cpu(fnode->ea_size_s) > 0x200) { - hpfs_error(s, "fnode %08lx: ea_offs == %03x, ea_size_s == %03x", - (unsigned long)inode->i_ino, + hpfs_error(s, "fnode %08llx: ea_offs == %03x, ea_size_s == %03x", + inode->i_ino, le16_to_cpu(fnode->ea_offs), le16_to_cpu(fnode->ea_size_s)); return; } diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index 93d528f4f4f2..0e932cc8be1b 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c @@ -250,8 +250,8 @@ void hpfs_write_inode_nolock(struct inode *i) hpfs_brelse4(&qbh); } else hpfs_error(i->i_sb, - "directory %08lx doesn't have '.' entry", - (unsigned long)i->i_ino); + "directory %08llx doesn't have '.' entry", + i->i_ino); } mark_buffer_dirty(bh); brelse(bh); |
