From: kernel test robot <lkp@intel.com>
To: LongPing Wei <weilongping@oppo.com>, axboe@kernel.dk
Cc: oe-kbuild-all@lists.linux.dev, linux-block@vger.kernel.org,
LongPing Wei <weilongping@oppo.com>
Subject: Re: [PATCH] block: fix the initial value of wp_offset for npo2 zone size
Date: Wed, 6 Nov 2024 04:48:16 +0800 [thread overview]
Message-ID: <202411060401.MveGdWg2-lkp@intel.com> (raw)
In-Reply-To: <20241105101120.1207567-1-weilongping@oppo.com>
Hi LongPing,
kernel test robot noticed the following build warnings:
[auto build test WARNING on axboe-block/for-next]
[also build test WARNING on linus/master v6.12-rc6 next-20241105]
[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/LongPing-Wei/block-fix-the-initial-value-of-wp_offset-for-npo2-zone-size/20241105-181423
base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
patch link: https://lore.kernel.org/r/20241105101120.1207567-1-weilongping%40oppo.com
patch subject: [PATCH] block: fix the initial value of wp_offset for npo2 zone size
config: x86_64-rhel-8.3-func (https://download.01.org/0day-ci/archive/20241106/202411060401.MveGdWg2-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/20241106/202411060401.MveGdWg2-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/202411060401.MveGdWg2-lkp@intel.com/
All warnings (new ones prefixed by >>):
block/blk-zoned.c: In function 'disk_get_and_lock_zone_wplug':
>> block/blk-zoned.c:540:56: warning: passing argument 1 of 'bio_offset_from_zone_start' makes pointer from integer without a cast [-Wint-conversion]
540 | zwplug->wp_offset = bio_offset_from_zone_start(sector);
| ^~~~~~
| |
| sector_t {aka long long unsigned int}
In file included from block/blk-zoned.c:15:
include/linux/blkdev.h:1371:63: note: expected 'struct bio *' but argument is of type 'sector_t' {aka 'long long unsigned int'}
1371 | static inline sector_t bio_offset_from_zone_start(struct bio *bio)
| ~~~~~~~~~~~~^~~
vim +/bio_offset_from_zone_start +540 block/blk-zoned.c
494
495 /*
496 * Get a reference on the write plug for the zone containing @sector.
497 * If the plug does not exist, it is allocated and hashed.
498 * Return a pointer to the zone write plug with the plug spinlock held.
499 */
500 static struct blk_zone_wplug *disk_get_and_lock_zone_wplug(struct gendisk *disk,
501 sector_t sector, gfp_t gfp_mask,
502 unsigned long *flags)
503 {
504 unsigned int zno = disk_zone_no(disk, sector);
505 struct blk_zone_wplug *zwplug;
506
507 again:
508 zwplug = disk_get_zone_wplug(disk, sector);
509 if (zwplug) {
510 /*
511 * Check that a BIO completion or a zone reset or finish
512 * operation has not already removed the zone write plug from
513 * the hash table and dropped its reference count. In such case,
514 * we need to get a new plug so start over from the beginning.
515 */
516 spin_lock_irqsave(&zwplug->lock, *flags);
517 if (zwplug->flags & BLK_ZONE_WPLUG_UNHASHED) {
518 spin_unlock_irqrestore(&zwplug->lock, *flags);
519 disk_put_zone_wplug(zwplug);
520 goto again;
521 }
522 return zwplug;
523 }
524
525 /*
526 * Allocate and initialize a zone write plug with an extra reference
527 * so that it is not freed when the zone write plug becomes idle without
528 * the zone being full.
529 */
530 zwplug = mempool_alloc(disk->zone_wplugs_pool, gfp_mask);
531 if (!zwplug)
532 return NULL;
533
534 INIT_HLIST_NODE(&zwplug->node);
535 INIT_LIST_HEAD(&zwplug->link);
536 atomic_set(&zwplug->ref, 2);
537 spin_lock_init(&zwplug->lock);
538 zwplug->flags = 0;
539 zwplug->zone_no = zno;
> 540 zwplug->wp_offset = bio_offset_from_zone_start(sector);
541 bio_list_init(&zwplug->bio_list);
542 INIT_WORK(&zwplug->bio_work, blk_zone_wplug_bio_work);
543 zwplug->disk = disk;
544
545 spin_lock_irqsave(&zwplug->lock, *flags);
546
547 /*
548 * Insert the new zone write plug in the hash table. This can fail only
549 * if another context already inserted a plug. Retry from the beginning
550 * in such case.
551 */
552 if (!disk_insert_zone_wplug(disk, zwplug)) {
553 spin_unlock_irqrestore(&zwplug->lock, *flags);
554 mempool_free(zwplug, disk->zone_wplugs_pool);
555 goto again;
556 }
557
558 return zwplug;
559 }
560
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-11-05 20:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 10:11 [PATCH] block: fix the initial value of wp_offset for npo2 zone size LongPing Wei
2024-11-05 11:07 ` Christoph Hellwig
2024-11-05 20:38 ` kernel test robot
2024-11-05 20:48 ` kernel test robot [this message]
2024-11-05 22:43 ` kernel test robot
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=202411060401.MveGdWg2-lkp@intel.com \
--to=lkp@intel.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=weilongping@oppo.com \
/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).