From: Konrad Rzeszutek Wilk Date: Fri, 21 Aug 2015 14:49:22 +0000 (-0400) Subject: tmem: Add ASSERT in obj_rb_insert for pool->rwlock lock. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2593^2~9 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7646da32f6a863b4c9c7ec9a7226bf675921622e;p=xen.git tmem: Add ASSERT in obj_rb_insert for pool->rwlock lock. 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 Reviewed-by: Andrew Cooper Acked-by: Wei Liu --- diff --git a/xen/common/tmem.c b/xen/common/tmem.c index ed9b975c09..6ea602b464 100644 --- a/xen/common/tmem.c +++ b/xen/common/tmem.c @@ -916,6 +916,9 @@ 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; + ASSERT(obj->pool); + ASSERT_WRITELOCK(&obj->pool->pool_rwlock); + new = &(root->rb_node); while ( *new ) {