Check for and return errors from dt_declare_*() in several locations.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Id18b12d6c713e78e2f1cc782ff659d2c84cc60bb
Reviewed-on: http://review.whamcloud.com/12130
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
GOTO(out_trans, rc);
}
- dt_declare_ref_del(env, o, th);
+ rc = dt_declare_ref_del(env, o, th);
+ if (rc < 0)
+ GOTO(out_trans, rc);
rc = dt_declare_destroy(env, o, th);
if (rc)
GOTO(trans_stop, rc);
if (dti->dti_dof.dof_type == DFT_DIR) {
- dt_declare_ref_add(env, dto, th);
- dt_declare_ref_add(env, parent, th);
+ rc = dt_declare_ref_add(env, dto, th);
+ if (rc < 0)
+ GOTO(trans_stop, rc);
+
+ rc = dt_declare_ref_add(env, parent, th);
+ if (rc < 0)
+ GOTO(trans_stop, rc);
}
rec->rec_fid = fid;
if (IS_ERR(th))
GOTO(unlock, rc = PTR_ERR(th));
- dt_declare_ref_del(env, ofd_object_child(fo), th);
- dt_declare_destroy(env, ofd_object_child(fo), th);
+ rc = dt_declare_ref_del(env, ofd_object_child(fo), th);
+ if (rc < 0)
+ GOTO(stop, rc);
+
+ rc = dt_declare_destroy(env, ofd_object_child(fo), th);
+ if (rc < 0)
+ GOTO(stop, rc);
+
if (orphan)
rc = dt_trans_start_local(env, ofd->ofd_osd, th);
else