[LU-6539] incorrect integer format string used for short type Created: 29/Apr/15  Updated: 14/Mar/17  Resolved: 19/Jul/15

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

Type: Bug Priority: Trivial
Reporter: Colin Ian King Assignee: Dmitry Eremin (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

Build on Ubuntu 15.04, static analysis check build with current cppcheck


Severity: 4
Rank (Obsolete): 9223372036854775807

 Description   

cppcheck found an incorrect format string being used for a short type:

Checking lustre/quota/lquota_entry.c...
[lustre/quota/lquota_entry.c:219]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'short'.

struct lquota_site *lquota_site_alloc(const struct lu_env *env, void *parent,
bool is_master, short qtype,
struct lquota_entry_operations *ops)
...

sprintf(hashname, "LQUOTA_HASH%u", qtype);

needs to be %hu (or %hd)



 Comments   
Comment by Gerrit Updater [ 14/May/15 ]

Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/14810
Subject: LU-6539 quota: fix incorrect format string used for short type
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 1037ef83d2547b90cd6578065b648524cdfac21b

Comment by Gerrit Updater [ 14/May/15 ]

Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/14814
Subject: LU-6539 utils: fix potential memory leaks with realloc()
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: f8596ecbfe0e75e211da9591956fce3a41dda41b

Comment by Gerrit Updater [ 19/Jul/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14810/
Subject: LU-6539 quota: fix incorrect format string used for short type
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: a001ce6f192f2bb284980d3bfcf94f9df1d15ca6

Comment by Peter Jones [ 19/Jul/15 ]

Landed for 2.8

Generated at Sat Feb 10 02:01:05 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.