summaryrefslogtreecommitdiff
path: root/fs/udf
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/udf
parentd84c70c6eab10e56d22c394e3a250c1c6fde8d6e (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/udf')
-rw-r--r--fs/udf/directory.c18
-rw-r--r--fs/udf/file.c2
-rw-r--r--fs/udf/inode.c12
-rw-r--r--fs/udf/namei.c8
-rw-r--r--fs/udf/super.c2
5 files changed, 21 insertions, 21 deletions
diff --git a/fs/udf/directory.c b/fs/udf/directory.c
index 632453aa3893..f5c81e13eacb 100644
--- a/fs/udf/directory.c
+++ b/fs/udf/directory.c
@@ -22,7 +22,7 @@ static int udf_verify_fi(struct udf_fileident_iter *iter)
if (iter->fi.descTag.tagIdent != cpu_to_le16(TAG_IDENT_FID)) {
udf_err(iter->dir->i_sb,
- "directory (ino %lu) has entry at pos %llu with incorrect tag %x\n",
+ "directory (ino %llu) has entry at pos %llu with incorrect tag %x\n",
iter->dir->i_ino, (unsigned long long)iter->pos,
le16_to_cpu(iter->fi.descTag.tagIdent));
return -EFSCORRUPTED;
@@ -30,7 +30,7 @@ static int udf_verify_fi(struct udf_fileident_iter *iter)
len = udf_dir_entry_len(&iter->fi);
if (le16_to_cpu(iter->fi.lengthOfImpUse) & 3) {
udf_err(iter->dir->i_sb,
- "directory (ino %lu) has entry at pos %llu with unaligned length of impUse field\n",
+ "directory (ino %llu) has entry at pos %llu with unaligned length of impUse field\n",
iter->dir->i_ino, (unsigned long long)iter->pos);
return -EFSCORRUPTED;
}
@@ -41,20 +41,20 @@ static int udf_verify_fi(struct udf_fileident_iter *iter)
*/
if (len > 1 << iter->dir->i_blkbits) {
udf_err(iter->dir->i_sb,
- "directory (ino %lu) has too big (%u) entry at pos %llu\n",
+ "directory (ino %llu) has too big (%u) entry at pos %llu\n",
iter->dir->i_ino, len, (unsigned long long)iter->pos);
return -EFSCORRUPTED;
}
if (iter->pos + len > iter->dir->i_size) {
udf_err(iter->dir->i_sb,
- "directory (ino %lu) has entry past directory size at pos %llu\n",
+ "directory (ino %llu) has entry past directory size at pos %llu\n",
iter->dir->i_ino, (unsigned long long)iter->pos);
return -EFSCORRUPTED;
}
if (udf_dir_entry_len(&iter->fi) !=
sizeof(struct tag) + le16_to_cpu(iter->fi.descTag.descCRCLength)) {
udf_err(iter->dir->i_sb,
- "directory (ino %lu) has entry where CRC length (%u) does not match entry length (%u)\n",
+ "directory (ino %llu) has entry where CRC length (%u) does not match entry length (%u)\n",
iter->dir->i_ino,
(unsigned)le16_to_cpu(iter->fi.descTag.descCRCLength),
(unsigned)(udf_dir_entry_len(&iter->fi) -
@@ -78,7 +78,7 @@ static int udf_copy_fi(struct udf_fileident_iter *iter)
}
if (iter->dir->i_size < iter->pos + sizeof(struct fileIdentDesc)) {
udf_err(iter->dir->i_sb,
- "directory (ino %lu) has entry straddling EOF\n",
+ "directory (ino %llu) has entry straddling EOF\n",
iter->dir->i_ino);
return -EFSCORRUPTED;
}
@@ -184,7 +184,7 @@ static int udf_fiiter_advance_blk(struct udf_fileident_iter *iter)
return 0;
}
udf_err(iter->dir->i_sb,
- "extent after position %llu not allocated in directory (ino %lu)\n",
+ "extent after position %llu not allocated in directory (ino %llu)\n",
(unsigned long long)iter->pos, iter->dir->i_ino);
return -EFSCORRUPTED;
}
@@ -272,7 +272,7 @@ int udf_fiiter_init(struct udf_fileident_iter *iter, struct inode *dir,
if (pos == dir->i_size)
return 0;
udf_err(dir->i_sb,
- "position %llu not allocated in directory (ino %lu)\n",
+ "position %llu not allocated in directory (ino %llu)\n",
(unsigned long long)pos, dir->i_ino);
err = -EFSCORRUPTED;
goto out;
@@ -483,7 +483,7 @@ int udf_fiiter_append_blk(struct udf_fileident_iter *iter)
&iter->loffset, &etype);
if (err <= 0 || etype != (EXT_RECORDED_ALLOCATED >> 30)) {
udf_err(iter->dir->i_sb,
- "block %llu not allocated in directory (ino %lu)\n",
+ "block %llu not allocated in directory (ino %llu)\n",
(unsigned long long)block, iter->dir->i_ino);
return -EFSCORRUPTED;
}
diff --git a/fs/udf/file.c b/fs/udf/file.c
index 32ae7cfd72c5..b043fe10e5d6 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -133,7 +133,7 @@ long udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
int result;
if (file_permission(filp, MAY_READ) != 0) {
- udf_debug("no permission to access inode %lu\n", inode->i_ino);
+ udf_debug("no permission to access inode %llu\n", inode->i_ino);
return -EPERM;
}
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 7fae8002344a..902f81729bd8 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -147,7 +147,7 @@ void udf_evict_inode(struct inode *inode)
if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB &&
inode->i_size != iinfo->i_lenExtents) {
udf_warn(inode->i_sb,
- "Inode %lu (mode %o) has inode size %llu different from extent length %llu. Filesystem need not be standards compliant.\n",
+ "Inode %llu (mode %o) has inode size %llu different from extent length %llu. Filesystem need not be standards compliant.\n",
inode->i_ino, inode->i_mode,
(unsigned long long)inode->i_size,
(unsigned long long)iinfo->i_lenExtents);
@@ -1386,13 +1386,13 @@ reread:
*/
bh = udf_read_ptagged(inode->i_sb, iloc, 0, &ident);
if (!bh) {
- udf_err(inode->i_sb, "(ino %lu) failed !bh\n", inode->i_ino);
+ udf_err(inode->i_sb, "(ino %llu) failed !bh\n", inode->i_ino);
return -EIO;
}
if (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE &&
ident != TAG_IDENT_USE) {
- udf_err(inode->i_sb, "(ino %lu) failed ident=%u\n",
+ udf_err(inode->i_sb, "(ino %llu) failed ident=%u\n",
inode->i_ino, ident);
goto out;
}
@@ -1641,7 +1641,7 @@ reread:
udf_debug("METADATA BITMAP FILE-----\n");
break;
default:
- udf_err(inode->i_sb, "(ino %lu) failed unknown file type=%u\n",
+ udf_err(inode->i_sb, "(ino %llu) failed unknown file type=%u\n",
inode->i_ino, fe->icbTag.fileType);
goto out;
}
@@ -1942,7 +1942,7 @@ finish:
if (do_sync) {
sync_dirty_buffer(bh);
if (buffer_write_io_error(bh)) {
- udf_warn(inode->i_sb, "IO error syncing udf inode [%08lx]\n",
+ udf_warn(inode->i_sb, "IO error syncing udf inode [%08llx]\n",
inode->i_ino);
err = -EIO;
}
@@ -2224,7 +2224,7 @@ int udf_next_aext(struct inode *inode, struct extent_position *epos,
if (++indirections > UDF_MAX_INDIR_EXTS) {
udf_err(inode->i_sb,
- "too many indirect extents in inode %lu\n",
+ "too many indirect extents in inode %llu\n",
inode->i_ino);
return -EFSCORRUPTED;
}
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 5f2e9a892bff..ccafcaa96809 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -550,7 +550,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry)
goto end_unlink;
if (!inode->i_nlink) {
- udf_debug("Deleting nonexistent file (%lu), %u\n",
+ udf_debug("Deleting nonexistent file (%llu), %u\n",
inode->i_ino, inode->i_nlink);
set_nlink(inode, 1);
}
@@ -809,7 +809,7 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir,
&diriter);
if (retval == -ENOENT) {
udf_err(old_inode->i_sb,
- "directory (ino %lu) has no '..' entry\n",
+ "directory (ino %llu) has no '..' entry\n",
old_inode->i_ino);
retval = -EFSCORRUPTED;
}
@@ -821,7 +821,7 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir,
old_dir->i_ino) {
retval = -EFSCORRUPTED;
udf_err(old_inode->i_sb,
- "directory (ino %lu) has parent entry pointing to another inode (%lu != %u)\n",
+ "directory (ino %llu) has parent entry pointing to another inode (%llu != %u)\n",
old_inode->i_ino, old_dir->i_ino,
udf_get_lb_pblock(old_inode->i_sb, &tloc, 0));
goto out_oiter;
@@ -869,7 +869,7 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir,
retval = udf_fiiter_find_entry(old_dir, &old_dentry->d_name, &oiter);
if (retval) {
udf_err(old_dir->i_sb,
- "failed to find renamed entry again in directory (ino %lu)\n",
+ "failed to find renamed entry again in directory (ino %llu)\n",
old_dir->i_ino);
} else {
udf_fiiter_delete_entry(&oiter);
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 27f463fd1d89..3a2d66c7e856 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1166,7 +1166,7 @@ static int udf_fill_partdesc_info(struct super_block *sb,
}
map->s_uspace.s_table = inode;
map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_TABLE;
- udf_debug("unallocSpaceTable (part %d) @ %lu\n",
+ udf_debug("unallocSpaceTable (part %d) @ %llu\n",
p_index, map->s_uspace.s_table->i_ino);
}