Whamcloud - gitweb
- added ref to export in fld_client_add_target();
authoryury <yury>
Thu, 7 Sep 2006 06:20:06 +0000 (06:20 +0000)
committeryury <yury>
Thu, 7 Sep 2006 06:20:06 +0000 (06:20 +0000)
- 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

index b1b66b9..7c1440f 100644 (file)
@@ -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);
                 }