2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-30 08:04:13 +08:00
linux-next/drivers/xen/xenbus
Simon Gaiser 2a22ee6c3a xen: xenbus_dev_frontend: Fix XS_TRANSACTION_END handling
Commit fd8aa9095a ("xen: optimize xenbus driver for multiple
concurrent xenstore accesses") made a subtle change to the semantic of
xenbus_dev_request_and_reply() and xenbus_transaction_end().

Before on an error response to XS_TRANSACTION_END
xenbus_dev_request_and_reply() would not decrement the active
transaction counter. But xenbus_transaction_end() has always counted the
transaction as finished regardless of the response.

The new behavior is that xenbus_dev_request_and_reply() and
xenbus_transaction_end() will always count the transaction as finished
regardless the response code (handled in xs_request_exit()).

But xenbus_dev_frontend tries to end a transaction on closing of the
device if the XS_TRANSACTION_END failed before. Trying to close the
transaction twice corrupts the reference count. So fix this by also
considering a transaction closed if we have sent XS_TRANSACTION_END once
regardless of the return code.

Cc: <stable@vger.kernel.org> # 4.11
Fixes: fd8aa9095a ("xen: optimize xenbus driver for multiple concurrent xenstore accesses")
Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
2018-03-21 08:28:48 -04:00
..
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xenbus_client.c xen: don't compile pv-specific parts if XEN_PV isn't configured 2017-09-18 09:13:23 -04:00
xenbus_comms.c xenbus: track caller request id 2018-02-17 09:40:33 +01:00
xenbus_dev_backend.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xenbus_dev_frontend.c xen: xenbus_dev_frontend: Fix XS_TRANSACTION_END handling 2018-03-21 08:28:48 -04:00
xenbus_probe_backend.c xen: modify xenstore watch event interface 2017-02-09 11:26:49 -05:00
xenbus_probe_frontend.c xen: xenbus_probe_frontend: mark expected switch fall-throughs 2017-11-03 11:36:07 -04:00
xenbus_probe.c xen: xenbus: use put_device() instead of kfree() 2018-03-08 15:30:30 +01:00
xenbus_xs.c xenbus: track caller request id 2018-02-17 09:40:33 +01:00
xenbus.h xenbus: track caller request id 2018-02-17 09:40:33 +01:00