Whamcloud - gitweb
LU-14317 ldiskfs: ‘%llu’ mismatch with type ‘long int’ on arm64 91/41191/2
authorJian Yu <yujian@whamcloud.com>
Mon, 11 Jan 2021 03:46:42 +0000 (19:46 -0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 18 Jan 2021 07:32:19 +0000 (07:32 +0000)
This patch fixes build issues like this one on arm64:

lustre-release/ldiskfs/mballoc.c: In function ‘ldiskfs_mb_release’:
lustre-release/ldiskfs/mballoc.c:3180:4: warning:
format ‘%llu’ expects argument of type ‘long long unsigned int’,
but argument 4 has type ‘long int’ [-Wformat=]
    "mballoc: (%llu, %llu, %llu) useless c(0,1,2) loops",
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: I07018302fae8da3b71c0cc649753bdcccdc0d34f
Test-Parameters: trivial
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/41191
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
ldiskfs/kernel_patches/patches/rhel8/ext4-simple-blockalloc.patch

index 1a3ae06..f5ecabd 100644 (file)
@@ -117,17 +117,17 @@ index 15c962f..7870406 100644
 +      seq_printf(seq, "\t\tlost: %u\n", atomic_read(&sbi->s_mb_lost_chunks));
 +
 +      seq_printf(seq, "\tuseless_c1_loops: %llu\n",
-+                 atomic64_read(&sbi->s_bal_cX_failed[0]));
++                 (unsigned long long)atomic64_read(&sbi->s_bal_cX_failed[0]));
 +      seq_printf(seq, "\tuseless_c2_loops: %llu\n",
-+                 atomic64_read(&sbi->s_bal_cX_failed[1]));
++                 (unsigned long long)atomic64_read(&sbi->s_bal_cX_failed[1]));
 +      seq_printf(seq, "\tuseless_c3_loops: %llu\n",
-+                 atomic64_read(&sbi->s_bal_cX_failed[2]));
++                 (unsigned long long)atomic64_read(&sbi->s_bal_cX_failed[2]));
 +      seq_printf(seq, "\tskipped_c1_loops: %llu\n",
-+                 atomic64_read(&sbi->s_bal_cX_skipped[0]));
++                 (unsigned long long)atomic64_read(&sbi->s_bal_cX_skipped[0]));
 +      seq_printf(seq, "\tskipped_c2_loops: %llu\n",
-+                 atomic64_read(&sbi->s_bal_cX_skipped[1]));
++                 (unsigned long long)atomic64_read(&sbi->s_bal_cX_skipped[1]));
 +      seq_printf(seq, "\tskipped_c3_loops: %llu\n",
-+                 atomic64_read(&sbi->s_bal_cX_skipped[2]));
++                 (unsigned long long)atomic64_read(&sbi->s_bal_cX_skipped[2]));
 +      seq_printf(seq, "\tbuddies_generated: %lu\n",
 +                 sbi->s_mb_buddies_generated);
 +      seq_printf(seq, "\tbuddies_time_used: %llu\n", sbi->s_mb_generation_time);
@@ -213,14 +213,14 @@ index 15c962f..7870406 100644
                                atomic_read(&sbi->s_bal_success));
 +              ext4_msg(sb, KERN_INFO,
 +                      "mballoc: (%llu, %llu, %llu) useless c(0,1,2) loops",
-+                              atomic64_read(&sbi->s_bal_cX_failed[0]),
-+                              atomic64_read(&sbi->s_bal_cX_failed[1]),
-+                              atomic64_read(&sbi->s_bal_cX_failed[2]));
++                              (unsigned long long)atomic64_read(&sbi->s_bal_cX_failed[0]),
++                              (unsigned long long)atomic64_read(&sbi->s_bal_cX_failed[1]),
++                              (unsigned long long)atomic64_read(&sbi->s_bal_cX_failed[2]));
 +              ext4_msg(sb, KERN_INFO,
 +                      "mballoc: (%llu, %llu, %llu) skipped c(0,1,2) loops",
-+                              atomic64_read(&sbi->s_bal_cX_skipped[0]),
-+                              atomic64_read(&sbi->s_bal_cX_skipped[1]),
-+                              atomic64_read(&sbi->s_bal_cX_skipped[2]));
++                              (unsigned long long)atomic64_read(&sbi->s_bal_cX_skipped[0]),
++                              (unsigned long long)atomic64_read(&sbi->s_bal_cX_skipped[1]),
++                              (unsigned long long)atomic64_read(&sbi->s_bal_cX_skipped[2]));
                ext4_msg(sb, KERN_INFO,
                      "mballoc: %u extents scanned, %u goal hits, "
                                "%u 2^N hits, %u breaks, %u lost",