• Simon Gaiser's avatar
    xen: xenbus_dev_frontend: Fix XS_TRANSACTION_END handling · 0319ce67
    Simon Gaiser authored
    commit 2a22ee6c upstream.
    
    Commit fd8aa909 ("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: fd8aa909 ("xen: optimize xenbus driver for multiple concurrent xenstore accesses")
    Signed-off-by: 's avatarSimon Gaiser <simon@invisiblethingslab.com>
    Reviewed-by: 's avatarJuergen Gross <jgross@suse.com>
    Signed-off-by: 's avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    0319ce67
Name
Last commit
Last update
..
events Loading commit data...
xen-pciback Loading commit data...
xenbus Loading commit data...
xenfs Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
acpi.c Loading commit data...
arm-device.c Loading commit data...
balloon.c Loading commit data...
biomerge.c Loading commit data...
cpu_hotplug.c Loading commit data...
dbgp.c Loading commit data...
efi.c Loading commit data...
evtchn.c Loading commit data...
fallback.c Loading commit data...
features.c Loading commit data...
gntalloc.c Loading commit data...
gntdev.c Loading commit data...
grant-table.c Loading commit data...
manage.c Loading commit data...
mcelog.c Loading commit data...
pci.c Loading commit data...
pcpu.c Loading commit data...
platform-pci.c Loading commit data...
preempt.c Loading commit data...
privcmd.c Loading commit data...
privcmd.h Loading commit data...
pvcalls-back.c Loading commit data...
swiotlb-xen.c Loading commit data...
sys-hypervisor.c Loading commit data...
time.c Loading commit data...
tmem.c Loading commit data...
xen-acpi-cpuhotplug.c Loading commit data...
xen-acpi-memhotplug.c Loading commit data...
xen-acpi-pad.c Loading commit data...
xen-acpi-processor.c Loading commit data...
xen-balloon.c Loading commit data...
xen-scsiback.c Loading commit data...
xen-selfballoon.c Loading commit data...
xen-stub.c Loading commit data...
xlate_mmu.c Loading commit data...