Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322915
b: refs/heads/master
c: 306c11b
h: refs/heads/master
i:
  322913: e413c6c
  322911: 63e4645
v: v3
  • Loading branch information
Paolo Bonzini authored and Nicholas Bellinger committed Sep 7, 2012
1 parent 974bfd5 commit d94e34c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 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: d5829eac5f7cfff89c6d1cf11717eee97cf030d0
refs/heads/master: 306c11b28d7bb85a7adda741798a2b6b60dd305a
8 changes: 4 additions & 4 deletions trunk/drivers/target/target_core_pscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,11 +688,11 @@ static void pscsi_transport_complete(struct se_cmd *cmd, struct scatterlist *sg,
* Hack to make sure that Write-Protect modepage is set if R/O mode is
* forced.
*/
if (!cmd->se_deve || !cmd->data_length)
goto after_mode_sense;

if (((cdb[0] == MODE_SENSE) || (cdb[0] == MODE_SENSE_10)) &&
(status_byte(result) << 1) == SAM_STAT_GOOD) {
if (!cmd->se_deve)
goto after_mode_sense;

if (cmd->se_deve->lun_flags & TRANSPORT_LUNFLAGS_READ_ONLY) {
unsigned char *buf = transport_kmap_data_sg(cmd);

Expand All @@ -709,7 +709,7 @@ static void pscsi_transport_complete(struct se_cmd *cmd, struct scatterlist *sg,
}
after_mode_sense:

if (sd->type != TYPE_TAPE)
if (sd->type != TYPE_TAPE || !cmd->data_length)
goto after_mode_select;

/*
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -2300,7 +2300,9 @@ int transport_generic_new_cmd(struct se_cmd *cmd)
* into the fabric for data transfers, go ahead and complete it right
* away.
*/
if (!cmd->data_length) {
if (!cmd->data_length &&
(cmd->se_dev->transport->transport_type != TRANSPORT_PLUGIN_PHBA_PDEV ||
cmd->t_task_cdb[0] == REPORT_LUNS) {
spin_lock_irq(&cmd->t_state_lock);
cmd->t_state = TRANSPORT_COMPLETE;
cmd->transport_state |= CMD_T_ACTIVE;
Expand Down

0 comments on commit d94e34c

Please sign in to comment.