Whamcloud - gitweb
LU-6539 quota: fix incorrect format string used for short type 10/14810/2
authorDmitry Eremin <dmitry.eremin@intel.com>
Thu, 14 May 2015 16:29:00 +0000 (19:29 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 19 Jul 2015 04:06:15 +0000 (04:06 +0000)
The %u in format string requires 'unsigned int' but the argument type
is 'short'.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: Ie84b5f2d46809eb1a840d07ffa0b45f6ada1379e
Reviewed-on: http://review.whamcloud.com/14810
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/quota/lquota_entry.c

index 8007f16..73c3d05 100644 (file)
@@ -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,