[LU-15584] ppc64le build failure: llog_reader.c:921:42: error: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'long unsigned int' Created: 22/Feb/22  Updated: 23/Aug/22  Resolved: 05/Mar/22

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.15.0
Fix Version/s: Lustre 2.15.0

Type: Bug Priority: Minor
Reporter: Gian-Carlo Defazio Assignee: Gian-Carlo Defazio
Resolution: Fixed Votes: 0
Labels: llnl, llnlfixready
Environment:

TOSS 4.3-3 4.18.0-348.12.2.1toss.t4.x86_64
lustre 2.15.0_0RC2_1.lnll (based on v2_15_0-RC2)
ppc64le


Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

While attempting to build a new local branch based on v2_15_0-RC2 with local patches, the ppc64le build failed due to a printf type error.

llog_reader.c: In function 'print_unlink_rec':                                                                                                                                       
llog_reader.c:921:42: error: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'long unsigned int' [-Werror=format=]                          
  printf("unlink record id:0x%x target %llx:%x:%x\n",                                                                                                                                
                                       ~~~^                                                                                                                                          
                                       %lx                                                                                                                                           
llog_reader.c: In function 'print_setattr64_rec':                                                                                                                                    
llog_reader.c:937:9: error: format '%llx' expects argument of type 'long long unsigned int', but argument 6 has type 'long unsigned int' [-Werror=format=]                           
  printf("setattr64 record id:0x%x target "DFID" valid %llx uid %u:%u gid %u:%u\n",                                                                                                  
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                          
llog_reader.c:937:58: note: format string is defined here                                                                                                                            
  printf("setattr64 record id:0x%x target "DFID" valid %llx uid %u:%u gid %u:%u\n",                                                                                                  
                                                       ~~~^                                                                                                                          
                                                       %lx                                                                                                                           
llog_reader.c: In function 'print_setattr64_rec_v2':                                                                                                                                 
llog_reader.c:949:9: error: format '%llx' expects argument of type 'long long unsigned int', but argument 6 has type 'long unsigned int' [-Werror=format=]                           
  printf("setattr64 v2 record id:0x%x target "DFID" valid %llx uid %u:%u gid %u:%u prj %u\n",                                                                                        
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                       
llog_reader.c:949:61: note: format string is defined here                                                                                                                            
  printf("setattr64 v2 record id:0x%x target "DFID" valid %llx uid %u:%u gid %u:%u prj %u\n",                                                                                        
                                                          ~~~^                                                                                                                       
                                                          %lx    

There are 3 additional places in the file llog_reader.c that attempt to print a value returned by __le64_to_cpu which do not match the %llx used in the format string.



 Comments   
Comment by Olaf Faaland [ 22/Feb/22 ]

This issue was introduced by https://review.whamcloud.com/#/c/44591/,

commit 80447caf980699fd1b0118e8f7c11e48aead04ce
Author: Alexander Zarochentsev <alexander.zarochentsev@hpe.com>
Date:   Fri Jul 16 22:16:29 2021 +0300

    LU-14926 utils: print unlink and setattr recs in llog_reader
    
    Enhance llog_reader to print unlink and setattr llog records
    correctly.
    
    HPE-bug-id: LUS-10220

from LU-14926

Comment by Gerrit Updater [ 22/Feb/22 ]

"Gian-Carlo DeFazio <defazio1@llnl.gov>" uploaded a new patch: https://review.whamcloud.com/46588
Subject: LU-15584 utils: ppc64le __le64_to_cpu type mismatch
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 509f0d56c187260a1e46db7ce18f6421c735e74b

Comment by Gerrit Updater [ 05/Mar/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/46588/
Subject: LU-15584 utils: ppc64le __le64_to_cpu type mismatch
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 131f559c5a241f15b8a91009968dfbd9a5dcddeb

Comment by Peter Jones [ 05/Mar/22 ]

Landed for 2.15

Comment by Gerrit Updater [ 23/Aug/22 ]

"Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/48307
Subject: LU-15584 utils: ppc64le __le64_to_cpu type mismatch
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: 60eeca873193c1e90a024c8128d4c499c7475375

Generated at Sat Feb 10 03:19:34 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.