Linux block layer
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yu Kuai <yukuai1@huaweicloud.com>,
	hch@lst.de, axboe@kernel.dk, brauner@kernel.org, hare@suse.de,
	dsterba@suse.com, jinpu.wang@ionos.com
Cc: oe-kbuild-all@lists.linux.dev, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org, yukuai3@huawei.com,
	yukuai1@huaweicloud.com, yi.zhang@huawei.com,
	yangerkun@huawei.com
Subject: Re: [PATCH -next] block: fix wrong mode for blkdev_get_by_dev() from disk_scan_partitions()
Date: Sat, 17 Jun 2023 20:25:56 +0800	[thread overview]
Message-ID: <202306172040.1dllc8rx-lkp@intel.com> (raw)
In-Reply-To: <20230617103813.3708374-1-yukuai1@huaweicloud.com>

Hi Yu,

kernel test robot noticed the following build errors:

[auto build test ERROR on next-20230616]

url:    https://github.com/intel-lab-lkp/linux/commits/Yu-Kuai/block-fix-wrong-mode-for-blkdev_get_by_dev-from-disk_scan_partitions/20230617-184451
base:   next-20230616
patch link:    https://lore.kernel.org/r/20230617103813.3708374-1-yukuai1%40huaweicloud.com
patch subject: [PATCH -next] block: fix wrong mode for blkdev_get_by_dev() from disk_scan_partitions()
config: alpha-randconfig-r036-20230617 (https://download.01.org/0day-ci/archive/20230617/202306172040.1dllc8rx-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230617/202306172040.1dllc8rx-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/202306172040.1dllc8rx-lkp@intel.com/

All errors (new ones prefixed by >>):

   block/genhd.c: In function 'disk_scan_partitions':
>> block/genhd.c:369:59: error: 'FMODE_EXCL' undeclared (first use in this function); did you mean 'FMODE_EXEC'?
     369 |         bdev = blkdev_get_by_dev(disk_devt(disk), mode & ~FMODE_EXCL, NULL,
         |                                                           ^~~~~~~~~~
         |                                                           FMODE_EXEC
   block/genhd.c:369:59: note: each undeclared identifier is reported only once for each function it appears in


vim +369 block/genhd.c

   342	
   343	int disk_scan_partitions(struct gendisk *disk, blk_mode_t mode)
   344	{
   345		struct block_device *bdev;
   346		int ret = 0;
   347	
   348		if (disk->flags & (GENHD_FL_NO_PART | GENHD_FL_HIDDEN))
   349			return -EINVAL;
   350		if (test_bit(GD_SUPPRESS_PART_SCAN, &disk->state))
   351			return -EINVAL;
   352		if (disk->open_partitions)
   353			return -EBUSY;
   354	
   355		/*
   356		 * If the device is opened exclusively by current thread already, it's
   357		 * safe to scan partitons, otherwise, use bd_prepare_to_claim() to
   358		 * synchronize with other exclusive openers and other partition
   359		 * scanners.
   360		 */
   361		if (!(mode & BLK_OPEN_EXCL)) {
   362			ret = bd_prepare_to_claim(disk->part0, disk_scan_partitions,
   363						  NULL);
   364			if (ret)
   365				return ret;
   366		}
   367	
   368		set_bit(GD_NEED_PART_SCAN, &disk->state);
 > 369		bdev = blkdev_get_by_dev(disk_devt(disk), mode & ~FMODE_EXCL, NULL,
   370					 NULL);
   371		if (IS_ERR(bdev))
   372			ret =  PTR_ERR(bdev);
   373		else
   374			blkdev_put(bdev, NULL);
   375	
   376		/*
   377		 * If blkdev_get_by_dev() failed early, GD_NEED_PART_SCAN is still set,
   378		 * and this will cause that re-assemble partitioned raid device will
   379		 * creat partition for underlying disk.
   380		 */
   381		clear_bit(GD_NEED_PART_SCAN, &disk->state);
   382		if (!(mode & BLK_OPEN_EXCL))
   383			bd_abort_claiming(disk->part0, disk_scan_partitions);
   384		return ret;
   385	}
   386	

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

  reply	other threads:[~2023-06-17 12:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-17 10:38 [PATCH -next] block: fix wrong mode for blkdev_get_by_dev() from disk_scan_partitions() Yu Kuai
2023-06-17 12:25 ` kernel test robot [this message]
2023-06-18  5:59   ` Yu Kuai
2023-06-17 12:28 ` 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=202306172040.1dllc8rx-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=dsterba@suse.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jinpu.wang@ionos.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.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