Manipulating the obj-> structures requires us to hold the
pool->rwlock lock. Lets make that obvious in this function to
catch any errant users (none found, but we may in future).

Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
---
 xen/common/tmem.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index 572944e..567ccc5 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -915,6 +915,11 @@ static int obj_rb_insert(struct rb_root *root, struct 
tmem_object_root *obj)
 {
     struct rb_node **new, *parent = NULL;
     struct tmem_object_root *this;
+    struct tmem_pool *pool;
+
+    pool = obj->pool;
+    ASSERT(pool != NULL);
+    ASSERT_WRITELOCK(&pool->pool_rwlock);
 
     new = &(root->rb_node);
     while ( *new )
-- 
2.1.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to