From 0981fa71e3fed2a85e1cfbbb4933b7ed83de29f0 Mon Sep 17 00:00:00 2001 From: yury Date: Thu, 7 Sep 2006 06:20:06 +0000 Subject: [PATCH] - added ref to export in fld_client_add_target(); - check if export not NULL before put it in fld_client_del_target(), exports may be NULL in case of local server. --- lustre/fld/fld_request.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lustre/fld/fld_request.c b/lustre/fld/fld_request.c index b1b66b9..7c1440f 100644 --- a/lustre/fld/fld_request.c +++ b/lustre/fld/fld_request.c @@ -161,6 +161,8 @@ int fld_client_add_target(struct lu_client_fld *fld, } target->ft_exp = tar->ft_exp; + if (target->ft_exp != NULL) + class_export_get(target->ft_exp); target->ft_srv = tar->ft_srv; target->ft_idx = tar->ft_idx; @@ -188,7 +190,10 @@ int fld_client_del_target(struct lu_client_fld *fld, fld->lcf_count--; list_del(&target->ft_chain); spin_unlock(&fld->lcf_lock); - class_export_put(target->ft_exp); + + if (target->ft_exp != NULL) + class_export_put(target->ft_exp); + OBD_FREE_PTR(target); RETURN(0); } -- 1.8.3.1