Re: [PATCH v4 2/2] virtio_blk: add inline encryption support

From: kernel test robot

Date: Sat Oct 10 2026 - 01:00:46 EST


Hi Linlin,

kernel test robot noticed the following build errors:

[auto build test ERROR on axboe/for-next]
[also build test ERROR on mst-vhost/linux-next linus/master v7.3-rc6 next-20261008]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Linlin-Zhang/virtio_blk-Add-control-virtqueue-support/20261008-211713
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next
patch link: https://lore.kernel.org/r/20261009041727.3170811-3-linlin.zhang%40oss.qualcomm.com
patch subject: [PATCH v4 2/2] virtio_blk: add inline encryption support
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20261010/202610101218.PA25qZJG-lkp@xxxxxxxxx/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261010/202610101218.PA25qZJG-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610101218.PA25qZJG-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

drivers/block/virtio_blk.c: In function 'virtblk_setup_cmd':
>> drivers/block/virtio_blk.c:414:61: error: 'struct request' has no member named 'crypt_keyslot'
414 | blk_crypto_keyslot_index(req->crypt_keyslot));
| ^~
>> drivers/block/virtio_blk.c:417:58: error: 'struct request' has no member named 'crypt_ctx'
417 | cpu_to_virtio64(vdev, req->crypt_ctx->bc_dun[i]);
| ^~
drivers/block/virtio_blk.c: At top level:
drivers/block/virtio_blk.c:1066:12: warning: 'virtblk_ctrl_vq_request' defined but not used [-Wunused-function]
1066 | static int virtblk_ctrl_vq_request(struct virtio_blk *vblk,
| ^~~~~~~~~~~~~~~~~~~~~~~


vim +414 drivers/block/virtio_blk.c

318
319 static blk_status_t virtblk_setup_cmd(struct virtio_device *vdev,
320 struct request *req,
321 struct virtblk_req *vbr)
322 {
323 size_t in_hdr_len = sizeof(vbr->in_hdr.status);
324 bool unmap = false;
325 u32 type;
326 u64 sector = 0;
327 int i;
328
329 if (!IS_ENABLED(CONFIG_BLK_DEV_ZONED) && op_is_zone_mgmt(req_op(req)))
330 return BLK_STS_NOTSUPP;
331
332 /* Set fields for all request types */
333 vbr->out_hdr.base.ioprio = cpu_to_virtio32(vdev, req_get_ioprio(req));
334
335 switch (req_op(req)) {
336 case REQ_OP_READ:
337 if (is_crypto_request(req))
338 type = VIRTIO_BLK_T_CRYPTO_IN;
339 else
340 type = VIRTIO_BLK_T_IN;
341 sector = blk_rq_pos(req);
342 break;
343 case REQ_OP_WRITE:
344 if (is_crypto_request(req))
345 type = VIRTIO_BLK_T_CRYPTO_OUT;
346 else
347 type = VIRTIO_BLK_T_OUT;
348 sector = blk_rq_pos(req);
349 break;
350 case REQ_OP_FLUSH:
351 type = VIRTIO_BLK_T_FLUSH;
352 break;
353 case REQ_OP_DISCARD:
354 type = VIRTIO_BLK_T_DISCARD;
355 break;
356 case REQ_OP_WRITE_ZEROES:
357 type = VIRTIO_BLK_T_WRITE_ZEROES;
358 unmap = !(req->cmd_flags & REQ_NOUNMAP);
359 break;
360 case REQ_OP_SECURE_ERASE:
361 type = VIRTIO_BLK_T_SECURE_ERASE;
362 break;
363 case REQ_OP_ZONE_OPEN:
364 type = VIRTIO_BLK_T_ZONE_OPEN;
365 sector = blk_rq_pos(req);
366 break;
367 case REQ_OP_ZONE_CLOSE:
368 type = VIRTIO_BLK_T_ZONE_CLOSE;
369 sector = blk_rq_pos(req);
370 break;
371 case REQ_OP_ZONE_FINISH:
372 type = VIRTIO_BLK_T_ZONE_FINISH;
373 sector = blk_rq_pos(req);
374 break;
375 case REQ_OP_ZONE_APPEND:
376 type = VIRTIO_BLK_T_ZONE_APPEND;
377 sector = blk_rq_pos(req);
378 in_hdr_len = sizeof(vbr->in_hdr.zone_append);
379 break;
380 case REQ_OP_ZONE_RESET:
381 type = VIRTIO_BLK_T_ZONE_RESET;
382 sector = blk_rq_pos(req);
383 break;
384 case REQ_OP_ZONE_RESET_ALL:
385 type = VIRTIO_BLK_T_ZONE_RESET_ALL;
386 break;
387 case REQ_OP_DRV_IN:
388 /*
389 * Out header has already been prepared by the caller (virtblk_get_id()
390 * or virtblk_submit_zone_report()), nothing to do here.
391 */
392 return 0;
393 default:
394 WARN_ON_ONCE(1);
395 return BLK_STS_IOERR;
396 }
397
398 /* Set fields for non-REQ_OP_DRV_IN request types */
399 vbr->in_hdr_len = in_hdr_len;
400 vbr->out_hdr.base.type = cpu_to_virtio32(vdev, type);
401 vbr->out_hdr.base.sector = cpu_to_virtio64(vdev, sector);
402
403 if (type == VIRTIO_BLK_T_DISCARD || type == VIRTIO_BLK_T_WRITE_ZEROES ||
404 type == VIRTIO_BLK_T_SECURE_ERASE) {
405 if (virtblk_setup_discard_write_zeroes_erase(req, unmap))
406 return BLK_STS_RESOURCE;
407 }
408
409 if (type == VIRTIO_BLK_T_CRYPTO_IN || type == VIRTIO_BLK_T_CRYPTO_OUT) {
410 memset(&vbr->out_hdr.crypto_append.msg, 0,
411 sizeof(vbr->out_hdr.crypto_append.msg));
412 vbr->out_hdr.crypto_append.msg.slot =
413 cpu_to_virtio32(vdev,
> 414 blk_crypto_keyslot_index(req->crypt_keyslot));
415 for (i = 0; i < ARRAY_SIZE(vbr->out_hdr.crypto_append.msg.dun); i++) {
416 vbr->out_hdr.crypto_append.msg.dun[i] =
> 417 cpu_to_virtio64(vdev, req->crypt_ctx->bc_dun[i]);
418 }
419 }
420
421 return 0;
422 }
423

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki