summaryrefslogtreecommitdiff
path: root/apps/tagcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tagcache.c')
-rw-r--r--apps/tagcache.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index ba7d8b9b64..171325c679 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -460,6 +460,9 @@ static bool write_index(int masterfd, int idxid, struct index_entry *idx)
460 memcpy(&hdr->indices[idxid], idx, sizeof(struct index_entry)); 460 memcpy(&hdr->indices[idxid], idx, sizeof(struct index_entry));
461#endif 461#endif
462 462
463 /* We need to exclude all memory only flags when writing on disk. */
464 idx->flag = idx->flag & ~(FLAG_DIRCACHE);
465
463 lseek(masterfd, idxid * sizeof(struct index_entry) 466 lseek(masterfd, idxid * sizeof(struct index_entry)
464 + sizeof(struct master_header), SEEK_SET); 467 + sizeof(struct master_header), SEEK_SET);
465 if (write(masterfd, idx, sizeof(struct index_entry)) != 468 if (write(masterfd, idx, sizeof(struct index_entry)) !=
@@ -3104,7 +3107,12 @@ static void load_ramcache(void)
3104 stat.ramcache = load_tagcache(); 3107 stat.ramcache = load_tagcache();
3105 3108
3106 if (!stat.ramcache) 3109 if (!stat.ramcache)
3110 {
3111 /* If loading failed, it must indicate some problem with the db
3112 * so disable it entirely to prevent further issues. */
3113 stat.ready = false;
3107 hdr = NULL; 3114 hdr = NULL;
3115 }
3108 3116
3109 cpu_boost(false); 3117 cpu_boost(false);
3110} 3118}