Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2571617rdb; Mon, 4 Dec 2023 00:57:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJZm61HijlBfP7xQPgxakHtM2Zq17Umk28KkzgyFCNBNbBLYPlGs3sL16VAL9PU+swxyWn X-Received: by 2002:a05:6830:e04:b0:6d8:74e2:6f39 with SMTP id do4-20020a0568300e0400b006d874e26f39mr3291424otb.53.1701680233719; Mon, 04 Dec 2023 00:57:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701680233; cv=none; d=google.com; s=arc-20160816; b=wfB113iKWk8B6ZcuKt9QCL1rpz0uQO5vuR6ldFpH9F4Xg3NYLxEjO2JxIBsLUoGbm7 zWSe4mDxogFTR1Fmh/Eohmmb0D//cbOtOCRThq+2ZWY6QqhiduDrcmjfb5/xYbw7GlQB /z0IWvZaLE5C3Ozel04axQLMwI7eLqQRPhVuIMLc6ZXZ15uWSnpLlAbLPrxVxjPIjht4 v2FVcTP8Vg4znehYMOmWvoC8xrXfrD3UH/9fxLN/AQaWnsTMDYHNfAxD4ESwaCb70an6 TJ1eE/vpu+RKHXD+cTHkUpmS4sotVwJtxQNLPQ2dE3pjIFighAy+al0/9C++DMFTxEER p1Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=mEEeG5SW1HWlJfDVr2ry+oVd6noQ+BNcBjhwmDcMZD8=; fh=wrVc9Yjar4f2Vn6yYruVkSfo/wqHXsy3H7fBpo8Poao=; b=T8k9CCXeL34PyW/JeOKQGNvyoa6mEAZo6x3rTjpUg56rR3PQO0aXCXRzHJsofxV2er /f80RSzOfpPQvnwvXQzS4lMhEEx4TBFAks3a35xuFJph4kmsRDmCL1HqMneaQqdZ+YRC 8m0pO2dM5xohki0Gl2jtQj+0KEgPc3eqQdNq6RMqQ/t2eqKusIrkq/GliM9xjXnddy46 qe6fQI/NG7s2oYIqHdZSSDbj+mvjy9txGrNxiKv5qhAS51DHdxCLz1Ay51K289iU2eZH SKeK4LtpeJWv8gINlH68QvnHt08q7Q+rpXQOPPe65Y203ZT3eIx6+oi0mAylB6vaz6Kx i4EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=F0QiYzgb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id c35-20020a630d23000000b005c690745520si1201791pgl.743.2023.12.04.00.57.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 00:57:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=F0QiYzgb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D71318063805; Mon, 4 Dec 2023 00:57:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229714AbjLDI4r (ORCPT + 99 others); Mon, 4 Dec 2023 03:56:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231925AbjLDI4j (ORCPT ); Mon, 4 Dec 2023 03:56:39 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8599106 for ; Mon, 4 Dec 2023 00:56:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701680203; x=1733216203; h=date:from:to:cc:subject:message-id:mime-version; bh=07h+TDIWco35hMrY5+69QIXmLUkGTeXbwUV8MFxI21o=; b=F0QiYzgbPlQ3/vpf7VZ78zMtjqJ0BrhqlTz51fdj6Hh0HVcvjMbpwes9 1ex4GyU7Dlye7y5W+c4AM9gMh6ClhzqkNJa7QxSO5lgxJe2QZ2W5VCead hgKn6OO9AlGY4vdTS0fXXp6zwyxcAXWlmap47ziS/EK7+XU1NMKB97FqD U44VewxfcZUFuYVihzthKvSQusQvieNxgCKvkYBz+hiXtqtoVAvi6yD7e xRuEUFmJivwnwo5lkpv+RQSn6Iqn/IHxpZpUMJaTpC+u42EOY4Z2WbKFp LoRB+YY+GV0TVQ87QAeJcNjgEcigN5fhzV7K+k2NSQzI2PVOCvVAtlXk8 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="373136604" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="373136604" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 00:56:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="746769743" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="746769743" Received: from lkp-server02.sh.intel.com (HELO b07ab15da5fe) ([10.239.97.151]) by orsmga006.jf.intel.com with ESMTP; 04 Dec 2023 00:56:40 -0800 Received: from kbuild by b07ab15da5fe with local (Exim 4.96) (envelope-from ) id 1rA4kn-0007bs-1a; Mon, 04 Dec 2023 08:56:37 +0000 Date: Mon, 4 Dec 2023 16:56:35 +0800 From: kernel test robot To: Suwan Kim Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, "Michael S. Tsirkin" , Stefan Hajnoczi , Christoph Hellwig , Max Gurtovoy , Chaitanya Kulkarni Subject: drivers/block/virtio_blk.c:570:68: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 7 Message-ID: <202312041509.DIyvEt9h-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 04 Dec 2023 00:57:11 -0800 (PST) tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 33cc938e65a98f1d29d0a18403dbbee050dcad9a commit: 4e0400525691d0e676dbe002641f9a61261f1e1b virtio-blk: support polling I/O date: 1 year, 6 months ago config: x86_64-buildonly-randconfig-006-20230906 (https://download.01.org/0day-ci/archive/20231204/202312041509.DIyvEt9h-lkp@intel.com/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231204/202312041509.DIyvEt9h-lkp@intel.com/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 | Closes: https://lore.kernel.org/oe-kbuild-all/202312041509.DIyvEt9h-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/block/virtio_blk.c: In function 'init_vq': >> drivers/block/virtio_blk.c:570:68: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 7 [-Wformat-truncation=] 570 | snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%d", i); | ^~ drivers/block/virtio_blk.c:570:58: note: directive argument in the range [-2147483648, 65534] 570 | snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%d", i); | ^~~~~~~~~~~~~ drivers/block/virtio_blk.c:570:17: note: 'snprintf' output between 11 and 21 bytes into a destination of size 16 570 | snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%d", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim +570 drivers/block/virtio_blk.c 511 512 static int init_vq(struct virtio_blk *vblk) 513 { 514 int err; 515 int i; 516 vq_callback_t **callbacks; 517 const char **names; 518 struct virtqueue **vqs; 519 unsigned short num_vqs; 520 unsigned int num_poll_vqs; 521 struct virtio_device *vdev = vblk->vdev; 522 struct irq_affinity desc = { 0, }; 523 524 err = virtio_cread_feature(vdev, VIRTIO_BLK_F_MQ, 525 struct virtio_blk_config, num_queues, 526 &num_vqs); 527 if (err) 528 num_vqs = 1; 529 530 if (!err && !num_vqs) { 531 dev_err(&vdev->dev, "MQ advertised but zero queues reported\n"); 532 return -EINVAL; 533 } 534 535 num_vqs = min_t(unsigned int, 536 min_not_zero(num_request_queues, nr_cpu_ids), 537 num_vqs); 538 539 num_poll_vqs = min_t(unsigned int, poll_queues, num_vqs - 1); 540 541 vblk->io_queues[HCTX_TYPE_DEFAULT] = num_vqs - num_poll_vqs; 542 vblk->io_queues[HCTX_TYPE_READ] = 0; 543 vblk->io_queues[HCTX_TYPE_POLL] = num_poll_vqs; 544 545 dev_info(&vdev->dev, "%d/%d/%d default/read/poll queues\n", 546 vblk->io_queues[HCTX_TYPE_DEFAULT], 547 vblk->io_queues[HCTX_TYPE_READ], 548 vblk->io_queues[HCTX_TYPE_POLL]); 549 550 vblk->vqs = kmalloc_array(num_vqs, sizeof(*vblk->vqs), GFP_KERNEL); 551 if (!vblk->vqs) 552 return -ENOMEM; 553 554 names = kmalloc_array(num_vqs, sizeof(*names), GFP_KERNEL); 555 callbacks = kmalloc_array(num_vqs, sizeof(*callbacks), GFP_KERNEL); 556 vqs = kmalloc_array(num_vqs, sizeof(*vqs), GFP_KERNEL); 557 if (!names || !callbacks || !vqs) { 558 err = -ENOMEM; 559 goto out; 560 } 561 562 for (i = 0; i < num_vqs - num_poll_vqs; i++) { 563 callbacks[i] = virtblk_done; 564 snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req.%d", i); 565 names[i] = vblk->vqs[i].name; 566 } 567 568 for (; i < num_vqs; i++) { 569 callbacks[i] = NULL; > 570 snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%d", i); 571 names[i] = vblk->vqs[i].name; 572 } 573 574 /* Discover virtqueues and write information to configuration. */ 575 err = virtio_find_vqs(vdev, num_vqs, vqs, callbacks, names, &desc); 576 if (err) 577 goto out; 578 579 for (i = 0; i < num_vqs; i++) { 580 spin_lock_init(&vblk->vqs[i].lock); 581 vblk->vqs[i].vq = vqs[i]; 582 } 583 vblk->num_vqs = num_vqs; 584 585 out: 586 kfree(vqs); 587 kfree(callbacks); 588 kfree(names); 589 if (err) 590 kfree(vblk->vqs); 591 return err; 592 } 593 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki