From a001ce6f192f2bb284980d3bfcf94f9df1d15ca6 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin Date: Thu, 14 May 2015 19:29:00 +0300 Subject: [PATCH] LU-6539 quota: fix incorrect format string used for short type The %u in format string requires 'unsigned int' but the argument type is 'short'. Signed-off-by: Dmitry Eremin Change-Id: Ie84b5f2d46809eb1a840d07ffa0b45f6ada1379e Reviewed-on: http://review.whamcloud.com/14810 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Bob Glossman Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- lustre/quota/lquota_entry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/quota/lquota_entry.c b/lustre/quota/lquota_entry.c index 8007f16..73c3d05 100644 --- a/lustre/quota/lquota_entry.c +++ b/lustre/quota/lquota_entry.c @@ -217,7 +217,7 @@ struct lquota_site *lquota_site_alloc(const struct lu_env *env, void *parent, /* allocate hash table */ memset(hashname, 0, sizeof(hashname)); - sprintf(hashname, "LQUOTA_HASH%u", qtype); + snprintf(hashname, sizeof(hashname), "LQUOTA_HASH%hu", qtype); site->lqs_hash= cfs_hash_create(hashname, hash_lqs_cur_bits, HASH_LQE_MAX_BITS, min(hash_lqs_cur_bits, -- 1.8.3.1