With the change to make inode->i_ino a u64, the build started failing on 32-bit ARM with: ERROR: modpost: "__aeabi_uldivmod" [fs/nilfs2/nilfs2.ko] undefined! Fix this by using the 64-bit division interfaces in nilfs_bmap_find_target_in_group(). Fixes: 998a59d371c2 ("treewide: fix missed i_ino format specifier conversions") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202603100602.KPxiClIO-lkp@intel.com/ Reviewed-by: Viacheslav Dubeyko Acked-by: Ryusuke Konishi Signed-off-by: Jeff Layton --- fs/nilfs2/bmap.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/nilfs2/bmap.c b/fs/nilfs2/bmap.c index 824f2bd91c167965ec3a660202b6e6c5f1fe007e..abcf5252578ad24f694bfccf525893674bfcb4bc 100644 --- a/fs/nilfs2/bmap.c +++ b/fs/nilfs2/bmap.c @@ -455,11 +455,14 @@ __u64 nilfs_bmap_find_target_in_group(const struct nilfs_bmap *bmap) { struct inode *dat = nilfs_bmap_get_dat(bmap); unsigned long entries_per_group = nilfs_palloc_entries_per_group(dat); - unsigned long group = bmap->b_inode->i_ino / entries_per_group; + unsigned long group; + u32 index; + + group = div_u64(bmap->b_inode->i_ino, entries_per_group); + div_u64_rem(bmap->b_inode->i_ino, NILFS_BMAP_GROUP_DIV, &index); return group * entries_per_group + - (bmap->b_inode->i_ino % NILFS_BMAP_GROUP_DIV) * - (entries_per_group / NILFS_BMAP_GROUP_DIV); + index * (entries_per_group / NILFS_BMAP_GROUP_DIV); } static struct lock_class_key nilfs_bmap_dat_lock_key; -- 2.53.0 Mimi pointed out that we didn't widen the inode number field in struct h_misc alongside the inode->i_ino widening. While we could make an equivalent change there, that would require EVM resigning on all 32-bit hosts. Instead, leave the field as an unsigned long. This should have no effect on 64-bit hosts, and allow things to continue working on 32-bit hosts in the cases where the i_ino fits in 32-bits. Add a comment explaining why it's being left as unsigned long. Cc: Mimi Zohar Signed-off-by: Jeff Layton --- security/integrity/evm/evm_crypto.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c index c0ca4eedb0fe5d5c30f45f515a4bc90248ec64ea..1c41af2f91a60a714878ff93b554c90e45546503 100644 --- a/security/integrity/evm/evm_crypto.c +++ b/security/integrity/evm/evm_crypto.c @@ -144,6 +144,12 @@ static void hmac_add_misc(struct shash_desc *desc, struct inode *inode, char type, char *digest) { struct h_misc { + /* + * Although inode->i_ino is now u64, this field remains + * unsigned long to allow existing HMAC and signatures from + * 32-bit hosts to continue working when i_ino hasn't changed + * and fits in a u32. + */ unsigned long ino; __u32 generation; uid_t uid; -- 2.53.0