[hare-scsi-devel:auth.v2 7/12] drivers/nvme/target/fabrics-cmd.c:233:10: error: 'struct nvmet_sq' has no member named 'authenticated'

From: kernel test robot
Date: Mon Jul 12 2021 - 14:09:02 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git auth.v2
head: 9107ea4a3526c6801b38b7a2345b7372278a35ba
commit: ca7a6b4cc19e4383ec693c75bb5c6f678b692a14 [7/12] nvmet: Implement basic In-Band Authentication
config: x86_64-rhel-8.3 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commit/?id=ca7a6b4cc19e4383ec693c75bb5c6f678b692a14
git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git fetch --no-tags hare-scsi-devel auth.v2
git checkout ca7a6b4cc19e4383ec693c75bb5c6f678b692a14
# save the attached .config to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/nvme/target/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

In file included from drivers/nvme/target/fabrics-cmd.c:8:
drivers/nvme/target/nvmet.h:728:1: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
728 | const char nvmet_dhchap_dhgroup_name(int dhgid) { return NULL; }
| ^~~~~
drivers/nvme/target/nvmet.h:728:12: warning: no previous prototype for 'nvmet_dhchap_dhgroup_name' [-Wmissing-prototypes]
728 | const char nvmet_dhchap_dhgroup_name(int dhgid) { return NULL; }
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/uapi/linux/posix_types.h:5,
from include/uapi/linux/types.h:14,
from include/linux/types.h:6,
from include/uapi/linux/sched.h:5,
from include/linux/sched.h:10,
from include/linux/blkdev.h:5,
from drivers/nvme/target/fabrics-cmd.c:7:
drivers/nvme/target/nvmet.h: In function 'nvmet_dhchap_dhgroup_name':
include/linux/stddef.h:8:14: warning: returning 'void *' from a function with return type 'char' makes integer from pointer without a cast [-Wint-conversion]
8 | #define NULL ((void *)0)
| ^
drivers/nvme/target/nvmet.h:728:58: note: in expansion of macro 'NULL'
728 | const char nvmet_dhchap_dhgroup_name(int dhgid) { return NULL; }
| ^~~~
drivers/nvme/target/fabrics-cmd.c: In function 'nvmet_execute_admin_connect':
>> drivers/nvme/target/fabrics-cmd.c:233:10: error: 'struct nvmet_sq' has no member named 'authenticated'
233 | req->sq->authenticated = false;
| ^~
>> drivers/nvme/target/fabrics-cmd.c:234:10: error: 'struct nvmet_sq' has no member named 'dhchap_step'
234 | req->sq->dhchap_step = NVME_AUTH_DHCHAP_MESSAGE_NEGOTIATE;
| ^~
drivers/nvme/target/fabrics-cmd.c: In function 'nvmet_execute_io_connect':
drivers/nvme/target/fabrics-cmd.c:299:10: error: 'struct nvmet_sq' has no member named 'authenticated'
299 | req->sq->authenticated = false;
| ^~
drivers/nvme/target/fabrics-cmd.c:300:10: error: 'struct nvmet_sq' has no member named 'dhchap_step'
300 | req->sq->dhchap_step = NVME_AUTH_DHCHAP_MESSAGE_NEGOTIATE;
| ^~


vim +233 drivers/nvme/target/fabrics-cmd.c

159
160 static void nvmet_execute_admin_connect(struct nvmet_req *req)
161 {
162 struct nvmf_connect_command *c = &req->cmd->connect;
163 struct nvmf_connect_data *d;
164 struct nvmet_ctrl *ctrl = NULL;
165 u16 status = 0;
166 int ret;
167
168 if (!nvmet_check_transfer_len(req, sizeof(struct nvmf_connect_data)))
169 return;
170
171 d = kmalloc(sizeof(*d), GFP_KERNEL);
172 if (!d) {
173 status = NVME_SC_INTERNAL;
174 goto complete;
175 }
176
177 status = nvmet_copy_from_sgl(req, 0, d, sizeof(*d));
178 if (status)
179 goto out;
180
181 /* zero out initial completion result, assign values as needed */
182 req->cqe->result.u32 = 0;
183
184 if (c->recfmt != 0) {
185 pr_warn("invalid connect version (%d).\n",
186 le16_to_cpu(c->recfmt));
187 req->error_loc = offsetof(struct nvmf_connect_command, recfmt);
188 status = NVME_SC_CONNECT_FORMAT | NVME_SC_DNR;
189 goto out;
190 }
191
192 if (unlikely(d->cntlid != cpu_to_le16(0xffff))) {
193 pr_warn("connect attempt for invalid controller ID %#x\n",
194 d->cntlid);
195 status = NVME_SC_CONNECT_INVALID_PARAM | NVME_SC_DNR;
196 req->cqe->result.u32 = IPO_IATTR_CONNECT_DATA(cntlid);
197 goto out;
198 }
199
200 status = nvmet_alloc_ctrl(d->subsysnqn, d->hostnqn, req,
201 le32_to_cpu(c->kato), &ctrl);
202 if (status)
203 goto out;
204
205 ctrl->pi_support = ctrl->port->pi_enable && ctrl->subsys->pi_support;
206
207 uuid_copy(&ctrl->hostid, &d->hostid);
208
209 ret = nvmet_setup_auth(ctrl, req);
210 if (ret < 0) {
211 pr_err("Failed to setup authentication, error %d\n", ret);
212 nvmet_ctrl_put(ctrl);
213 if (ret == -EPERM)
214 status = (NVME_SC_CONNECT_INVALID_HOST | NVME_SC_DNR);
215 else
216 status = NVME_SC_INTERNAL;
217 goto out;
218 }
219
220 status = nvmet_install_queue(ctrl, req);
221 if (status) {
222 nvmet_ctrl_put(ctrl);
223 goto out;
224 }
225
226 pr_info("creating controller %d for subsystem %s for NQN %s%s%s.\n",
227 ctrl->cntlid, ctrl->subsys->subsysnqn, ctrl->hostnqn,
228 ctrl->pi_support ? " T10-PI is enabled" : "",
229 nvmet_has_auth(ctrl) ? " with DH-HMAC-CHAP" : "");
230 req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid);
231 if (nvmet_has_auth(ctrl)) {
232 /* Initialize in-band authentication */
> 233 req->sq->authenticated = false;
> 234 req->sq->dhchap_step = NVME_AUTH_DHCHAP_MESSAGE_NEGOTIATE;
235 req->cqe->result.u32 |= 0x2 << 16;
236 }
237 out:
238 kfree(d);
239 complete:
240 nvmet_req_complete(req, status);
241 }
242

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip