]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: drivers: base: Support atomic version of attribute_container_device_trigger
authorGabriel Krisman Bertazi <krisman@collabora.com>
Mon, 6 Jan 2020 18:58:15 +0000 (13:58 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 16 Jan 2020 03:55:36 +0000 (22:55 -0500)
commitcf6385afcd27e0a83ab3ec9693e14ca00ff68366
tree7f06aa8f71974f41bc720375382d1dfb77eb9ff6
parent868e98bf63ac08d3a5174f84ecd7edd357b7db57
scsi: drivers: base: Support atomic version of attribute_container_device_trigger

attribute_container_device_trigger invokes callbacks that may fail for one
or more classdevs, for instance, the transport_add_class_device callback,
called during transport creation, does memory allocation.  This
information, though, is not propagated to upper layers, and any driver
using the attribute_container_device_trigger API will not know whether any,
some, or all callbacks succeeded.

This patch implements a safe version of this dispatcher, to either succeed
all the callbacks or revert to the original state.

Link: https://lore.kernel.org/r/20200106185817.640331-2-krisman@collabora.com
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/base/attribute_container.c
include/linux/attribute_container.h