gnttab: drop useless locking
authorJan Beulich <jbeulich@suse.com>
Wed, 16 Aug 2017 08:56:23 +0000 (10:56 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 16 Aug 2017 08:56:23 +0000 (10:56 +0200)
Holding any lock while accessing the maptrack entry fields is
pointless, as these entries are protected by their associated active
entry lock (which is being acquired later, before re-validating the
fields read without holding the lock).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/grant_table.c

index 56082d83736b4bc73eeb642c76d42fef10103fa0..5e578c69ff09e4f3a17db0da8f5493470494cb55 100644 (file)
@@ -1143,19 +1143,14 @@ __gnttab_unmap_common(
     smp_rmb();
     map = &maptrack_entry(lgt, op->handle);
 
-    grant_read_lock(lgt);
-
     if ( unlikely(!read_atomic(&map->flags)) )
     {
-        grant_read_unlock(lgt);
         gdprintk(XENLOG_INFO, "Zero flags for handle %#x\n", op->handle);
         op->status = GNTST_bad_handle;
         return;
     }
 
     dom = map->domid;
-    grant_read_unlock(lgt);
-
     if ( unlikely((rd = rcu_lock_domain_by_id(dom)) == NULL) )
     {
         /* This can happen when a grant is implicitly unmapped. */