diff mbox

[7/8] target_core_alua: disallow READ_CAPACITY when in standby

Message ID 1434620622-65391-8-git-send-email-hare@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Hannes Reinecke June 18, 2015, 9:43 a.m. UTC
Strictly speaking SPC doesn't require READ CAPACITY and friends
to be supported while in the port is in standby.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/target/target_core_alua.c | 9 ---------
 1 file changed, 9 deletions(-)

Comments

Chris Boot June 18, 2015, 11:40 a.m. UTC | #1
On 18/06/15 10:43, Hannes Reinecke wrote:
> Strictly speaking SPC doesn't require READ CAPACITY and friends
> to be supported while in the port is in standby.

Hi Hannes,

I'd really rather this didn't go away. Yes, strictly speaking SPC
doesn't require these commands but Linux in practice does, and ISTR this
was added at my request too.

We need it on our storage setups to prevent the Linux SCSI stack from
exploding. If this is removed here, they'll start exploding again until
the fix goes in and the initiators are updated.

Could this please be kept as an option or something?

Cheers,
Chris

> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>  drivers/target/target_core_alua.c | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
> index edaf1b9..a62e58b 100644
> --- a/drivers/target/target_core_alua.c
> +++ b/drivers/target/target_core_alua.c
> @@ -561,16 +561,7 @@ static inline int core_alua_state_standby(
>  	case REPORT_LUNS:
>  	case RECEIVE_DIAGNOSTIC:
>  	case SEND_DIAGNOSTIC:
> -	case READ_CAPACITY:
>  		return 0;
> -	case SERVICE_ACTION_IN_16:
> -		switch (cdb[1] & 0x1f) {
> -		case SAI_READ_CAPACITY_16:
> -			return 0;
> -		default:
> -			set_ascq(cmd, ASCQ_04H_ALUA_TG_PT_STANDBY);
> -			return 1;
> -		}
>  	case MAINTENANCE_IN:
>  		switch (cdb[1] & 0x1f) {
>  		case MI_REPORT_TARGET_PGS:
>
Hannes Reinecke June 18, 2015, 2:32 p.m. UTC | #2
On 06/18/2015 01:40 PM, Chris Boot wrote:
> On 18/06/15 10:43, Hannes Reinecke wrote:
>> Strictly speaking SPC doesn't require READ CAPACITY and friends
>> to be supported while in the port is in standby.
> 
> Hi Hannes,
> 
> I'd really rather this didn't go away. Yes, strictly speaking SPC
> doesn't require these commands but Linux in practice does, and ISTR this
> was added at my request too.
> 
> We need it on our storage setups to prevent the Linux SCSI stack from
> exploding. If this is removed here, they'll start exploding again until
> the fix goes in and the initiators are updated.
> 

This was exactly why I added it, so that one could go about and fix
the linux SCSI stack :-)

> Could this please be kept as an option or something?
> 
Yeah, I see what I can do.

Cheers,

Hannes
Christoph Hellwig June 19, 2015, 6:49 a.m. UTC | #3
On Thu, Jun 18, 2015 at 11:43:41AM +0200, Hannes Reinecke wrote:
> Strictly speaking SPC doesn't require READ CAPACITY and friends
> to be supported while in the port is in standby.

But it does allow it.  We should always aim to implement the best
possible behavior instead of aiming for the worst.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hannes Reinecke June 19, 2015, 7:07 a.m. UTC | #4
On 06/19/2015 08:49 AM, Christoph Hellwig wrote:
> On Thu, Jun 18, 2015 at 11:43:41AM +0200, Hannes Reinecke wrote:
>> Strictly speaking SPC doesn't require READ CAPACITY and friends
>> to be supported while in the port is in standby.
> 
> But it does allow it.  We should always aim to implement the best
> possible behavior instead of aiming for the worst.
> 
Right. As mentioned in my other mail this patch was primarily to
fixup READ CAPACITY issues in the linux kernel.
I'll be updating the patch to make it optional.

Cheers,

Hannes
diff mbox

Patch

diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
index edaf1b9..a62e58b 100644
--- a/drivers/target/target_core_alua.c
+++ b/drivers/target/target_core_alua.c
@@ -561,16 +561,7 @@  static inline int core_alua_state_standby(
 	case REPORT_LUNS:
 	case RECEIVE_DIAGNOSTIC:
 	case SEND_DIAGNOSTIC:
-	case READ_CAPACITY:
 		return 0;
-	case SERVICE_ACTION_IN_16:
-		switch (cdb[1] & 0x1f) {
-		case SAI_READ_CAPACITY_16:
-			return 0;
-		default:
-			set_ascq(cmd, ASCQ_04H_ALUA_TG_PT_STANDBY);
-			return 1;
-		}
 	case MAINTENANCE_IN:
 		switch (cdb[1] & 0x1f) {
 		case MI_REPORT_TARGET_PGS: