• C
    dm mpath: call activate fn for each path in pg_init · e54f77dd
    Chandra Seetharaman 提交于
    Fixed a problem affecting reinstatement of passive paths.
    
    Before we moved the hardware handler from dm to SCSI, it performed a pg_init
    for a path group and didn't maintain any state about each path in hardware
    handler code.
    
    But in SCSI dh, such state is now maintained, as we want to fail I/O early on a
    path if it is not the active path.
    
    All the hardware handlers have a state now and set to active or some form of
    inactive.  They have prep_fn() which uses this state to fail the I/O without
    it ever being sent to the device.
    
    So in effect when dm-multipath calls scsi_dh_activate(), activate is
    sent to only one path and the "state" of that path is changed appropriately
    to "active" while other paths in the same path group are never changed
    as they never got an "activate".
    
    In order make sure all the paths in a path group gets their state set
    properly when a pg_init happens, we need to call scsi_dh_activate() on
    all paths in a path group.
    
    Doing this at the hardware handler layer is not a good option as we
    want the multipath layer to define the relationship between path and path
    groups and not the hardware handler.
    
    Attached patch sends an "activate" on each path in a path group when a
    path group is switched. It also sends an activate when a path is reinstated.
    Signed-off-by: NChandra Seetharaman <sekharan@us.ibm.com>
    Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
    e54f77dd
dm-mpath.c 33.9 KB