[hch-block:blkdev.h-includes 15/16] fs/block_dev.c:734:23: error: implicit declaration of function 'bdev_get_integrity'

From: kernel test robot
Date: Sat Jul 24 2021 - 14:57:16 EST


tree: git://git.infradead.org/users/hch/block.git blkdev.h-includes
head: 48f7fda047613ceec07881f14a5eaf1ee19d4433
commit: e7a8094f7da3b6e7c7a853afa0dd9d7e40fafff2 [15/16] block: move integrity handling out of blkdev.h
config: i386-randconfig-s001-20210724 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
git remote add hch-block git://git.infradead.org/users/hch/block.git
git fetch --no-tags hch-block blkdev.h-includes
git checkout e7a8094f7da3b6e7c7a853afa0dd9d7e40fafff2
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

fs/block_dev.c: In function 'bdev_read_page':
>> fs/block_dev.c:734:23: error: implicit declaration of function 'bdev_get_integrity' [-Werror=implicit-function-declaration]
734 | if (!ops->rw_page || bdev_get_integrity(bdev))
| ^~~~~~~~~~~~~~~~~~
In file included from include/linux/blkdev.h:7,
from fs/block_dev.c:16:
At top level:
include/linux/genhd.h:329:12: warning: 'bd_register_pending_holders' defined but not used [-Wunused-function]
329 | static int bd_register_pending_holders(struct gendisk *disk)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors


vim +/bdev_get_integrity +734 fs/block_dev.c

^1da177e4c3f41 Linus Torvalds 2005-04-16 711
47a191fd38ebdd Matthew Wilcox 2014-06-04 712 /**
47a191fd38ebdd Matthew Wilcox 2014-06-04 713 * bdev_read_page() - Start reading a page from a block device
47a191fd38ebdd Matthew Wilcox 2014-06-04 714 * @bdev: The device to read the page from
47a191fd38ebdd Matthew Wilcox 2014-06-04 715 * @sector: The offset on the device to read the page to (need not be aligned)
47a191fd38ebdd Matthew Wilcox 2014-06-04 716 * @page: The page to read
47a191fd38ebdd Matthew Wilcox 2014-06-04 717 *
47a191fd38ebdd Matthew Wilcox 2014-06-04 718 * On entry, the page should be locked. It will be unlocked when the page
47a191fd38ebdd Matthew Wilcox 2014-06-04 719 * has been read. If the block driver implements rw_page synchronously,
47a191fd38ebdd Matthew Wilcox 2014-06-04 720 * that will be true on exit from this function, but it need not be.
47a191fd38ebdd Matthew Wilcox 2014-06-04 721 *
47a191fd38ebdd Matthew Wilcox 2014-06-04 722 * Errors returned by this function are usually "soft", eg out of memory, or
47a191fd38ebdd Matthew Wilcox 2014-06-04 723 * queue full; callers should try a different route to read this page rather
47a191fd38ebdd Matthew Wilcox 2014-06-04 724 * than propagate an error back up the stack.
47a191fd38ebdd Matthew Wilcox 2014-06-04 725 *
47a191fd38ebdd Matthew Wilcox 2014-06-04 726 * Return: negative errno if an error occurs, 0 if submission was successful.
47a191fd38ebdd Matthew Wilcox 2014-06-04 727 */
47a191fd38ebdd Matthew Wilcox 2014-06-04 728 int bdev_read_page(struct block_device *bdev, sector_t sector,
47a191fd38ebdd Matthew Wilcox 2014-06-04 729 struct page *page)
47a191fd38ebdd Matthew Wilcox 2014-06-04 730 {
47a191fd38ebdd Matthew Wilcox 2014-06-04 731 const struct block_device_operations *ops = bdev->bd_disk->fops;
2e6edc95382cc3 Dan Williams 2015-11-19 732 int result = -EOPNOTSUPP;
2e6edc95382cc3 Dan Williams 2015-11-19 733
f68eb1e71a9276 Vishal Verma 2015-05-12 @734 if (!ops->rw_page || bdev_get_integrity(bdev))
2e6edc95382cc3 Dan Williams 2015-11-19 735 return result;
2e6edc95382cc3 Dan Williams 2015-11-19 736
e556f6ba10f0f3 Christoph Hellwig 2020-06-26 737 result = blk_queue_enter(bdev->bd_disk->queue, 0);
2e6edc95382cc3 Dan Williams 2015-11-19 738 if (result)
2e6edc95382cc3 Dan Williams 2015-11-19 739 return result;
3f289dcb4b2654 Tejun Heo 2018-07-18 740 result = ops->rw_page(bdev, sector + get_start_sect(bdev), page,
3f289dcb4b2654 Tejun Heo 2018-07-18 741 REQ_OP_READ);
e556f6ba10f0f3 Christoph Hellwig 2020-06-26 742 blk_queue_exit(bdev->bd_disk->queue);
2e6edc95382cc3 Dan Williams 2015-11-19 743 return result;
47a191fd38ebdd Matthew Wilcox 2014-06-04 744 }
47a191fd38ebdd Matthew Wilcox 2014-06-04 745

:::::: The code at line 734 was first introduced by commit
:::::: f68eb1e71a92765ffd8eb68466a41b48f2fbba04 fs/block_dev.c: skip rw_page if bdev has integrity

:::::: TO: Vishal Verma <vishal.l.verma@xxxxxxxxx>
:::::: CC: Dan Williams <dan.j.williams@xxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip