Whamcloud - gitweb
LU-12931 gnilnd: use time_after() to compare jiffies
[fs/lustre-release.git] / lustre / mdd / mdd_orphans.c
index de1500b..2027d20 100644 (file)
@@ -323,6 +323,10 @@ static int mdd_orphan_destroy(const struct lu_env *env, struct mdd_object *obj,
        if (likely(obj->mod_count == 0)) {
                dt_write_lock(env, mdd->mdd_orphans, DT_TGT_ORPHAN);
                rc = dt_delete(env, mdd->mdd_orphans, key, th);
+               if (rc == -ENOENT) {
+                       key = mdd_orphan_key_fill_20(env, mdo2fid(obj));
+                       rc = dt_delete(env, mdd->mdd_orphans, key, th);
+               }
                if (rc) {
                        CERROR("%s: could not delete orphan "DFID": rc = %d\n",
                               mdd2obd_dev(mdd)->obd_name, PFID(mdo2fid(obj)),
@@ -375,7 +379,7 @@ static int mdd_orphan_key_test_and_delete(const struct lu_env *env,
        if (mdo->mod_count == 0) {
                CDEBUG(D_HA, "Found orphan "DFID", delete it\n", PFID(lf));
                rc = mdd_orphan_destroy(env, mdo, key);
-               if (rc) /* so replay-single.sh test_37 works */
+               if (rc) /* below message checked in replay-single.sh test_37 */
                        CERROR("%s: error unlinking orphan "DFID": rc = %d\n",
                               mdd2obd_dev(mdd)->obd_name, PFID(lf), rc);
         } else {