Fixed the error: 'tgt' and 'nf' may be used uninitialized in
this function. Also fixed comparison signed and unsigned
indexes.
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I733e3f6456ce2926dfc6f3c5e9ac8f860566c121
Reviewed-on: http://review.whamcloud.com/7382
Tested-by: Hudson
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
static struct netstrfns *
libcfs_str2net_internal(const char *str, __u32 *net)
{
static struct netstrfns *
libcfs_str2net_internal(const char *str, __u32 *net)
{
+ struct netstrfns *nf = NULL;
int nob;
int netnum;
int i;
int nob;
int netnum;
int i;
* -ENOTCONN: The UUID is found, but the target connection is bad (!)
* -EBADF : The UUID is found, but the OBD of the wrong type (!)
*/
* -ENOTCONN: The UUID is found, but the target connection is bad (!)
* -EBADF : The UUID is found, but the OBD of the wrong type (!)
*/
-static int lmv_set_mdc_active(struct lmv_obd *lmv, struct obd_uuid *uuid,
- int activate)
-{
- struct lmv_tgt_desc *tgt;
- struct obd_device *obd;
- int i;
- int rc = 0;
- ENTRY;
+static int lmv_set_mdc_active(struct lmv_obd *lmv,
+ const struct obd_uuid *uuid,
+ int activate)
+{
+ struct lmv_tgt_desc *tgt = NULL;
+ struct obd_device *obd;
+ __u32 i;
+ int rc = 0;
+ ENTRY;
- CDEBUG(D_INFO, "Searching in lmv %p for uuid %s (activate=%d)\n",
- lmv, uuid->uuid, activate);
+ CDEBUG(D_INFO, "Searching in lmv %p for uuid %s (activate=%d)\n",
+ lmv, uuid->uuid, activate);
spin_lock(&lmv->lmv_lock);
for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
spin_lock(&lmv->lmv_lock);
for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
static void lmv_set_timeouts(struct obd_device *obd)
{
static void lmv_set_timeouts(struct obd_device *obd)
{
- struct lmv_tgt_desc *tgt;
- struct lmv_obd *lmv;
- int i;
+ struct lmv_tgt_desc *tgt;
+ struct lmv_obd *lmv;
+ __u32 i;
lmv = &obd->u.lmv;
if (lmv->server_timeout == 0)
lmv = &obd->u.lmv;
if (lmv->server_timeout == 0)
static int lmv_init_ea_size(struct obd_export *exp, int easize,
int def_easize, int cookiesize)
{
static int lmv_init_ea_size(struct obd_export *exp, int easize,
int def_easize, int cookiesize)
{
- struct obd_device *obd = exp->exp_obd;
- struct lmv_obd *lmv = &obd->u.lmv;
- int i;
- int rc = 0;
- int change = 0;
- ENTRY;
+ struct obd_device *obd = exp->exp_obd;
+ struct lmv_obd *lmv = &obd->u.lmv;
+ __u32 i;
+ int rc = 0;
+ int change = 0;
+ ENTRY;
if (lmv->max_easize < easize) {
lmv->max_easize = easize;
if (lmv->max_easize < easize) {
lmv->max_easize = easize;
int lmv_check_connect(struct obd_device *obd)
{
int lmv_check_connect(struct obd_device *obd)
{
- struct lmv_obd *lmv = &obd->u.lmv;
- struct lmv_tgt_desc *tgt;
- int i;
- int rc;
- int easize;
- ENTRY;
+ struct lmv_obd *lmv = &obd->u.lmv;
+ struct lmv_tgt_desc *tgt;
+ __u32 i;
+ int rc;
+ int easize;
+ ENTRY;
if (lmv->connected)
RETURN(0);
if (lmv->connected)
RETURN(0);
static int lmv_disconnect(struct obd_export *exp)
{
static int lmv_disconnect(struct obd_export *exp)
{
- struct obd_device *obd = class_exp2obd(exp);
+ struct obd_device *obd = class_exp2obd(exp);
- struct proc_dir_entry *lmv_proc_dir;
+ struct proc_dir_entry *lmv_proc_dir;
- struct lmv_obd *lmv = &obd->u.lmv;
- int rc;
- int i;
- ENTRY;
+ struct lmv_obd *lmv = &obd->u.lmv;
+ int rc;
+ __u32 i;
+ ENTRY;
if (!lmv->tgts)
goto out_local;
if (!lmv->tgts)
goto out_local;
const struct hsm_user_request *hur,
const struct lmv_tgt_desc *tgt_mds)
{
const struct hsm_user_request *hur,
const struct lmv_tgt_desc *tgt_mds)
{
- int i, nr = 0;
- struct lmv_tgt_desc *curr_tgt;
+ __u32 i;
+ int nr = 0;
+ struct lmv_tgt_desc *curr_tgt;
/* count how many requests must be sent to the given target */
for (i = 0; i < hur->hur_request.hr_itemcount; i++) {
/* count how many requests must be sent to the given target */
for (i = 0; i < hur->hur_request.hr_itemcount; i++) {
const struct lmv_tgt_desc *tgt_mds,
struct hsm_user_request *hur_out)
{
const struct lmv_tgt_desc *tgt_mds,
struct hsm_user_request *hur_out)
{
- int i, nr_out;
- struct lmv_tgt_desc *curr_tgt;
+ __u32 i, nr_out;
+ struct lmv_tgt_desc *curr_tgt;
/* build the hsm_user_request for the given target */
hur_out->hur_request = hur_in->hur_request;
/* build the hsm_user_request for the given target */
hur_out->hur_request = hur_in->hur_request;
static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, unsigned int cmd, int len,
struct lustre_kernelcomm *lk, void *uarg)
{
static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, unsigned int cmd, int len,
struct lustre_kernelcomm *lk, void *uarg)
{
ENTRY;
/* unregister request (call from llapi_hsm_copytool_fini) */
ENTRY;
/* unregister request (call from llapi_hsm_copytool_fini) */
struct lustre_kernelcomm *lk, void *uarg)
{
struct file *filp;
struct lustre_kernelcomm *lk, void *uarg)
{
struct file *filp;
- int i, j, err;
- int rc = 0;
+ __u32 i, j;
+ int err, rc;
bool any_set = false;
ENTRY;
bool any_set = false;
ENTRY;
static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
int len, void *karg, void *uarg)
{
static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
int len, void *karg, void *uarg)
{
- struct obd_device *obddev = class_exp2obd(exp);
- struct lmv_obd *lmv = &obddev->u.lmv;
- int i = 0;
- int rc = 0;
- int set = 0;
- int count = lmv->desc.ld_tgt_count;
- ENTRY;
+ struct obd_device *obddev = class_exp2obd(exp);
+ struct lmv_obd *lmv = &obddev->u.lmv;
+ __u32 i = 0;
+ int rc = 0;
+ int set = 0;
+ __u32 count = lmv->desc.ld_tgt_count;
+ ENTRY;
if (count == 0)
RETURN(-ENOTTY);
if (count == 0)
RETURN(-ENOTTY);
static int lmv_statfs(const struct lu_env *env, struct obd_export *exp,
struct obd_statfs *osfs, __u64 max_age, __u32 flags)
{
static int lmv_statfs(const struct lu_env *env, struct obd_export *exp,
struct obd_statfs *osfs, __u64 max_age, __u32 flags)
{
- struct obd_device *obd = class_exp2obd(exp);
- struct lmv_obd *lmv = &obd->u.lmv;
- struct obd_statfs *temp;
- int rc = 0;
- int i;
- ENTRY;
+ struct obd_device *obd = class_exp2obd(exp);
+ struct lmv_obd *lmv = &obd->u.lmv;
+ struct obd_statfs *temp;
+ int rc = 0;
+ __u32 i;
+ ENTRY;
rc = lmv_check_connect(obd);
if (rc)
rc = lmv_check_connect(obd);
if (rc)
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
struct lmv_stripe_md *meap;
struct lmv_stripe_md *lsmp;
int mea_size;
struct lmv_stripe_md *meap;
struct lmv_stripe_md *lsmp;
int mea_size;
ENTRY;
mea_size = lmv_get_easize(lmv);
ENTRY;
mea_size = lmv_get_easize(lmv);
struct lmv_stripe_md *mea = (struct lmv_stripe_md *)lmm;
struct lmv_obd *lmv = &obd->u.lmv;
int mea_size;
struct lmv_stripe_md *mea = (struct lmv_stripe_md *)lmm;
struct lmv_obd *lmv = &obd->u.lmv;
int mea_size;
struct lmv_obd *lmv = &obd->u.lmv;
int rc = 0;
int err;
struct lmv_obd *lmv = &obd->u.lmv;
int rc = 0;
int err;
ENTRY;
LASSERT(fid != NULL);
ENTRY;
LASSERT(fid != NULL);
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
ldlm_mode_t rc;
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
ldlm_mode_t rc;
ENTRY;
CDEBUG(D_INODE, "Lock match for "DFID"\n", PFID(fid));
ENTRY;
CDEBUG(D_INODE, "Lock match for "DFID"\n", PFID(fid));
struct obd_device *obd = class_exp2obd(exp);
struct lmv_obd *lmv = &obd->u.lmv;
struct lmv_tgt_desc *tgt = lmv->tgts[0];
struct obd_device *obd = class_exp2obd(exp);
struct lmv_obd *lmv = &obd->u.lmv;
struct lmv_tgt_desc *tgt = lmv->tgts[0];
__u64 curspace, curinodes;
ENTRY;
__u64 curspace, curinodes;
ENTRY;
int lmv_quotacheck(struct obd_device *unused, struct obd_export *exp,
struct obd_quotactl *oqctl)
{
int lmv_quotacheck(struct obd_device *unused, struct obd_export *exp,
struct obd_quotactl *oqctl)
{
- struct obd_device *obd = class_exp2obd(exp);
- struct lmv_obd *lmv = &obd->u.lmv;
- struct lmv_tgt_desc *tgt;
- int i, rc = 0;
- ENTRY;
+ struct obd_device *obd = class_exp2obd(exp);
+ struct lmv_obd *lmv = &obd->u.lmv;
+ struct lmv_tgt_desc *tgt;
+ __u32 i;
+ int rc = 0;
+ ENTRY;
for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
tgt = lmv->tgts[i];
if (tgt == NULL || tgt->ltd_exp == NULL || !tgt->ltd_active) {
CERROR("lmv idx %d inactive\n", i);
tgt = lmv->tgts[i];
if (tgt == NULL || tgt->ltd_exp == NULL || !tgt->ltd_active) {
CERROR("lmv idx %d inactive\n", i);