diff options
Diffstat (limited to 'drivers/target/target_core_user.c')
-rw-r--r-- | drivers/target/target_core_user.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index c448ef421ce7..937cebf76633 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/parser.h> | 25 | #include <linux/parser.h> |
26 | #include <linux/vmalloc.h> | 26 | #include <linux/vmalloc.h> |
27 | #include <linux/uio_driver.h> | 27 | #include <linux/uio_driver.h> |
28 | #include <linux/stringify.h> | ||
28 | #include <net/genetlink.h> | 29 | #include <net/genetlink.h> |
29 | #include <scsi/scsi_common.h> | 30 | #include <scsi/scsi_common.h> |
30 | #include <scsi/scsi_proto.h> | 31 | #include <scsi/scsi_proto.h> |
@@ -538,14 +539,8 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry * | |||
538 | UPDATE_HEAD(udev->data_tail, cmd->data_length, udev->data_size); | 539 | UPDATE_HEAD(udev->data_tail, cmd->data_length, udev->data_size); |
539 | pr_warn("TCMU: Userspace set UNKNOWN_OP flag on se_cmd %p\n", | 540 | pr_warn("TCMU: Userspace set UNKNOWN_OP flag on se_cmd %p\n", |
540 | cmd->se_cmd); | 541 | cmd->se_cmd); |
541 | transport_generic_request_failure(cmd->se_cmd, | 542 | entry->rsp.scsi_status = SAM_STAT_CHECK_CONDITION; |
542 | TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE); | 543 | } else if (entry->rsp.scsi_status == SAM_STAT_CHECK_CONDITION) { |
543 | cmd->se_cmd = NULL; | ||
544 | kmem_cache_free(tcmu_cmd_cache, cmd); | ||
545 | return; | ||
546 | } | ||
547 | |||
548 | if (entry->rsp.scsi_status == SAM_STAT_CHECK_CONDITION) { | ||
549 | memcpy(se_cmd->sense_buffer, entry->rsp.sense_buffer, | 544 | memcpy(se_cmd->sense_buffer, entry->rsp.sense_buffer, |
550 | se_cmd->scsi_sense_length); | 545 | se_cmd->scsi_sense_length); |
551 | 546 | ||
@@ -577,7 +572,6 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry * | |||
577 | static unsigned int tcmu_handle_completions(struct tcmu_dev *udev) | 572 | static unsigned int tcmu_handle_completions(struct tcmu_dev *udev) |
578 | { | 573 | { |
579 | struct tcmu_mailbox *mb; | 574 | struct tcmu_mailbox *mb; |
580 | LIST_HEAD(cpl_cmds); | ||
581 | unsigned long flags; | 575 | unsigned long flags; |
582 | int handled = 0; | 576 | int handled = 0; |
583 | 577 | ||
@@ -905,7 +899,7 @@ static int tcmu_configure_device(struct se_device *dev) | |||
905 | WARN_ON(!PAGE_ALIGNED(udev->data_off)); | 899 | WARN_ON(!PAGE_ALIGNED(udev->data_off)); |
906 | WARN_ON(udev->data_size % PAGE_SIZE); | 900 | WARN_ON(udev->data_size % PAGE_SIZE); |
907 | 901 | ||
908 | info->version = xstr(TCMU_MAILBOX_VERSION); | 902 | info->version = __stringify(TCMU_MAILBOX_VERSION); |
909 | 903 | ||
910 | info->mem[0].name = "tcm-user command & data buffer"; | 904 | info->mem[0].name = "tcm-user command & data buffer"; |
911 | info->mem[0].addr = (phys_addr_t) udev->mb_addr; | 905 | info->mem[0].addr = (phys_addr_t) udev->mb_addr; |