diff options
author | 2020-03-07 08:04:54 -0600 | |
---|---|---|
committer | 2020-03-07 08:04:54 -0600 | |
commit | cbee7c8b4485fb876895b82ddba19ae4e2e2d102 (patch) | |
tree | 4f3fac5090b301f8561c6e3f3f356cc494fc5194 /drivers/xen/xenbus/xenbus_probe_backend.c | |
parent | Merge tag 'for-linus-2020-03-07' of gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux (diff) | |
parent | xen/blkfront: fix ring info addressing (diff) | |
download | wireguard-linux-cbee7c8b4485fb876895b82ddba19ae4e2e2d102.tar.xz wireguard-linux-cbee7c8b4485fb876895b82ddba19ae4e2e2d102.zip |
Merge tag 'for-linus-5.6b-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull xen fixes from Juergen Gross:
"Four fixes and a small cleanup patch:
- two fixes by Dongli Zhang fixing races in the xenbus driver
- two fixes by me fixing issues introduced in 5.6
- a small cleanup by Gustavo Silva replacing a zero-length array with
a flexible-array"
* tag 'for-linus-5.6b-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
xen/blkfront: fix ring info addressing
xen/xenbus: fix locking
xenbus: req->err should be updated before req->state
xenbus: req->body should be updated before req->state
xen: Replace zero-length array with flexible-array member
Diffstat (limited to 'drivers/xen/xenbus/xenbus_probe_backend.c')
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe_backend.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c b/drivers/xen/xenbus/xenbus_probe_backend.c index 791f6fe01e91..9b2fbe69bccc 100644 --- a/drivers/xen/xenbus/xenbus_probe_backend.c +++ b/drivers/xen/xenbus/xenbus_probe_backend.c @@ -45,6 +45,7 @@ #include <linux/mm.h> #include <linux/notifier.h> #include <linux/export.h> +#include <linux/semaphore.h> #include <asm/page.h> #include <asm/pgtable.h> @@ -257,10 +258,10 @@ static int backend_reclaim_memory(struct device *dev, void *data) drv = to_xenbus_driver(dev->driver); if (drv && drv->reclaim_memory) { xdev = to_xenbus_device(dev); - if (!spin_trylock(&xdev->reclaim_lock)) + if (down_trylock(&xdev->reclaim_sem)) return 0; drv->reclaim_memory(xdev); - spin_unlock(&xdev->reclaim_lock); + up(&xdev->reclaim_sem); } return 0; } |