diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c
index 68ac43bc8ddce0afd83197fd6a5e20b5e438435e..37e3e70a35155bbeeddee40ce01ac976e45a0bbd 100644
--- a/lustre/lov/lov_obd.c
+++ b/lustre/lov/lov_obd.c
@@ -1124,11 +1124,13 @@ static int lov_clear_orphans(struct obd_export *export, struct obdo *src_oa,
                 /* XXX: LOV STACKING: use real "obj_mdp" sub-data */
                 err = obd_create(lov->lov_tgts[i]->ltd_exp,
                                  tmp_oa, &obj_mdp, oti);
-                if (err)
+                if (err) {
                         /* This export will be disabled until it is recovered,
                            and then orphan recovery will be completed. */
                         CERROR("error in orphan recovery on OST idx %d/%d: "
                                "rc = %d\n", i, lov->desc.ld_tgt_count, err);
+                        rc = err;
+                }
 
                 if (ost_uuid)
                         break;