Whamcloud - gitweb
LU-12898 utils: %llu mismatch with type __u64 on ppcle64 30/37130/2
authorOlaf Faaland <faaland1@llnl.gov>
Tue, 22 Oct 2019 16:44:51 +0000 (09:44 -0700)
committerOleg Drokin <green@whamcloud.com>
Fri, 10 Jan 2020 08:05:10 +0000 (08:05 +0000)
commitccaae9deb5b02a789ca0a645d4ca2359f300132f
tree43dc7cff2faea88df25acfa615257278c8daf15a
parenta33440f98b77ab8fe81f68ec12f108d650536cc3
LU-12898 utils: %llu mismatch with type __u64 on ppcle64

Fix build errors like this one on ppcle64:

BUILDSTDERR: libmount_utils_zfs.c: In function 'zfs_mkfs_opts':
BUILDSTDERR: libmount_utils_zfs.c:573:5: error: format '%llu' expects
argument of type 'long long unsigned int', but argument 4 has type
'__u64' [-Werror=format=]
BUILDSTDERR:      mop->mo_device_kb * 1024);

__u64 was treated as an unsigned long long which breaks the build on
ppc64le, where they are not the same size.

In printf cases, cast to unsigned long long to match the printf format
so the format is compatible with the type and it is guaranteed
not to lose any data.

In the case of sscanf(), replace the call with strtoull() to eliminate
the issue.

Lustre-change: https://review.whamcloud.com/36558
Lustre-commit: 56b4b112a497661de8dbf5a851c7a045d470deff

Test-Parameters: trivial
Change-Id: I02fd82e0be4d756881c15aa9faedb9b40961661a
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/37130
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/libmount_utils_zfs.c
lustre/utils/ll_decode_filter_fid.c
lustre/utils/llog_reader.c
lustre/utils/lr_reader.c
lustre/utils/lsnapshot.c
lustre/utils/lustre_lfsck.c