summaryrefslogtreecommitdiff
path: root/fs/befs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2026-03-04 10:32:42 -0500
committerChristian Brauner <brauner@kernel.org>2026-03-06 14:31:28 +0100
commit0b2600f81cefcdfcda58d50df7be8fd48ada8ce2 (patch)
treec372fc873b29e01e4262c2cdc19bef7c85e0321c /fs/befs
parentd84c70c6eab10e56d22c394e3a250c1c6fde8d6e (diff)
downloadlinux-next-0b2600f81cefcdfcda58d50df7be8fd48ada8ce2.tar.gz
linux-next-0b2600f81cefcdfcda58d50df7be8fd48ada8ce2.zip
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/befs')
-rw-r--r--fs/befs/linuxvfs.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index cecbc92f959a..c12caae9a967 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -140,20 +140,20 @@ befs_get_block(struct inode *inode, sector_t block,
int res;
ulong disk_off;
- befs_debug(sb, "---> befs_get_block() for inode %lu, block %ld",
- (unsigned long)inode->i_ino, (long)block);
+ befs_debug(sb, "---> befs_get_block() for inode %llu, block %ld",
+ inode->i_ino, (long)block);
if (create) {
befs_error(sb, "befs_get_block() was asked to write to "
- "block %ld in inode %lu", (long)block,
- (unsigned long)inode->i_ino);
+ "block %ld in inode %llu", (long)block,
+ inode->i_ino);
return -EPERM;
}
res = befs_fblock2brun(sb, ds, block, &run);
if (res != BEFS_OK) {
befs_error(sb,
- "<--- %s for inode %lu, block %ld ERROR",
- __func__, (unsigned long)inode->i_ino,
+ "<--- %s for inode %llu, block %ld ERROR",
+ __func__, inode->i_ino,
(long)block);
return -EFBIG;
}
@@ -162,8 +162,8 @@ befs_get_block(struct inode *inode, sector_t block,
map_bh(bh_result, inode->i_sb, disk_off);
- befs_debug(sb, "<--- %s for inode %lu, block %ld, disk address %lu",
- __func__, (unsigned long)inode->i_ino, (long)block,
+ befs_debug(sb, "<--- %s for inode %llu, block %ld, disk address %lu",
+ __func__, inode->i_ino, (long)block,
(unsigned long)disk_off);
return 0;
@@ -181,7 +181,7 @@ befs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
char *utfname;
const char *name = dentry->d_name.name;
- befs_debug(sb, "---> %s name %pd inode %ld", __func__,
+ befs_debug(sb, "---> %s name %pd inode %llu", __func__,
dentry, dir->i_ino);
/* Convert to UTF-8 */
@@ -224,7 +224,7 @@ befs_readdir(struct file *file, struct dir_context *ctx)
size_t keysize;
char keybuf[BEFS_NAME_LEN + 1];
- befs_debug(sb, "---> %s name %pD, inode %ld, ctx->pos %lld",
+ befs_debug(sb, "---> %s name %pD, inode %llu, ctx->pos %lld",
__func__, file, inode->i_ino, ctx->pos);
while (1) {
@@ -233,7 +233,7 @@ befs_readdir(struct file *file, struct dir_context *ctx)
if (result == BEFS_ERR) {
befs_debug(sb, "<--- %s ERROR", __func__);
- befs_error(sb, "IO error reading %pD (inode %lu)",
+ befs_error(sb, "IO error reading %pD (inode %llu)",
file, inode->i_ino);
return -EIO;
@@ -324,7 +324,7 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)
bh = sb_bread(sb, inode->i_ino);
if (!bh) {
befs_error(sb, "unable to read inode block - "
- "inode = %lu", inode->i_ino);
+ "inode = %llu", inode->i_ino);
goto unacquire_none;
}
@@ -333,7 +333,7 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)
befs_dump_inode(sb, raw_inode);
if (befs_check_inode(sb, raw_inode, inode->i_ino) != BEFS_OK) {
- befs_error(sb, "Bad inode: %lu", inode->i_ino);
+ befs_error(sb, "Bad inode: %llu", inode->i_ino);
goto unacquire_bh;
}
@@ -407,7 +407,7 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)
inode->i_op = &simple_symlink_inode_operations;
}
} else {
- befs_error(sb, "Inode %lu is not a regular file, "
+ befs_error(sb, "Inode %llu is not a regular file, "
"directory or symlink. THAT IS WRONG! BeFS has no "
"on disk special files", inode->i_ino);
goto unacquire_bh;