Whamcloud - gitweb
LU-5687 dt: propagate errors from failed declarations 30/12130/4
authorJohn L. Hammond <john.hammond@intel.com>
Tue, 30 Sep 2014 16:09:30 +0000 (11:09 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 4 Dec 2014 02:36:45 +0000 (02:36 +0000)
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>
lustre/obdclass/llog_osd.c
lustre/obdclass/local_storage.c
lustre/ofd/ofd_objects.c

index 4934d08..ef7b0f0 100644 (file)
@@ -1262,7 +1262,9 @@ static int llog_osd_destroy(const struct lu_env *env,
                        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)
index 5e43e16..563e8dd 100644 (file)
@@ -328,8 +328,13 @@ struct dt_object *__local_file_create(const struct lu_env *env,
                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;
index 1b3b4f0..c786333 100644 (file)
@@ -739,8 +739,14 @@ int ofd_object_destroy(const struct lu_env *env, struct ofd_object *fo,
        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