* [block:for-5.14/block 124/124] drivers/block/loop.c:1343:23: warning: variable 'bdev' set but not used
@ 2021-06-25 1:10 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-25 1:10 UTC (permalink / raw
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 8689 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-5.14/block
head: 0384264ea8a39bd98c9a3158060565f650c056a6
commit: 0384264ea8a39bd98c9a3158060565f650c056a6 [124/124] block: pass a gendisk to bdev_disk_changed
config: x86_64-randconfig-a001-20210622 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 7c8a507272587f181ec29401453949ebcd8fec65)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?id=0384264ea8a39bd98c9a3158060565f650c056a6
git remote add block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
git fetch --no-tags block for-5.14/block
git checkout 0384264ea8a39bd98c9a3158060565f650c056a6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/block/loop.c:1343:23: warning: variable 'bdev' set but not used [-Wunused-but-set-variable]
struct block_device *bdev;
^
1 warning generated.
vim +/bdev +1343 drivers/block/loop.c
a2505b799a496b7 Jan Kara 2018-11-08 1338
^1da177e4c3f415 Linus Torvalds 2005-04-16 1339 static int
^1da177e4c3f415 Linus Torvalds 2005-04-16 1340 loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
^1da177e4c3f415 Linus Torvalds 2005-04-16 1341 {
^1da177e4c3f415 Linus Torvalds 2005-04-16 1342 int err;
85b0a54a82e4fbc Jan Kara 2018-11-08 @1343 struct block_device *bdev;
0c3796c24459812 Martijn Coenen 2020-05-13 1344 kuid_t uid = current_uid();
faf1d25440d6ad0 Martijn Coenen 2020-05-13 1345 int prev_lo_flags;
85b0a54a82e4fbc Jan Kara 2018-11-08 1346 bool partscan = false;
0c3796c24459812 Martijn Coenen 2020-05-13 1347 bool size_changed = false;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1348
6cc8e7430801fa2 Pavel Tatashin 2021-01-26 1349 err = mutex_lock_killable(&lo->lo_mutex);
550df5fdacff942 Jan Kara 2018-11-08 1350 if (err)
550df5fdacff942 Jan Kara 2018-11-08 1351 return err;
b0fafa816ece008 David Howells 2008-11-14 1352 if (lo->lo_encrypt_key_size &&
e4849737f76c876 Eric W. Biederman 2012-02-11 1353 !uid_eq(lo->lo_key_owner, uid) &&
550df5fdacff942 Jan Kara 2018-11-08 1354 !capable(CAP_SYS_ADMIN)) {
550df5fdacff942 Jan Kara 2018-11-08 1355 err = -EPERM;
550df5fdacff942 Jan Kara 2018-11-08 1356 goto out_unlock;
550df5fdacff942 Jan Kara 2018-11-08 1357 }
550df5fdacff942 Jan Kara 2018-11-08 1358 if (lo->lo_state != Lo_bound) {
550df5fdacff942 Jan Kara 2018-11-08 1359 err = -ENXIO;
550df5fdacff942 Jan Kara 2018-11-08 1360 goto out_unlock;
550df5fdacff942 Jan Kara 2018-11-08 1361 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 1362
5db470e229e22b7 Jaegeuk Kim 2019-01-09 1363 if (lo->lo_offset != info->lo_offset ||
5db470e229e22b7 Jaegeuk Kim 2019-01-09 1364 lo->lo_sizelimit != info->lo_sizelimit) {
0c3796c24459812 Martijn Coenen 2020-05-13 1365 size_changed = true;
5db470e229e22b7 Jaegeuk Kim 2019-01-09 1366 sync_blockdev(lo->lo_device);
f4bd34b139a3fa2 Zheng Bin 2020-06-18 1367 invalidate_bdev(lo->lo_device);
5db470e229e22b7 Jaegeuk Kim 2019-01-09 1368 }
5db470e229e22b7 Jaegeuk Kim 2019-01-09 1369
ecdd09597a57251 Ming Lei 2017-02-11 1370 /* I/O need to be drained during transfer transition */
ecdd09597a57251 Ming Lei 2017-02-11 1371 blk_mq_freeze_queue(lo->lo_queue);
ecdd09597a57251 Ming Lei 2017-02-11 1372
0c3796c24459812 Martijn Coenen 2020-05-13 1373 if (size_changed && lo->lo_device->bd_inode->i_mapping->nrpages) {
f4bd34b139a3fa2 Zheng Bin 2020-06-18 1374 /* If any pages were dirtied after invalidate_bdev(), try again */
5db470e229e22b7 Jaegeuk Kim 2019-01-09 1375 err = -EAGAIN;
5db470e229e22b7 Jaegeuk Kim 2019-01-09 1376 pr_warn("%s: loop%d (%s) has still dirty pages (nrpages=%lu)\n",
5db470e229e22b7 Jaegeuk Kim 2019-01-09 1377 __func__, lo->lo_number, lo->lo_file_name,
5db470e229e22b7 Jaegeuk Kim 2019-01-09 1378 lo->lo_device->bd_inode->i_mapping->nrpages);
5db470e229e22b7 Jaegeuk Kim 2019-01-09 1379 goto out_unfreeze;
5db470e229e22b7 Jaegeuk Kim 2019-01-09 1380 }
541c742a7559eb6 Guo Chao 2013-02-21 1381
faf1d25440d6ad0 Martijn Coenen 2020-05-13 1382 prev_lo_flags = lo->lo_flags;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1383
0c3796c24459812 Martijn Coenen 2020-05-13 1384 err = loop_set_status_from_info(lo, info);
0c3796c24459812 Martijn Coenen 2020-05-13 1385 if (err)
0c3796c24459812 Martijn Coenen 2020-05-13 1386 goto out_unfreeze;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1387
faf1d25440d6ad0 Martijn Coenen 2020-05-13 1388 /* Mask out flags that can't be set using LOOP_SET_STATUS. */
6ac92fb5cdff6e5 Martijn Coenen 2020-06-04 1389 lo->lo_flags &= LOOP_SET_STATUS_SETTABLE_FLAGS;
faf1d25440d6ad0 Martijn Coenen 2020-05-13 1390 /* For those flags, use the previous values instead */
faf1d25440d6ad0 Martijn Coenen 2020-05-13 1391 lo->lo_flags |= prev_lo_flags & ~LOOP_SET_STATUS_SETTABLE_FLAGS;
faf1d25440d6ad0 Martijn Coenen 2020-05-13 1392 /* For flags that can't be cleared, use previous values too */
faf1d25440d6ad0 Martijn Coenen 2020-05-13 1393 lo->lo_flags |= prev_lo_flags & ~LOOP_SET_STATUS_CLEARABLE_FLAGS;
96c5865559cee0f David Woodhouse 2008-02-06 1394
b0bd158dd630bd4 Martijn Coenen 2020-05-13 1395 if (size_changed) {
b0bd158dd630bd4 Martijn Coenen 2020-05-13 1396 loff_t new_size = get_size(lo->lo_offset, lo->lo_sizelimit,
b0bd158dd630bd4 Martijn Coenen 2020-05-13 1397 lo->lo_backing_file);
b0bd158dd630bd4 Martijn Coenen 2020-05-13 1398 loop_set_size(lo, new_size);
^1da177e4c3f415 Linus Torvalds 2005-04-16 1399 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 1400
7c5014b0987a30e Martijn Coenen 2020-05-13 1401 loop_config_discard(lo);
7c5014b0987a30e Martijn Coenen 2020-05-13 1402
2e5ab5f379f96a6 Ming Lei 2015-08-17 1403 /* update dio if lo_offset or transfer is changed */
2e5ab5f379f96a6 Ming Lei 2015-08-17 1404 __loop_update_dio(lo, lo->use_dio);
2e5ab5f379f96a6 Ming Lei 2015-08-17 1405
550df5fdacff942 Jan Kara 2018-11-08 1406 out_unfreeze:
ecdd09597a57251 Ming Lei 2017-02-11 1407 blk_mq_unfreeze_queue(lo->lo_queue);
e02898b423802b1 Omar Sandoval 2017-03-01 1408
faf1d25440d6ad0 Martijn Coenen 2020-05-13 1409 if (!err && (lo->lo_flags & LO_FLAGS_PARTSCAN) &&
faf1d25440d6ad0 Martijn Coenen 2020-05-13 1410 !(prev_lo_flags & LO_FLAGS_PARTSCAN)) {
e02898b423802b1 Omar Sandoval 2017-03-01 1411 lo->lo_disk->flags &= ~GENHD_FL_NO_PART_SCAN;
85b0a54a82e4fbc Jan Kara 2018-11-08 1412 bdev = lo->lo_device;
85b0a54a82e4fbc Jan Kara 2018-11-08 1413 partscan = true;
e02898b423802b1 Omar Sandoval 2017-03-01 1414 }
550df5fdacff942 Jan Kara 2018-11-08 1415 out_unlock:
6cc8e7430801fa2 Pavel Tatashin 2021-01-26 1416 mutex_unlock(&lo->lo_mutex);
85b0a54a82e4fbc Jan Kara 2018-11-08 1417 if (partscan)
0384264ea8a39bd Christoph Hellwig 2021-06-24 1418 loop_reread_partitions(lo);
e02898b423802b1 Omar Sandoval 2017-03-01 1419
ecdd09597a57251 Ming Lei 2017-02-11 1420 return err;
^1da177e4c3f415 Linus Torvalds 2005-04-16 1421 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 1422
:::::: The code at line 1343 was first introduced by commit
:::::: 85b0a54a82e4fbceeb1aebb7cb6909edd1a24668 loop: Move loop_reread_partitions() out of loop_ctl_mutex
:::::: TO: Jan Kara <jack@suse.cz>
:::::: CC: Jens Axboe <axboe@kernel.dk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 44736 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-25 1:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-25 1:10 [block:for-5.14/block 124/124] drivers/block/loop.c:1343:23: warning: variable 'bdev' set but not used kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.