From: kernel test robot <lkp@intel.com>
To: Nitesh Shetty <nj.shetty@samsung.com>,
Jens Axboe <axboe@kernel.dk>, Jonathan Corbet <corbet@lwn.net>,
Alasdair Kergon <agk@redhat.com>,
Mike Snitzer <snitzer@kernel.org>,
dm-devel@redhat.com, Keith Busch <kbusch@kernel.org>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <kch@nvidia.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
martin.petersen@oracle.com, mcgrof@kernel.org,
dlemoal@kernel.org, gost.dev@samsung.com,
Nitesh Shetty <nj.shetty@samsung.com>,
Damien Le Moal <damien.lemoal@opensource.wdc.com>,
Anuj Gupta <anuj20.g@samsung.com>,
Vincent Fu <vincent.fu@samsung.com>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, linux-nvme@lists.infradead.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v14 11/11] null_blk: add support for copy offload
Date: Sat, 12 Aug 2023 01:16:44 +0800 [thread overview]
Message-ID: <202308120029.elW3y1RM-lkp@intel.com> (raw)
In-Reply-To: <20230811105300.15889-12-nj.shetty@samsung.com>
Hi Nitesh,
kernel test robot noticed the following build warnings:
[auto build test WARNING on f7dc24b3413851109c4047b22997bd0d95ed52a2]
url: https://github.com/intel-lab-lkp/linux/commits/Nitesh-Shetty/block-Introduce-queue-limits-and-sysfs-for-copy-offload-support/20230811-192259
base: f7dc24b3413851109c4047b22997bd0d95ed52a2
patch link: https://lore.kernel.org/r/20230811105300.15889-12-nj.shetty%40samsung.com
patch subject: [PATCH v14 11/11] null_blk: add support for copy offload
config: hexagon-randconfig-r032-20230811 (https://download.01.org/0day-ci/archive/20230812/202308120029.elW3y1RM-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230812/202308120029.elW3y1RM-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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308120029.elW3y1RM-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/block/null_blk/main.c:12:
In file included from drivers/block/null_blk/null_blk.h:8:
In file included from include/linux/blkdev.h:9:
In file included from include/linux/blk_types.h:10:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:12:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:337:
include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
547 | val = __raw_readb(PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
| ^
In file included from drivers/block/null_blk/main.c:12:
In file included from drivers/block/null_blk/null_blk.h:8:
In file included from include/linux/blkdev.h:9:
In file included from include/linux/blk_types.h:10:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:12:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:337:
include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
| ^
In file included from drivers/block/null_blk/main.c:12:
In file included from drivers/block/null_blk/null_blk.h:8:
In file included from include/linux/blkdev.h:9:
In file included from include/linux/blk_types.h:10:
In file included from include/linux/bvec.h:10:
In file included from include/linux/highmem.h:12:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:337:
include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
584 | __raw_writeb(value, PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
>> drivers/block/null_blk/main.c:1303:2: warning: variable 'sector_in' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
1303 | __rq_for_each_bio(bio, req) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/blk-mq.h:1008:6: note: expanded from macro '__rq_for_each_bio'
1008 | if ((rq->bio)) \
| ^~~~~~~~~
drivers/block/null_blk/main.c:1316:8: note: uninitialized use occurs here
1316 | sector_in << SECTOR_SHIFT, rem);
| ^~~~~~~~~
drivers/block/null_blk/main.c:1303:2: note: remove the 'if' if its condition is always true
1303 | __rq_for_each_bio(bio, req) {
| ^
include/linux/blk-mq.h:1008:2: note: expanded from macro '__rq_for_each_bio'
1008 | if ((rq->bio)) \
| ^
drivers/block/null_blk/main.c:1287:20: note: initialize the variable 'sector_in' to silence this warning
1287 | sector_t sector_in, sector_out;
| ^
| = 0
>> drivers/block/null_blk/main.c:1303:2: warning: variable 'sector_out' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
1303 | __rq_for_each_bio(bio, req) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/blk-mq.h:1008:6: note: expanded from macro '__rq_for_each_bio'
1008 | if ((rq->bio)) \
| ^~~~~~~~~
drivers/block/null_blk/main.c:1315:27: note: uninitialized use occurs here
1315 | trace_nullb_copy_op(req, sector_out << SECTOR_SHIFT,
| ^~~~~~~~~~
drivers/block/null_blk/main.c:1303:2: note: remove the 'if' if its condition is always true
1303 | __rq_for_each_bio(bio, req) {
| ^
include/linux/blk-mq.h:1008:2: note: expanded from macro '__rq_for_each_bio'
1008 | if ((rq->bio)) \
| ^
drivers/block/null_blk/main.c:1287:32: note: initialize the variable 'sector_out' to silence this warning
1287 | sector_t sector_in, sector_out;
| ^
| = 0
8 warnings generated.
vim +1303 drivers/block/null_blk/main.c
1283
1284 static inline int nullb_setup_copy(struct nullb *nullb, struct request *req,
1285 bool is_fua)
1286 {
1287 sector_t sector_in, sector_out;
1288 loff_t offset_in, offset_out;
1289 void *in, *out;
1290 ssize_t chunk, rem = 0;
1291 struct bio *bio;
1292 struct nullb_page *t_page_in, *t_page_out;
1293 u16 seg = 1;
1294 int status = -EIO;
1295
1296 if (blk_rq_nr_phys_segments(req) != COPY_MAX_SEGMENTS)
1297 return status;
1298
1299 /*
1300 * First bio contains information about source and last bio contains
1301 * information about destination.
1302 */
> 1303 __rq_for_each_bio(bio, req) {
1304 if (seg == blk_rq_nr_phys_segments(req)) {
1305 sector_out = bio->bi_iter.bi_sector;
1306 if (rem != bio->bi_iter.bi_size)
1307 return status;
1308 } else {
1309 sector_in = bio->bi_iter.bi_sector;
1310 rem = bio->bi_iter.bi_size;
1311 }
1312 seg++;
1313 }
1314
1315 trace_nullb_copy_op(req, sector_out << SECTOR_SHIFT,
1316 sector_in << SECTOR_SHIFT, rem);
1317
1318 spin_lock_irq(&nullb->lock);
1319 while (rem > 0) {
1320 chunk = min_t(size_t, nullb->dev->blocksize, rem);
1321 offset_in = (sector_in & SECTOR_MASK) << SECTOR_SHIFT;
1322 offset_out = (sector_out & SECTOR_MASK) << SECTOR_SHIFT;
1323
1324 if (null_cache_active(nullb) && !is_fua)
1325 null_make_cache_space(nullb, PAGE_SIZE);
1326
1327 t_page_in = null_lookup_page(nullb, sector_in, false,
1328 !null_cache_active(nullb));
1329 if (!t_page_in)
1330 goto err;
1331 t_page_out = null_insert_page(nullb, sector_out,
1332 !null_cache_active(nullb) ||
1333 is_fua);
1334 if (!t_page_out)
1335 goto err;
1336
1337 in = kmap_local_page(t_page_in->page);
1338 out = kmap_local_page(t_page_out->page);
1339
1340 memcpy(out + offset_out, in + offset_in, chunk);
1341 kunmap_local(out);
1342 kunmap_local(in);
1343 __set_bit(sector_out & SECTOR_MASK, t_page_out->bitmap);
1344
1345 if (is_fua)
1346 null_free_sector(nullb, sector_out, true);
1347
1348 rem -= chunk;
1349 sector_in += chunk >> SECTOR_SHIFT;
1350 sector_out += chunk >> SECTOR_SHIFT;
1351 }
1352
1353 status = 0;
1354 err:
1355 spin_unlock_irq(&nullb->lock);
1356 return status;
1357 }
1358
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2023-08-11 17:16 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230811105627epcas5p1aa1ef0e58bcd0fc05a072c8b40dcfb96@epcas5p1.samsung.com>
2023-08-11 10:52 ` [PATCH v14 00/11] Implement copy offload support Nitesh Shetty
[not found] ` <CGME20230811105638epcas5p4db95584b6a432ea4b8b93e060a95e5f1@epcas5p4.samsung.com>
2023-08-11 10:52 ` [PATCH v14 01/11] block: Introduce queue limits and sysfs for copy-offload support Nitesh Shetty
2023-08-11 21:56 ` [dm-devel] " Bart Van Assche
2023-08-14 10:35 ` Nitesh Shetty
[not found] ` <CGME20230811105648epcas5p3ae8b8f6ed341e2aa253e8b4de8920a4d@epcas5p3.samsung.com>
2023-08-11 10:52 ` [PATCH v14 02/11] Add infrastructure for copy offload in block and request layer Nitesh Shetty
2023-08-11 21:25 ` [dm-devel] " Bart Van Assche
2023-08-14 12:18 ` Nitesh Shetty
2023-08-14 14:26 ` Bart Van Assche
2023-08-15 7:50 ` Nitesh Shetty
2023-08-11 21:58 ` Bart Van Assche
2023-08-14 12:09 ` Nitesh Shetty
[not found] ` <CGME20230811105659epcas5p1982eeaeb580c4cb9b23a29270945be08@epcas5p1.samsung.com>
2023-08-11 10:52 ` [PATCH v14 03/11] block: add copy offload support Nitesh Shetty
2023-08-11 21:33 ` [dm-devel] " Bart Van Assche
2023-08-14 17:01 ` Nitesh Shetty
2023-08-11 22:06 ` Bart Van Assche
2023-08-14 10:30 ` Nitesh Shetty
[not found] ` <CGME20230811105713epcas5p3b5323a0c553006e60671dde6c72fc4c6@epcas5p3.samsung.com>
2023-08-11 10:52 ` [PATCH v14 04/11] block: add emulation for copy Nitesh Shetty
2023-08-11 22:11 ` [dm-devel] " Bart Van Assche
2023-08-14 16:58 ` Nitesh Shetty
[not found] ` <CGME20230811105723epcas5p468fa65dc9c5bea39d40359ce55bcd9aa@epcas5p4.samsung.com>
2023-08-11 10:52 ` [PATCH v14 05/11] fs/read_write: Enable copy_file_range for block device Nitesh Shetty
[not found] ` <CGME20230811105734epcas5p1b465394a301ba85f2c52ed7fde334f52@epcas5p1.samsung.com>
2023-08-11 10:52 ` [PATCH v14 06/11] fs, block: copy_file_range for def_blk_ops for direct " Nitesh Shetty
[not found] ` <CGME20230811105745epcas5p451c58384792038c13e9891fb2680050b@epcas5p4.samsung.com>
2023-08-11 10:52 ` [PATCH v14 07/11] nvme: add copy offload support Nitesh Shetty
2023-08-11 23:39 ` kernel test robot
[not found] ` <CGME20230811105756epcas5p46a7e3f00c33e912e76848c989fc8eac2@epcas5p4.samsung.com>
2023-08-11 10:52 ` [PATCH v14 08/11] nvmet: add copy command support for bdev and file ns Nitesh Shetty
[not found] ` <CGME20230811105808epcas5p4a9f9573d15f642a73bac46153bb935d2@epcas5p4.samsung.com>
2023-08-11 10:52 ` [PATCH v14 09/11] dm: Add support for copy offload Nitesh Shetty
[not found] ` <CGME20230811105819epcas5p40ddff0991c70b6d80d516dfe055bd673@epcas5p4.samsung.com>
2023-08-11 10:52 ` [PATCH v14 10/11] dm: Enable copy offload for dm-linear target Nitesh Shetty
[not found] ` <CGME20230811105830epcas5p37a477e5e7b006613549647bebdf4d028@epcas5p3.samsung.com>
2023-08-11 10:52 ` [PATCH v14 11/11] null_blk: add support for copy offload Nitesh Shetty
2023-08-11 17:16 ` kernel test robot [this message]
2023-08-11 21:15 ` kernel test robot
2023-08-11 21:50 ` [dm-devel] [PATCH v14 00/11] Implement copy offload support Bart Van Assche
2023-08-14 16:55 ` Nitesh Shetty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202308120029.elW3y1RM-lkp@intel.com \
--to=lkp@intel.com \
--cc=agk@redhat.com \
--cc=anuj20.g@samsung.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=corbet@lwn.net \
--cc=damien.lemoal@opensource.wdc.com \
--cc=dlemoal@kernel.org \
--cc=dm-devel@redhat.com \
--cc=gost.dev@samsung.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=martin.petersen@oracle.com \
--cc=mcgrof@kernel.org \
--cc=nj.shetty@samsung.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=sagi@grimberg.me \
--cc=snitzer@kernel.org \
--cc=vincent.fu@samsung.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).