Messages in this thread | | | Date | Tue, 27 Jul 2021 19:43:03 +0800 | From | kernel test robot <> | Subject | [hch-misc:dax-support-cleanups 2/10] drivers/dax/super.c:168:6: error: redefinition of 'bdev_dax_supported' |
| |
tree: git://git.infradead.org/users/hch/misc.git dax-support-cleanups head: 37a8092dc083090f4fbd6a7699561dd959f1e2b8 commit: c9ee3712f2faa1229ec35bc62c0e34c9a81a3589 [2/10] dax: rename __bdev_dax_supported to bdev_dax_supported config: powerpc64-randconfig-s032-20210727 (attached as .config) compiler: powerpc-linux-gcc (GCC) 10.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.3-341-g8af24329-dirty git remote add hch-misc git://git.infradead.org/users/hch/misc.git git fetch --no-tags hch-misc dax-support-cleanups git checkout c9ee3712f2faa1229ec35bc62c0e34c9a81a3589 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=powerpc SHELL=/bin/bash drivers/dax/
If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/dax/super.c:70:6: warning: no previous prototype for '__generic_fsdax_supported' [-Wmissing-prototypes] 70 | bool __generic_fsdax_supported(struct dax_device *dax_dev, | ^~~~~~~~~~~~~~~~~~~~~~~~~ >> drivers/dax/super.c:168:6: error: redefinition of 'bdev_dax_supported' 168 | bool bdev_dax_supported(struct block_device *bdev, int blocksize) | ^~~~~~~~~~~~~~~~~~ In file included from drivers/dax/super.c:16: include/linux/dax.h:151:20: note: previous definition of 'bdev_dax_supported' was here 151 | static inline bool bdev_dax_supported(struct block_device *bdev, | ^~~~~~~~~~~~~~~~~~ drivers/dax/super.c:449:6: warning: no previous prototype for 'run_dax' [-Wmissing-prototypes] 449 | void run_dax(struct dax_device *dax_dev) | ^~~~~~~
vim +/bdev_dax_supported +168 drivers/dax/super.c
69 > 70 bool __generic_fsdax_supported(struct dax_device *dax_dev, 71 struct block_device *bdev, int blocksize, sector_t start, 72 sector_t sectors) 73 { 74 bool dax_enabled = false; 75 pgoff_t pgoff, pgoff_end; 76 char buf[BDEVNAME_SIZE]; 77 void *kaddr, *end_kaddr; 78 pfn_t pfn, end_pfn; 79 sector_t last_page; 80 long len, len2; 81 int err, id; 82 83 if (blocksize != PAGE_SIZE) { 84 pr_info("%s: error: unsupported blocksize for dax\n", 85 bdevname(bdev, buf)); 86 return false; 87 } 88 89 if (!dax_dev) { 90 pr_debug("%s: error: dax unsupported by block device\n", 91 bdevname(bdev, buf)); 92 return false; 93 } 94 95 err = bdev_dax_pgoff(bdev, start, PAGE_SIZE, &pgoff); 96 if (err) { 97 pr_info("%s: error: unaligned partition for dax\n", 98 bdevname(bdev, buf)); 99 return false; 100 } 101 102 last_page = PFN_DOWN((start + sectors - 1) * 512) * PAGE_SIZE / 512; 103 err = bdev_dax_pgoff(bdev, last_page, PAGE_SIZE, &pgoff_end); 104 if (err) { 105 pr_info("%s: error: unaligned partition for dax\n", 106 bdevname(bdev, buf)); 107 return false; 108 } 109 110 id = dax_read_lock(); 111 len = dax_direct_access(dax_dev, pgoff, 1, &kaddr, &pfn); 112 len2 = dax_direct_access(dax_dev, pgoff_end, 1, &end_kaddr, &end_pfn); 113 114 if (len < 1 || len2 < 1) { 115 pr_info("%s: error: dax access failed (%ld)\n", 116 bdevname(bdev, buf), len < 1 ? len : len2); 117 dax_read_unlock(id); 118 return false; 119 } 120 121 if (IS_ENABLED(CONFIG_FS_DAX_LIMITED) && pfn_t_special(pfn)) { 122 /* 123 * An arch that has enabled the pmem api should also 124 * have its drivers support pfn_t_devmap() 125 * 126 * This is a developer warning and should not trigger in 127 * production. dax_flush() will crash since it depends 128 * on being able to do (page_address(pfn_to_page())). 129 */ 130 WARN_ON(IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API)); 131 dax_enabled = true; 132 } else if (pfn_t_devmap(pfn) && pfn_t_devmap(end_pfn)) { 133 struct dev_pagemap *pgmap, *end_pgmap; 134 135 pgmap = get_dev_pagemap(pfn_t_to_pfn(pfn), NULL); 136 end_pgmap = get_dev_pagemap(pfn_t_to_pfn(end_pfn), NULL); 137 if (pgmap && pgmap == end_pgmap && pgmap->type == MEMORY_DEVICE_FS_DAX 138 && pfn_t_to_page(pfn)->pgmap == pgmap 139 && pfn_t_to_page(end_pfn)->pgmap == pgmap 140 && pfn_t_to_pfn(pfn) == PHYS_PFN(__pa(kaddr)) 141 && pfn_t_to_pfn(end_pfn) == PHYS_PFN(__pa(end_kaddr))) 142 dax_enabled = true; 143 put_dev_pagemap(pgmap); 144 put_dev_pagemap(end_pgmap); 145 146 } 147 dax_read_unlock(id); 148 149 if (!dax_enabled) { 150 pr_info("%s: error: dax support not enabled\n", 151 bdevname(bdev, buf)); 152 return false; 153 } 154 return true; 155 } 156 EXPORT_SYMBOL_GPL(__generic_fsdax_supported); 157 158 /** 159 * bdev_dax_supported() - Check if the device supports dax for filesystem 160 * @bdev: block device to check 161 * @blocksize: The block size of the device 162 * 163 * This is a library function for filesystems to check if the block device 164 * can be mounted with dax option. 165 * 166 * Return: true if supported, false if unsupported 167 */ > 168 bool bdev_dax_supported(struct block_device *bdev, int blocksize) 169 { 170 struct dax_device *dax_dev; 171 struct request_queue *q; 172 bool ret; 173 int id; 174 175 q = bdev_get_queue(bdev); 176 if (!q || !blk_queue_dax(q)) { 177 pr_info("%pg: error: request queue doesn't support dax\n", bdev); 178 return false; 179 } 180 181 dax_dev = dax_get_by_host(bdev->bd_disk->disk_name); 182 if (!dax_dev) { 183 pr_info("%pg: error: device does not support dax\n", bdev); 184 return false; 185 } 186 187 id = dax_read_lock(); 188 ret = dax_supported(dax_dev, bdev, blocksize, 0, 189 i_size_read(bdev->bd_inode) / 512); 190 dax_read_unlock(id); 191 192 put_dax(dax_dev); 193 194 return ret; 195 } 196 EXPORT_SYMBOL_GPL(bdev_dax_supported); 197 #endif 198
--- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org [unhandled content-type:application/gzip] | |