[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] xbzrle: page may not be update if it has been in th
From: |
arei.gonglei |
Subject: |
[Qemu-devel] [PATCH] xbzrle: page may not be update if it has been in the cache |
Date: |
Wed, 2 Apr 2014 16:56:30 +0800 |
From: ChenLiang <address@hidden>
The cache_insert don't check whether the page has been in the cache.
Signed-off-by: ChenLiang <address@hidden>
Signed-off-by: Gonglei <address@hidden>
---
page_cache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/page_cache.c b/page_cache.c
index c78157b..78f7590 100644
--- a/page_cache.c
+++ b/page_cache.c
@@ -171,7 +171,7 @@ int cache_insert(PageCache *cache, uint64_t addr, const
uint8_t *pdata,
/* actual update of entry */
it = cache_get_by_addr(cache, addr);
- if (it->it_data &&
+ if (it->it_data && it->it_addr != addr &&
it->it_age + CACHED_PAGE_LIFETIME > current_age) {
/* the cache page is fresh, don't replace it */
return -1;
--
1.7.12.4
- [Qemu-devel] [PATCH] xbzrle: page may not be update if it has been in the cache,
arei.gonglei <=