Hi Dan, kernel test robot noticed the following build warnings: [auto build test WARNING on s390/features] [also build test WARNING on brauner-vfs/vfs.all akpm-mm/mm-everything linus/master v6.11 next-20240924] [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/Dan-Williams/dcssblk-Mark-DAX-broken/20240925-070047 base: https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features patch link: https://lore.kernel.org/r/172721874675.497781.3277495908107141898.stgit%40dwillia2-xfh.jf.intel.com patch subject: [PATCH] dcssblk: Mark DAX broken config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20240925/202409251251.i8yVl4yR-lkp@xxxxxxxxx/config) compiler: s390-linux-gcc (GCC) 14.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240925/202409251251.i8yVl4yR-lkp@xxxxxxxxx/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@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202409251251.i8yVl4yR-lkp@xxxxxxxxx/ All warnings (new ones prefixed by >>): drivers/s390/block/dcssblk.c: In function 'dcssblk_add_store': >> drivers/s390/block/dcssblk.c:571:28: warning: unused variable 'dax_dev' [-Wunused-variable] 571 | struct dax_device *dax_dev; | ^~~~~~~ vim +/dax_dev +571 drivers/s390/block/dcssblk.c e265834f5da2c4 Dan Williams 2024-09-24 557 ^1da177e4c3f41 Linus Torvalds 2005-04-16 558 /* ^1da177e4c3f41 Linus Torvalds 2005-04-16 559 * device attribute for adding devices ^1da177e4c3f41 Linus Torvalds 2005-04-16 560 */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 561 static ssize_t e404e274f62665 Yani Ioannou 2005-05-17 562 dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) ^1da177e4c3f41 Linus Torvalds 2005-04-16 563 { af190c53c995bf Christoph Hellwig 2024-02-15 564 struct queue_limits lim = { af190c53c995bf Christoph Hellwig 2024-02-15 565 .logical_block_size = 4096, f467fee48da450 Christoph Hellwig 2024-06-17 566 .features = BLK_FEAT_DAX, af190c53c995bf Christoph Hellwig 2024-02-15 567 }; b2300b9efe1b81 Hongjie Yang 2008-10-10 568 int rc, i, j, num_of_segments; ^1da177e4c3f41 Linus Torvalds 2005-04-16 569 struct dcssblk_dev_info *dev_info; b2300b9efe1b81 Hongjie Yang 2008-10-10 570 struct segment_info *seg_info, *temp; cf7fe690abbbe5 Mathieu Desnoyers 2024-02-15 @571 struct dax_device *dax_dev; ^1da177e4c3f41 Linus Torvalds 2005-04-16 572 char *local_buf; ^1da177e4c3f41 Linus Torvalds 2005-04-16 573 unsigned long seg_byte_size; ^1da177e4c3f41 Linus Torvalds 2005-04-16 574 ^1da177e4c3f41 Linus Torvalds 2005-04-16 575 dev_info = NULL; b2300b9efe1b81 Hongjie Yang 2008-10-10 576 seg_info = NULL; ^1da177e4c3f41 Linus Torvalds 2005-04-16 577 if (dev != dcssblk_root_dev) { ^1da177e4c3f41 Linus Torvalds 2005-04-16 578 rc = -EINVAL; ^1da177e4c3f41 Linus Torvalds 2005-04-16 579 goto out_nobuf; ^1da177e4c3f41 Linus Torvalds 2005-04-16 580 } b2300b9efe1b81 Hongjie Yang 2008-10-10 581 if ((count < 1) || (buf[0] == '\0') || (buf[0] == '\n')) { b2300b9efe1b81 Hongjie Yang 2008-10-10 582 rc = -ENAMETOOLONG; b2300b9efe1b81 Hongjie Yang 2008-10-10 583 goto out_nobuf; b2300b9efe1b81 Hongjie Yang 2008-10-10 584 } b2300b9efe1b81 Hongjie Yang 2008-10-10 585 ^1da177e4c3f41 Linus Torvalds 2005-04-16 586 local_buf = kmalloc(count + 1, GFP_KERNEL); ^1da177e4c3f41 Linus Torvalds 2005-04-16 587 if (local_buf == NULL) { ^1da177e4c3f41 Linus Torvalds 2005-04-16 588 rc = -ENOMEM; ^1da177e4c3f41 Linus Torvalds 2005-04-16 589 goto out_nobuf; ^1da177e4c3f41 Linus Torvalds 2005-04-16 590 } b2300b9efe1b81 Hongjie Yang 2008-10-10 591 ^1da177e4c3f41 Linus Torvalds 2005-04-16 592 /* ^1da177e4c3f41 Linus Torvalds 2005-04-16 593 * parse input ^1da177e4c3f41 Linus Torvalds 2005-04-16 594 */ b2300b9efe1b81 Hongjie Yang 2008-10-10 595 num_of_segments = 0; 3a9f9183bdd341 Ameen Ali 2015-02-24 596 for (i = 0; (i < count && (buf[i] != '\0') && (buf[i] != '\n')); i++) { 42cfc6b590c5eb Martin Schwidefsky 2015-08-19 597 for (j = i; j < count && 42cfc6b590c5eb Martin Schwidefsky 2015-08-19 598 (buf[j] != ':') && b2300b9efe1b81 Hongjie Yang 2008-10-10 599 (buf[j] != '\0') && 42cfc6b590c5eb Martin Schwidefsky 2015-08-19 600 (buf[j] != '\n'); j++) { b2300b9efe1b81 Hongjie Yang 2008-10-10 601 local_buf[j-i] = toupper(buf[j]); b2300b9efe1b81 Hongjie Yang 2008-10-10 602 } b2300b9efe1b81 Hongjie Yang 2008-10-10 603 local_buf[j-i] = '\0'; b2300b9efe1b81 Hongjie Yang 2008-10-10 604 if (((j - i) == 0) || ((j - i) > 8)) { ^1da177e4c3f41 Linus Torvalds 2005-04-16 605 rc = -ENAMETOOLONG; b2300b9efe1b81 Hongjie Yang 2008-10-10 606 goto seg_list_del; ^1da177e4c3f41 Linus Torvalds 2005-04-16 607 } b2300b9efe1b81 Hongjie Yang 2008-10-10 608 b2300b9efe1b81 Hongjie Yang 2008-10-10 609 rc = dcssblk_load_segment(local_buf, &seg_info); b2300b9efe1b81 Hongjie Yang 2008-10-10 610 if (rc < 0) b2300b9efe1b81 Hongjie Yang 2008-10-10 611 goto seg_list_del; ^1da177e4c3f41 Linus Torvalds 2005-04-16 612 /* ^1da177e4c3f41 Linus Torvalds 2005-04-16 613 * get a struct dcssblk_dev_info ^1da177e4c3f41 Linus Torvalds 2005-04-16 614 */ b2300b9efe1b81 Hongjie Yang 2008-10-10 615 if (num_of_segments == 0) { b2300b9efe1b81 Hongjie Yang 2008-10-10 616 dev_info = kzalloc(sizeof(struct dcssblk_dev_info), b2300b9efe1b81 Hongjie Yang 2008-10-10 617 GFP_KERNEL); ^1da177e4c3f41 Linus Torvalds 2005-04-16 618 if (dev_info == NULL) { ^1da177e4c3f41 Linus Torvalds 2005-04-16 619 rc = -ENOMEM; ^1da177e4c3f41 Linus Torvalds 2005-04-16 620 goto out; ^1da177e4c3f41 Linus Torvalds 2005-04-16 621 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 622 strcpy(dev_info->segment_name, local_buf); b2300b9efe1b81 Hongjie Yang 2008-10-10 623 dev_info->segment_type = seg_info->segment_type; b2300b9efe1b81 Hongjie Yang 2008-10-10 624 INIT_LIST_HEAD(&dev_info->seg_list); b2300b9efe1b81 Hongjie Yang 2008-10-10 625 } b2300b9efe1b81 Hongjie Yang 2008-10-10 626 list_add_tail(&seg_info->lh, &dev_info->seg_list); b2300b9efe1b81 Hongjie Yang 2008-10-10 627 num_of_segments++; b2300b9efe1b81 Hongjie Yang 2008-10-10 628 i = j; b2300b9efe1b81 Hongjie Yang 2008-10-10 629 b2300b9efe1b81 Hongjie Yang 2008-10-10 630 if ((buf[j] == '\0') || (buf[j] == '\n')) b2300b9efe1b81 Hongjie Yang 2008-10-10 631 break; b2300b9efe1b81 Hongjie Yang 2008-10-10 632 } b2300b9efe1b81 Hongjie Yang 2008-10-10 633 b2300b9efe1b81 Hongjie Yang 2008-10-10 634 /* no trailing colon at the end of the input */ b2300b9efe1b81 Hongjie Yang 2008-10-10 635 if ((i > 0) && (buf[i-1] == ':')) { b2300b9efe1b81 Hongjie Yang 2008-10-10 636 rc = -ENAMETOOLONG; b2300b9efe1b81 Hongjie Yang 2008-10-10 637 goto seg_list_del; b2300b9efe1b81 Hongjie Yang 2008-10-10 638 } 820109fb11f24b Wolfram Sang 2022-08-18 639 strscpy(local_buf, buf, i + 1); b2300b9efe1b81 Hongjie Yang 2008-10-10 640 dev_info->num_of_segments = num_of_segments; b2300b9efe1b81 Hongjie Yang 2008-10-10 641 rc = dcssblk_is_continuous(dev_info); b2300b9efe1b81 Hongjie Yang 2008-10-10 642 if (rc < 0) b2300b9efe1b81 Hongjie Yang 2008-10-10 643 goto seg_list_del; b2300b9efe1b81 Hongjie Yang 2008-10-10 644 b2300b9efe1b81 Hongjie Yang 2008-10-10 645 dev_info->start = dcssblk_find_lowest_addr(dev_info); b2300b9efe1b81 Hongjie Yang 2008-10-10 646 dev_info->end = dcssblk_find_highest_addr(dev_info); b2300b9efe1b81 Hongjie Yang 2008-10-10 647 ef283688f54cc8 Kees Cook 2014-06-10 648 dev_set_name(&dev_info->dev, "%s", dev_info->segment_name); ^1da177e4c3f41 Linus Torvalds 2005-04-16 649 dev_info->dev.release = dcssblk_release_segment; 521b3d790c16fa Sebastian Ott 2012-10-01 650 dev_info->dev.groups = dcssblk_dev_attr_groups; ^1da177e4c3f41 Linus Torvalds 2005-04-16 651 INIT_LIST_HEAD(&dev_info->lh); af190c53c995bf Christoph Hellwig 2024-02-15 652 dev_info->gd = blk_alloc_disk(&lim, NUMA_NO_NODE); 74fa8f9c553f7b Christoph Hellwig 2024-02-15 653 if (IS_ERR(dev_info->gd)) { 74fa8f9c553f7b Christoph Hellwig 2024-02-15 654 rc = PTR_ERR(dev_info->gd); b2300b9efe1b81 Hongjie Yang 2008-10-10 655 goto seg_list_del; ^1da177e4c3f41 Linus Torvalds 2005-04-16 656 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 657 dev_info->gd->major = dcssblk_major; 0692ef289f067d Christoph Hellwig 2021-05-21 658 dev_info->gd->minors = DCSSBLK_MINORS_PER_DISK; ^1da177e4c3f41 Linus Torvalds 2005-04-16 659 dev_info->gd->fops = &dcssblk_devops; ^1da177e4c3f41 Linus Torvalds 2005-04-16 660 dev_info->gd->private_data = dev_info; a41a11b4009580 Gerald Schaefer 2022-10-27 661 dev_info->gd->flags |= GENHD_FL_NO_PART; b2300b9efe1b81 Hongjie Yang 2008-10-10 662 ^1da177e4c3f41 Linus Torvalds 2005-04-16 663 seg_byte_size = (dev_info->end - dev_info->start + 1); ^1da177e4c3f41 Linus Torvalds 2005-04-16 664 set_capacity(dev_info->gd, seg_byte_size >> 9); // size in sectors 93098bf0157876 Hongjie Yang 2008-12-25 665 pr_info("Loaded %s with total size %lu bytes and capacity %lu " 93098bf0157876 Hongjie Yang 2008-12-25 666 "sectors\n", local_buf, seg_byte_size, seg_byte_size >> 9); ^1da177e4c3f41 Linus Torvalds 2005-04-16 667 ^1da177e4c3f41 Linus Torvalds 2005-04-16 668 dev_info->save_pending = 0; ^1da177e4c3f41 Linus Torvalds 2005-04-16 669 dev_info->is_shared = 1; ^1da177e4c3f41 Linus Torvalds 2005-04-16 670 dev_info->dev.parent = dcssblk_root_dev; ^1da177e4c3f41 Linus Torvalds 2005-04-16 671 ^1da177e4c3f41 Linus Torvalds 2005-04-16 672 /* ^1da177e4c3f41 Linus Torvalds 2005-04-16 673 *get minor, add to list ^1da177e4c3f41 Linus Torvalds 2005-04-16 674 */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 675 down_write(&dcssblk_devices_sem); b2300b9efe1b81 Hongjie Yang 2008-10-10 676 if (dcssblk_get_segment_by_name(local_buf)) { 04f64b5756872b Gerald Schaefer 2008-08-21 677 rc = -EEXIST; b2300b9efe1b81 Hongjie Yang 2008-10-10 678 goto release_gd; 04f64b5756872b Gerald Schaefer 2008-08-21 679 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 680 rc = dcssblk_assign_free_minor(dev_info); b2300b9efe1b81 Hongjie Yang 2008-10-10 681 if (rc) b2300b9efe1b81 Hongjie Yang 2008-10-10 682 goto release_gd; ^1da177e4c3f41 Linus Torvalds 2005-04-16 683 sprintf(dev_info->gd->disk_name, "dcssblk%d", d0591485e15ccd Gerald Schaefer 2009-06-12 684 dev_info->gd->first_minor); ^1da177e4c3f41 Linus Torvalds 2005-04-16 685 list_add_tail(&dev_info->lh, &dcssblk_devices); ^1da177e4c3f41 Linus Torvalds 2005-04-16 686 ^1da177e4c3f41 Linus Torvalds 2005-04-16 687 if (!try_module_get(THIS_MODULE)) { ^1da177e4c3f41 Linus Torvalds 2005-04-16 688 rc = -ENODEV; b2300b9efe1b81 Hongjie Yang 2008-10-10 689 goto dev_list_del; ^1da177e4c3f41 Linus Torvalds 2005-04-16 690 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 691 /* ^1da177e4c3f41 Linus Torvalds 2005-04-16 692 * register the device ^1da177e4c3f41 Linus Torvalds 2005-04-16 693 */ ^1da177e4c3f41 Linus Torvalds 2005-04-16 694 rc = device_register(&dev_info->dev); b2300b9efe1b81 Hongjie Yang 2008-10-10 695 if (rc) 521b3d790c16fa Sebastian Ott 2012-10-01 696 goto put_dev; ^1da177e4c3f41 Linus Torvalds 2005-04-16 697 e265834f5da2c4 Dan Williams 2024-09-24 698 rc = dcssblk_setup_dax(dev_info); fb08a1908cb119 Christoph Hellwig 2021-11-29 699 if (rc) fb08a1908cb119 Christoph Hellwig 2021-11-29 700 goto out_dax; 7a2765f6e82063 Dan Williams 2017-01-26 701 521b3d790c16fa Sebastian Ott 2012-10-01 702 get_device(&dev_info->dev); 1a5db707c859a4 Gerald Schaefer 2021-09-27 703 rc = device_add_disk(&dev_info->dev, dev_info->gd, NULL); 1a5db707c859a4 Gerald Schaefer 2021-09-27 704 if (rc) fb08a1908cb119 Christoph Hellwig 2021-11-29 705 goto out_dax_host; 436d1bc7fe6e78 Christian Borntraeger 2007-12-04 706 ^1da177e4c3f41 Linus Torvalds 2005-04-16 707 switch (dev_info->segment_type) { ^1da177e4c3f41 Linus Torvalds 2005-04-16 708 case SEG_TYPE_SR: ^1da177e4c3f41 Linus Torvalds 2005-04-16 709 case SEG_TYPE_ER: ^1da177e4c3f41 Linus Torvalds 2005-04-16 710 case SEG_TYPE_SC: ^1da177e4c3f41 Linus Torvalds 2005-04-16 711 set_disk_ro(dev_info->gd,1); ^1da177e4c3f41 Linus Torvalds 2005-04-16 712 break; ^1da177e4c3f41 Linus Torvalds 2005-04-16 713 default: ^1da177e4c3f41 Linus Torvalds 2005-04-16 714 set_disk_ro(dev_info->gd,0); ^1da177e4c3f41 Linus Torvalds 2005-04-16 715 break; ^1da177e4c3f41 Linus Torvalds 2005-04-16 716 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 717 up_write(&dcssblk_devices_sem); ^1da177e4c3f41 Linus Torvalds 2005-04-16 718 rc = count; ^1da177e4c3f41 Linus Torvalds 2005-04-16 719 goto out; ^1da177e4c3f41 Linus Torvalds 2005-04-16 720 fb08a1908cb119 Christoph Hellwig 2021-11-29 721 out_dax_host: c8f40a0bccefd6 Gerald Schaefer 2023-08-10 722 put_device(&dev_info->dev); fb08a1908cb119 Christoph Hellwig 2021-11-29 723 dax_remove_host(dev_info->gd); 1a5db707c859a4 Gerald Schaefer 2021-09-27 724 out_dax: 1a5db707c859a4 Gerald Schaefer 2021-09-27 725 kill_dax(dev_info->dax_dev); 1a5db707c859a4 Gerald Schaefer 2021-09-27 726 put_dax(dev_info->dax_dev); 521b3d790c16fa Sebastian Ott 2012-10-01 727 put_dev: ^1da177e4c3f41 Linus Torvalds 2005-04-16 728 list_del(&dev_info->lh); 8b9ab62662048a Christoph Hellwig 2022-06-19 729 put_disk(dev_info->gd); b2300b9efe1b81 Hongjie Yang 2008-10-10 730 list_for_each_entry(seg_info, &dev_info->seg_list, lh) { b2300b9efe1b81 Hongjie Yang 2008-10-10 731 segment_unload(seg_info->segment_name); b2300b9efe1b81 Hongjie Yang 2008-10-10 732 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 733 put_device(&dev_info->dev); ^1da177e4c3f41 Linus Torvalds 2005-04-16 734 up_write(&dcssblk_devices_sem); ^1da177e4c3f41 Linus Torvalds 2005-04-16 735 goto out; b2300b9efe1b81 Hongjie Yang 2008-10-10 736 dev_list_del: ^1da177e4c3f41 Linus Torvalds 2005-04-16 737 list_del(&dev_info->lh); b2300b9efe1b81 Hongjie Yang 2008-10-10 738 release_gd: 8b9ab62662048a Christoph Hellwig 2022-06-19 739 put_disk(dev_info->gd); b2300b9efe1b81 Hongjie Yang 2008-10-10 740 up_write(&dcssblk_devices_sem); b2300b9efe1b81 Hongjie Yang 2008-10-10 741 seg_list_del: b2300b9efe1b81 Hongjie Yang 2008-10-10 742 if (dev_info == NULL) b2300b9efe1b81 Hongjie Yang 2008-10-10 743 goto out; b2300b9efe1b81 Hongjie Yang 2008-10-10 744 list_for_each_entry_safe(seg_info, temp, &dev_info->seg_list, lh) { b2300b9efe1b81 Hongjie Yang 2008-10-10 745 list_del(&seg_info->lh); b2300b9efe1b81 Hongjie Yang 2008-10-10 746 segment_unload(seg_info->segment_name); b2300b9efe1b81 Hongjie Yang 2008-10-10 747 kfree(seg_info); b2300b9efe1b81 Hongjie Yang 2008-10-10 748 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 749 kfree(dev_info); ^1da177e4c3f41 Linus Torvalds 2005-04-16 750 out: ^1da177e4c3f41 Linus Torvalds 2005-04-16 751 kfree(local_buf); ^1da177e4c3f41 Linus Torvalds 2005-04-16 752 out_nobuf: ^1da177e4c3f41 Linus Torvalds 2005-04-16 753 return rc; ^1da177e4c3f41 Linus Torvalds 2005-04-16 754 } ^1da177e4c3f41 Linus Torvalds 2005-04-16 755 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki