Fixes potential deadlock in LNetMDAttach (vfree must not be called in
interrupt context in linux kernel versions prior to 3.10).
Signed-off-by: Quentin Bouget <quentin.bouget.ocre@cea.fr>
Change-Id: I1b421b470bab97d58f441040c39b9f1caf11b1fe
Reviewed-on: http://review.whamcloud.com/20676
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
return -ENOMEM;
rc = lnet_md_build(md, &umd, unlink);
return -ENOMEM;
rc = lnet_md_build(md, &umd, unlink);
+ if (rc != 0)
+ goto out_free;
+
cpt = lnet_cpt_of_cookie(meh.cookie);
lnet_res_lock(cpt);
cpt = lnet_cpt_of_cookie(meh.cookie);
lnet_res_lock(cpt);
- if (rc != 0)
- goto failed;
me = lnet_handle2me(&meh);
if (me == NULL)
me = lnet_handle2me(&meh);
if (me == NULL)
rc = lnet_md_link(md, umd.eq_handle, cpt);
if (rc != 0)
rc = lnet_md_link(md, umd.eq_handle, cpt);
if (rc != 0)
/* attach this MD to portal of ME and check if it matches any
* blocked msgs on this portal */
/* attach this MD to portal of ME and check if it matches any
* blocked msgs on this portal */
- failed:
- lnet_md_free(md);
-
+out_free:
+ lnet_md_free(md);
return rc;
}
EXPORT_SYMBOL(LNetMDAttach);
return rc;
}
EXPORT_SYMBOL(LNetMDAttach);
return -ENOMEM;
rc = lnet_md_build(md, &umd, unlink);
return -ENOMEM;
rc = lnet_md_build(md, &umd, unlink);
+ if (rc != 0)
+ goto out_free;
cpt = lnet_res_lock_current();
cpt = lnet_res_lock_current();
- if (rc != 0)
- goto failed;
rc = lnet_md_link(md, umd.eq_handle, cpt);
if (rc != 0)
rc = lnet_md_link(md, umd.eq_handle, cpt);
if (rc != 0)
lnet_md2handle(handle, md);
lnet_res_unlock(cpt);
return 0;
lnet_md2handle(handle, md);
lnet_res_unlock(cpt);
return 0;
- failed:
- lnet_md_free(md);
-
+
+ out_free:
+ lnet_md_free(md);
return rc;
}
EXPORT_SYMBOL(LNetMDBind);
return rc;
}
EXPORT_SYMBOL(LNetMDBind);