Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302448
b: refs/heads/master
c: 72d9e0f
h: refs/heads/master
v: v3
  • Loading branch information
Moger, Babu authored and James Bottomley committed Apr 23, 2012
1 parent e64a9df commit 674e1cc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dcd3a754b8c811441326d68574598fb3b4976ff4
refs/heads/master: 72d9e0f383c2b7a2e2fe4442577319bae0686f40
29 changes: 26 additions & 3 deletions trunk/drivers/scsi/device_handler/scsi_dh_alua.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,14 +675,37 @@ static int alua_activate(struct scsi_device *sdev,
{
struct alua_dh_data *h = get_alua_data(sdev);
int err = SCSI_DH_OK;
int stpg = 0;

err = alua_rtpg(sdev, h);
if (err != SCSI_DH_OK)
goto out;

if (h->tpgs & TPGS_MODE_EXPLICIT &&
h->state != TPGS_STATE_OPTIMIZED &&
h->state != TPGS_STATE_LBA_DEPENDENT) {
if (h->tpgs & TPGS_MODE_EXPLICIT) {
switch (h->state) {
case TPGS_STATE_NONOPTIMIZED:
stpg = 1;
if ((h->flags & ALUA_OPTIMIZE_STPG) &&
(!h->pref) &&
(h->tpgs & TPGS_MODE_IMPLICIT))
stpg = 0;
break;
case TPGS_STATE_STANDBY:
stpg = 1;
break;
case TPGS_STATE_UNAVAILABLE:
case TPGS_STATE_OFFLINE:
err = SCSI_DH_IO;
break;
case TPGS_STATE_TRANSITIONING:
err = SCSI_DH_RETRY;
break;
default:
break;
}
}

if (stpg) {
h->callback_fn = fn;
h->callback_data = data;
err = submit_stpg(h);
Expand Down

0 comments on commit 674e1cc

Please sign in to comment.