From: Vladislav B. <vs...@vl...> - 2017-07-26 03:19:18
|
Committed, thanks! Vlad Marc Smith wrote on 07/25/2017 08:50 AM: > In the current implementation of SCST/trunk the recently introduced > "active" attribute for vdisk_blockio devices is managed by an ALUA > state change (start/finish), for specific ALUA states (eg, > active/standby). Relying on ALUA state changes to open/close the > back-end block device does indeed work for some SCST configurations, > however, some users desire advanced control over this setting, and > prefer to handle opening/closing a back-end block device from the > cluster resource agent (RA) script. Certain ambiguous situations can > also arise if more than one target group exists per SCST device > group... in this case, a back-end device may flip/flop (opened/closed) > and may end up in an inconsistent state if care is not taken in the > implementation of the cluster RA. > > The patch below makes the "active" sysfs attribute for vdisk_blockio > readable/writable by a user, thereby giving full control over a > device's opened/closed state. The default behavior for SCST > vdisk_blockio devices is to allow ALUA state changes to control the > opened/closed ("active") state of a back-end device > (bind_alua_state=1). If the user wishes to handle setting the "active" > attribute themselves via a script or cluster RA, they would set > bind_alua_state=0 for the vdisk_blockio device, and the "active" > attribute would not be modified on ALUA state changes, it is then left > up to the user to handle this. > > The patch below also fixes a bug where the attribute value is not > changed when the appropriate ALUA state is set, unless a target > session exists for the target group target; see here for more > information: https://sourceforge.net/p/scst/mailman/message/35898014/ > > > Changes since v2: > - Rebase against trunk/r7211 > - Added documentation for the active and bind_alua_state attributes in > the "VDISK device handler" section of README and README_in-tree > Changes since v1: > - Added missing 'bind_alua_state' attribute to vdisk_blk_devtype > member add_device_parameters > - Parse the 'bind_alua_state' attribute in vdev_parse_add_dev_params() > - And 'bind_alua_state' is needed in allowed_params[] of > vdev_blockio_add_device() > > > Signed-off-by: Marc A. Smith <mar...@pa...> |