diff options
author | Juergen Gross <jgross@suse.com> | 2020-03-05 13:03:23 +0300 |
---|---|---|
committer | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2020-03-05 18:42:23 +0300 |
commit | 2f69a110e7bba3ec6bc089a2f736ca0941d887ed (patch) | |
tree | 57ffc62e0497d2f1be6ad89f9abd7c8adbdde722 /include/xen | |
parent | 8130b9d5b5abf26f9927b487c15319a187775f34 (diff) | |
download | linux-2f69a110e7bba3ec6bc089a2f736ca0941d887ed.tar.xz |
xen/xenbus: fix locking
Commit 060eabe8fbe726 ("xenbus/backend: Protect xenbus callback with
lock") introduced a bug by holding a lock while calling a function
which might schedule.
Fix that by using a semaphore instead.
Fixes: 060eabe8fbe726 ("xenbus/backend: Protect xenbus callback with lock")
Signed-off-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20200305100323.16736-1-jgross@suse.com
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'include/xen')
-rw-r--r-- | include/xen/xenbus.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h index 89a889585ba0..850a43bd69d3 100644 --- a/include/xen/xenbus.h +++ b/include/xen/xenbus.h @@ -42,6 +42,7 @@ #include <linux/completion.h> #include <linux/init.h> #include <linux/slab.h> +#include <linux/semaphore.h> #include <xen/interface/xen.h> #include <xen/interface/grant_table.h> #include <xen/interface/io/xenbus.h> @@ -76,7 +77,7 @@ struct xenbus_device { enum xenbus_state state; struct completion down; struct work_struct work; - spinlock_t reclaim_lock; + struct semaphore reclaim_sem; }; static inline struct xenbus_device *to_xenbus_device(struct device *dev) |