X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lustre%2Fofd%2Fofd_objects.c;h=fd0e74a45415385de6e029347e80989a22863587;hb=refs%2Fchanges%2F98%2F21398%2F13;hp=07f7dc86037235e1831f45e61471a93c561a3e25;hpb=bfa1dbc969df6e9e10579fdb30ab653835463bd2;p=fs%2Flustre-release.git diff --git a/lustre/ofd/ofd_objects.c b/lustre/ofd/ofd_objects.c index 07f7dc8..fd0e74a 100644 --- a/lustre/ofd/ofd_objects.c +++ b/lustre/ofd/ofd_objects.c @@ -212,11 +212,12 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd, struct thandle *th; struct ofd_object **batch; struct lu_fid *fid = &info->fti_fid; - u64 tmp; - int rc; - int i; - int objects = 0; - int nr_saved = nr; + u64 tmp; + int rc; + int rc2; + int i; + int objects = 0; + int nr_saved = nr; ENTRY; @@ -396,7 +397,12 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd, } trans_stop: - ofd_trans_stop(env, ofd, th, rc); + rc2 = ofd_trans_stop(env, ofd, th, rc); + if (rc2) + CERROR("%s: failed to stop transaction: rc = %d\n", + ofd_name(ofd), rc2); + if (!rc) + rc = rc2; out: for (i = 0; i < nr_saved; i++) { fo = batch[i]; @@ -495,8 +501,9 @@ int ofd_attr_set(const struct lu_env *env, struct ofd_object *fo, struct ofd_device *ofd = ofd_obj2dev(fo); struct thandle *th; struct ofd_mod_data *fmd; - int ff_needed = 0; - int rc; + int ff_needed = 0; + int rc; + int rc2; ENTRY; ofd_write_lock(env, fo); @@ -571,7 +578,13 @@ int ofd_attr_set(const struct lu_env *env, struct ofd_object *fo, GOTO(stop, rc); stop: - ofd_trans_stop(env, ofd, th, rc); + rc2 = ofd_trans_stop(env, ofd, th, rc); + if (rc2) + CERROR("%s: failed to stop transaction: rc = %d\n", + ofd_name(ofd), rc2); + if (!rc) + rc = rc2; + unlock: ofd_write_unlock(env, fo); @@ -606,8 +619,9 @@ int ofd_object_punch(const struct lu_env *env, struct ofd_object *fo, struct ofd_mod_data *fmd; struct dt_object *dob = ofd_object_child(fo); struct thandle *th; - int ff_needed = 0; - int rc; + int ff_needed = 0; + int rc; + int rc2; ENTRY; @@ -698,7 +712,12 @@ int ofd_object_punch(const struct lu_env *env, struct ofd_object *fo, GOTO(stop, rc); stop: - ofd_trans_stop(env, ofd, th, rc); + rc2 = ofd_trans_stop(env, ofd, th, rc); + if (rc2 != 0) + CERROR("%s: failed to stop transaction: rc = %d\n", + ofd_name(ofd), rc2); + if (!rc) + rc = rc2; unlock: ofd_write_unlock(env, fo); @@ -724,7 +743,8 @@ int ofd_object_destroy(const struct lu_env *env, struct ofd_object *fo, { struct ofd_device *ofd = ofd_obj2dev(fo); struct thandle *th; - int rc = 0; + int rc = 0; + int rc2; ENTRY; @@ -756,7 +776,12 @@ int ofd_object_destroy(const struct lu_env *env, struct ofd_object *fo, dt_ref_del(env, ofd_object_child(fo), th); dt_destroy(env, ofd_object_child(fo), th); stop: - ofd_trans_stop(env, ofd, th, rc); + rc2 = ofd_trans_stop(env, ofd, th, rc); + if (rc2) + CERROR("%s failed to stop transaction: %d\n", + ofd_name(ofd), rc2); + if (!rc) + rc = rc2; unlock: ofd_write_unlock(env, fo); RETURN(rc);