[sheepdog] [PATCH] sheep: manual restore needs to update the objlist cache

Christoph Hellwig hch at infradead.org
Fri May 25 16:43:41 CEST 2012


restore_objects_from_snap can write objects to disk without going
through store_create_and_write_obj, and thus currently fails to update
the object list cache. 

Found by code inspection when debugging a similar problem in the recovery
code.

Signed-off-by: Christoph Hellwig <hch at lst.de>

diff --git a/sheep/farm/farm.c b/sheep/farm/farm.c
index 1575d24..ef88ff6 100644
--- a/sheep/farm/farm.c
+++ b/sheep/farm/farm.c
@@ -645,8 +645,10 @@ static int restore_objects_from_snap(uint32_t epoch)
 		if (ret != SD_RES_SUCCESS) {
 			eprintf("oid %"PRIx64" not restored\n", oid);
 			goto out;
-		} else
-			dprintf("oid %"PRIx64" restored\n", oid);
+		}
+
+		check_and_insert_objlist_cache(oid);
+		dprintf("oid %"PRIx64" restored\n", oid);
 
 		free(buffer);
 	}



More information about the sheepdog mailing list