Whamcloud - gitweb
b=22658 clean up the CATALOG when a llog is not found
authorAndrew Perepechko <Andrew.Perepechko@sun.com>
Tue, 31 Aug 2010 13:43:44 +0000 (17:43 +0400)
committerMikhail Pershin <tappro@sun.com>
Tue, 7 Sep 2010 21:05:53 +0000 (01:05 +0400)
i=Mikhail Pershin
i=Johann Lombardi

lustre/obdclass/llog_obd.c

index 04b994c..1c8eccf 100644 (file)
@@ -316,6 +316,10 @@ static int cat_cancel_cb(struct llog_handle *cathandle,
         if (rc) {
                 CERROR("Cannot find handle for log "LPX64"\n",
                        lir->lid_id.lgl_oid);
         if (rc) {
                 CERROR("Cannot find handle for log "LPX64"\n",
                        lir->lid_id.lgl_oid);
+                if (rc == -ENOENT) {
+                        index = rec->lrh_index;
+                        goto cat_cleanup;
+                }
                 RETURN(rc);
         }
 
                 RETURN(rc);
         }
 
@@ -329,6 +333,7 @@ static int cat_cancel_cb(struct llog_handle *cathandle,
                 index = loghandle->u.phd.phd_cookie.lgc_index;
                 llog_free_handle(loghandle);
 
                 index = loghandle->u.phd.phd_cookie.lgc_index;
                 llog_free_handle(loghandle);
 
+cat_cleanup:
                 LASSERT(index);
                 llog_cat_set_first_idx(cathandle, index);
                 rc = llog_cancel_rec(cathandle, index);
                 LASSERT(index);
                 llog_cat_set_first_idx(cathandle, index);
                 rc = llog_cancel_rec(cathandle, index);