X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fmgs%2Fmgs_fs.c;h=ff708e08f5b84487edc5e48ee016dfbe7b6280b8;hb=1c68bf5b2df41f51ee5c69c7bd8cdf23234351f5;hp=f4adf56795a9b5367c4e824836e132b452b2707c;hpb=6e3ec5812ebd1b5ecf7cae584f429b013ffe7431;p=fs%2Flustre-release.git diff --git a/lustre/mgs/mgs_fs.c b/lustre/mgs/mgs_fs.c index f4adf56..ff708e0 100644 --- a/lustre/mgs/mgs_fs.c +++ b/lustre/mgs/mgs_fs.c @@ -63,6 +63,7 @@ static int mgs_export_stats_init(struct obd_device *obd, struct obd_export *exp, { lnet_nid_t *client_nid = localdata; int rc, newnid; + ENTRY; rc = lprocfs_exp_setup(exp, client_nid, &newnid); if (rc) { @@ -70,7 +71,7 @@ static int mgs_export_stats_init(struct obd_device *obd, struct obd_export *exp, * /proc entries */ if (rc == -EALREADY) rc = 0; - return rc; + RETURN(rc); } if (newnid) { @@ -79,12 +80,17 @@ static int mgs_export_stats_init(struct obd_device *obd, struct obd_export *exp, lprocfs_alloc_stats(LDLM_LAST_OPC - LDLM_FIRST_OPC, LPROCFS_STATS_FLAG_NOPERCPU); if (exp->exp_nid_stats->nid_ldlm_stats == NULL) - return -ENOMEM; + GOTO(clean, rc = -ENOMEM); lprocfs_init_ldlm_stats(exp->exp_nid_stats->nid_ldlm_stats); rc = lprocfs_register_stats(exp->exp_nid_stats->nid_proc, "ldlm_stats", exp->exp_nid_stats->nid_ldlm_stats); + if (rc) + GOTO(clean, rc); } + RETURN(0); +clean: + lprocfs_exp_cleanup(exp); return rc; }