Whamcloud - gitweb
LU-7178 quota: fixed incorrect memset 82/16482/4
authorFrank Zago <fzago@cray.com>
Fri, 18 Sep 2015 17:04:42 +0000 (12:04 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 22 Sep 2015 23:23:47 +0000 (23:23 +0000)
The memset was done on a structure using the size of another unrelated
structure.

Added a few cosmetic changes: removed an extra word in function
description and fixed a couple formatting issues.

Signed-off-by: frank zago <fzago@cray.com>
Change-Id: Ib1da9292037b1e5ef10c93f2fd871488861bd05e
Reviewed-on: http://review.whamcloud.com/16482
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-ldiskfs/osd_quota.c

index 368a74a..5625a4c 100644 (file)
@@ -90,7 +90,7 @@ int osd_acct_obj_lookup(struct osd_thread_info *info, struct osd_device *osd,
  * \param env   - is the environment passed by the caller
  * \param dtobj - is the accounting object
  * \param dtrec - is the record to fill with space usage information
- * \param dtkey - is the id the of the user or group for which we would
+ * \param dtkey - is the id of the user or group for which we would
  *                like to access disk usage.
  *
  * \retval +ve - success : exact match
@@ -112,17 +112,17 @@ static int osd_acct_index_lookup(const struct lu_env *env,
        __u64                    id = *((__u64 *)dtkey);
        int                      rc;
 #ifdef HAVE_DQUOT_KQID
-       struct kqid             qid;
+       struct kqid              qid;
 #endif
 
        ENTRY;
 
-       memset((void *)dqblk, 0, sizeof(struct obd_dqblk));
+       memset(dqblk, 0, sizeof(*dqblk));
 #ifdef HAVE_DQUOT_KQID
        qid = make_kqid(&init_user_ns, obj2type(dtobj), id);
        rc = sb->s_qcop->get_dqblk(sb, qid, dqblk);
 #else
-       rc = sb->s_qcop->get_dqblk(sb, obj2type(dtobj), (qid_t) id, dqblk);
+       rc = sb->s_qcop->get_dqblk(sb, obj2type(dtobj), (qid_t)id, dqblk);
 #endif
        if (rc)
                RETURN(rc);