tree:
https://github.com/rhvgoyal/linux virtiofs-dax-5.8
head: b779919ca8c764c6664523cba2f8dc7fdb4b29d8
commit: 2166ed84f03139e5d48f07fc7de570c9188cbff9 [10/20] fuse,virtiofs: Keep a list of
free dax memory ranges
config: microblaze-randconfig-r012-20200717 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
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
git checkout 2166ed84f03139e5d48f07fc7de570c9188cbff9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
fs/fuse/inode.c: In function 'fuse_dax_mem_range_init':
> fs/fuse/inode.c:632:14: warning: variable 'phys_addr' set
but not used [-Wunused-but-set-variable]
632 | phys_addr_t phys_addr;
| ^~~~~~~~~
vim +/phys_addr +632 fs/fuse/inode.c
622
623 #ifdef CONFIG_FS_DAX
624 static int fuse_dax_mem_range_init(struct fuse_conn *fc,
625 struct dax_device *dax_dev)
626 {
627 long nr_pages, nr_ranges;
628 void *kaddr;
629 pfn_t pfn;
630 struct fuse_dax_mapping *range;
631 LIST_HEAD(mem_ranges);
632 phys_addr_t phys_addr;
633 int ret = 0, id;
634 size_t dax_size = -1;
635 unsigned long i;
636
637 id = dax_read_lock();
638 nr_pages = dax_direct_access(dax_dev, 0, PHYS_PFN(dax_size), &kaddr,
639 &pfn);
640 dax_read_unlock(id);
641 if (nr_pages < 0) {
642 pr_debug("dax_direct_access() returned %ld\n", nr_pages);
643 return nr_pages;
644 }
645
646 phys_addr = pfn_t_to_phys(pfn);
647 nr_ranges = nr_pages/FUSE_DAX_MEM_RANGE_PAGES;
648 printk("fuse_dax_mem_range_init(): dax mapped %ld pages.
nr_ranges=%ld\n", nr_pages, nr_ranges);
649
650 for (i = 0; i < nr_ranges; i++) {
651 range = kzalloc(sizeof(struct fuse_dax_mapping), GFP_KERNEL);
652 if (!range) {
653 pr_debug("memory allocation for mem_range failed.\n");
654 ret = -ENOMEM;
655 goto out_err;
656 }
657 /* TODO: This offset only works if virtio-fs driver is not
658 * having some memory hidden at the beginning. This needs
659 * better handling
660 */
661 range->window_offset = i * FUSE_DAX_MEM_RANGE_SZ;
662 range->length = FUSE_DAX_MEM_RANGE_SZ;
663 list_add_tail(&range->list, &mem_ranges);
664 }
665
666 list_replace_init(&mem_ranges, &fc->free_ranges);
667 fc->nr_free_ranges = nr_ranges;
668 return 0;
669 out_err:
670 /* Free All allocated elements */
671 fuse_free_dax_mem_ranges(&mem_ranges);
672 return ret;
673 }
674 #else /* !CONFIG_FS_DAX */
675 static inline int fuse_dax_mem_range_init(struct fuse_conn *fc,
676 struct dax_device *dax_dev)
677 {
678 return 0;
679 }
680 #endif /* CONFIG_FS_DAX */
681
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org