* volume for the target, then use the .backup of the target
* instead of the read-write.
*/
- if (cm_followBackupPath && targetType == RWVOL &&
- (scp->flags & CM_SCACHEFLAG_RO|CM_SCACHEFLAG_PURERO) == CM_SCACHEFLAG_RO &&
- volp->bk.ID != 0) {
+ if (cm_followBackupPath &&
+ volp->bk.ID != 0 &&
+ (dscp->flags & (CM_SCACHEFLAG_RO|CM_SCACHEFLAG_PURERO)) == CM_SCACHEFLAG_RO &&
+ (targetType == RWVOL || targetType == ROVOL && volp->ro.ID == 0)
+ ) {
targetType = BACKVOL;
}
/* if the mt pt is in a read-only volume (not just a