Hi Bodo,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v4.17-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system]
url:
https://github.com/0day-ci/linux/commits/Bodo-Stroesser/TCMUser-add-read-length-support/20180526-231412
config: x86_64-randconfig-x003-201820 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
drivers//target/target_core_user.c: In function 'tcmu_handle_completion':
>> drivers//target/target_core_user.c:1077:28: error:
>> 'SCF_TREAT_READ_AS_NORMAL' undeclared (first use in this function)
se_cmd->se_cmd_flags |= SCF_TREAT_READ_AS_NORMAL;
^~~~
drivers//target/target_core_user.c:1077:28: note: each undeclared identifier
is reported only once for each function it appears in
vim +/SCF_TREAT_READ_AS_NORMAL +1077 drivers//target/target_core_user.c
1041
1042 static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct
tcmu_cmd_entry *entry)
1043 {
1044 struct se_cmd *se_cmd = cmd->se_cmd;
1045 struct tcmu_dev *udev = cmd->tcmu_dev;
1046 bool read_len_valid = false;
1047 uint32_t read_len = se_cmd->data_length;
1048
1049 /*
1050 * cmd has been completed already from timeout, just reclaim
1051 * data area space and free cmd
1052 */
1053 if (test_bit(TCMU_CMD_BIT_EXPIRED, >flags))
1054 goto out;
1055
1056 tcmu_cmd_reset_dbi_cur(cmd);
1057
1058 if (entry->hdr.uflags & TCMU_UFLAG_UNKNOWN_OP) {
1059 pr_warn("TCMU: Userspace set UNKNOWN_OP flag on se_cmd
%p\n",
1060 cmd->se_cmd);
1061 entry->rsp.scsi_status = SAM_STAT_CHECK_CONDITION;
1062 goto done;
1063 }
1064
1065 if (se_cmd->data_direction == DMA_FROM_DEVICE &&
1066 (entry->hdr.uflags & TCMU_UFLAG_READ_LEN) &&
entry->rsp.read_len) {
1067 read_len_valid = true;
1068 if (entry->rsp.read_len < read_len)
1069 read_len = entry->rsp.read_len;
1070 }
1071
1072 if (entry->rsp.scsi_status == SAM_STAT_CHECK_CONDITION) {
1073 transport_copy_sense_to_cmd(se_cmd,
entry->rsp.sense_buffer);
1074 if (!read_len_valid )
1075 goto done;
1076 else
> 1077 se_cmd->se_cmd_flags |=
> SCF_TREAT_READ_AS_NORMAL;
1078 }
1079 if (se_cmd->se_cmd_flags & SCF_BIDI) {
1080 /* Get Data-In buffer before clean up */
1081 gather_data_area(udev, cmd, true, read_len);
1082 } else if (se_cmd->data_direction == DMA_FROM_DEVICE) {
1083 gather_data_area(udev, cmd, false, read_len);
1084 } else if (se_cmd->data_direction == DMA_TO_DEVICE) {
1085 /* TODO: */
1086 } else if (se_cmd->data_direction != DMA_NONE) {
1087 pr_warn("TCMU: data direction was %d!\n",
1088 se_cmd->data_direction);
1089 }
1090
1091 done:
1092 if (read_len_valid) {
1093 pr_debug("read_len = %d\n", read_len);
1094 target_complete_cmd_with_length(cmd->se_cmd,
1095 entry->rsp.scsi_status,
read_len);
1096 } else
1097 target_complete_cmd(cmd->se_cmd,
entry->rsp.scsi_status);
1098
1099 out:
1100 cmd->se_cmd = NULL;
1101 tcmu_cmd_free_data(cmd, cmd->dbi_cnt);
1102 tcmu_free_cmd(cmd);
1103 }
1104
---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
.config.gz
Description: application/gzip