fs/btrfs/volumes.c:888:50: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 09162bc32c880a791c6c0668ce0745cf7958f576
commit: 8d1a7aae89dc0c41ffb76fe1007dbba59d13881b btrfs: annotate device name rcu_string with __rcu
date: 6 weeks ago
config: s390-randconfig-s032-20201103 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.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-107-gaf3512a6-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 8d1a7aae89dc0c41ffb76fe1007dbba59d13881b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
fs/btrfs/volumes.c:374:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct rcu_string *str @@ got struct rcu_string [noderef] __rcu *name @@
fs/btrfs/volumes.c:374:31: sparse: expected struct rcu_string *str
fs/btrfs/volumes.c:374:31: sparse: got struct rcu_string [noderef] __rcu *name
fs/btrfs/volumes.c:631:43: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *device_path @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:631:43: sparse: expected char const *device_path
fs/btrfs/volumes.c:631:43: sparse: got char [noderef] __rcu *
>> fs/btrfs/volumes.c:888:50: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *s1 @@ got char [noderef] __rcu * @@
>> fs/btrfs/volumes.c:888:50: sparse: expected char const *s1
fs/btrfs/volumes.c:888:50: sparse: got char [noderef] __rcu *
fs/btrfs/volumes.c:963:39: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct rcu_string *str @@ got struct rcu_string [noderef] __rcu *name @@
fs/btrfs/volumes.c:963:39: sparse: expected struct rcu_string *str
fs/btrfs/volumes.c:963:39: sparse: got struct rcu_string [noderef] __rcu *name
fs/btrfs/volumes.c:1018:58: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected char const *src @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:1018:58: sparse: expected char const *src
fs/btrfs/volumes.c:1018:58: sparse: got char [noderef] __rcu *
fs/btrfs/volumes.c:2165:49: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected char const *device_path @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:2165:49: sparse: expected char const *device_path
fs/btrfs/volumes.c:2165:49: sparse: got char [noderef] __rcu *
fs/btrfs/volumes.c:2273:41: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected char const *device_path @@ got char [noderef] __rcu * @@
fs/btrfs/volumes.c:2273:41: sparse: expected char const *device_path
fs/btrfs/volumes.c:2273:41: sparse: got char [noderef] __rcu *
vim +888 fs/btrfs/volumes.c
1362089d2ad7e20 Nikolay Borisov 2020-01-10 745
1362089d2ad7e20 Nikolay Borisov 2020-01-10 746 static struct btrfs_fs_devices *find_fsid_reverted_metadata(
1362089d2ad7e20 Nikolay Borisov 2020-01-10 747 struct btrfs_super_block *disk_super)
1362089d2ad7e20 Nikolay Borisov 2020-01-10 748 {
1362089d2ad7e20 Nikolay Borisov 2020-01-10 749 struct btrfs_fs_devices *fs_devices;
1362089d2ad7e20 Nikolay Borisov 2020-01-10 750
1362089d2ad7e20 Nikolay Borisov 2020-01-10 751 /*
1362089d2ad7e20 Nikolay Borisov 2020-01-10 752 * Handle the case where the scanned device is part of an fs whose last
1362089d2ad7e20 Nikolay Borisov 2020-01-10 753 * metadata UUID change reverted it to the original FSID. At the same
1362089d2ad7e20 Nikolay Borisov 2020-01-10 754 * time * fs_devices was first created by another constitutent device
1362089d2ad7e20 Nikolay Borisov 2020-01-10 755 * which didn't fully observe the operation. This results in an
1362089d2ad7e20 Nikolay Borisov 2020-01-10 756 * btrfs_fs_devices created with metadata/fsid different AND
1362089d2ad7e20 Nikolay Borisov 2020-01-10 757 * btrfs_fs_devices::fsid_change set AND the metadata_uuid of the
1362089d2ad7e20 Nikolay Borisov 2020-01-10 758 * fs_devices equal to the FSID of the disk.
1362089d2ad7e20 Nikolay Borisov 2020-01-10 759 */
1362089d2ad7e20 Nikolay Borisov 2020-01-10 760 list_for_each_entry(fs_devices, &fs_uuids, fs_list) {
1362089d2ad7e20 Nikolay Borisov 2020-01-10 761 if (memcmp(fs_devices->fsid, fs_devices->metadata_uuid,
1362089d2ad7e20 Nikolay Borisov 2020-01-10 762 BTRFS_FSID_SIZE) != 0 &&
1362089d2ad7e20 Nikolay Borisov 2020-01-10 763 memcmp(fs_devices->metadata_uuid, disk_super->fsid,
1362089d2ad7e20 Nikolay Borisov 2020-01-10 764 BTRFS_FSID_SIZE) == 0 &&
1362089d2ad7e20 Nikolay Borisov 2020-01-10 765 fs_devices->fsid_change)
1362089d2ad7e20 Nikolay Borisov 2020-01-10 766 return fs_devices;
1362089d2ad7e20 Nikolay Borisov 2020-01-10 767 }
1362089d2ad7e20 Nikolay Borisov 2020-01-10 768
1362089d2ad7e20 Nikolay Borisov 2020-01-10 769 return NULL;
1362089d2ad7e20 Nikolay Borisov 2020-01-10 770 }
60999ca4b4033ee David Sterba 2014-03-26 771 /*
60999ca4b4033ee David Sterba 2014-03-26 772 * Add new device to list of registered devices
60999ca4b4033ee David Sterba 2014-03-26 773 *
60999ca4b4033ee David Sterba 2014-03-26 774 * Returns:
e124ece53edf3a8 Anand Jain 2018-01-18 775 * device pointer which was just added or updated when successful
e124ece53edf3a8 Anand Jain 2018-01-18 776 * error pointer when failed
60999ca4b4033ee David Sterba 2014-03-26 777 */
e124ece53edf3a8 Anand Jain 2018-01-18 778 static noinline struct btrfs_device *device_list_add(const char *path,
4306a97449f9a0f Anand Jain 2018-05-29 779 struct btrfs_super_block *disk_super,
4306a97449f9a0f Anand Jain 2018-05-29 780 bool *new_device_added)
8a4b83cc8bd75fc Chris Mason 2008-03-24 781 {
8a4b83cc8bd75fc Chris Mason 2008-03-24 782 struct btrfs_device *device;
7a62d0f07377b51 Nikolay Borisov 2018-10-30 783 struct btrfs_fs_devices *fs_devices = NULL;
606686eeac4550d Josef Bacik 2012-06-04 784 struct rcu_string *name;
8a4b83cc8bd75fc Chris Mason 2008-03-24 785 u64 found_transid = btrfs_super_generation(disk_super);
3acbcbfc8f06d4a Anand Jain 2018-01-18 786 u64 devid = btrfs_stack_device_id(&disk_super->dev_item);
7239ff4b2be8ec0 Nikolay Borisov 2018-10-30 787 bool has_metadata_uuid = (btrfs_super_incompat_flags(disk_super) &
7239ff4b2be8ec0 Nikolay Borisov 2018-10-30 788 BTRFS_FEATURE_INCOMPAT_METADATA_UUID);
d1a63002829a4d8 Nikolay Borisov 2018-10-30 789 bool fsid_change_in_progress = (btrfs_super_flags(disk_super) &
d1a63002829a4d8 Nikolay Borisov 2018-10-30 790 BTRFS_SUPER_FLAG_CHANGING_FSID_V2);
7239ff4b2be8ec0 Nikolay Borisov 2018-10-30 791
cc5de4e70256cbf Nikolay Borisov 2018-10-30 792 if (fsid_change_in_progress) {
c0d81c7cb236782 Su Yue 2020-01-10 793 if (!has_metadata_uuid)
7a62d0f07377b51 Nikolay Borisov 2018-10-30 794 fs_devices = find_fsid_inprogress(disk_super);
c0d81c7cb236782 Su Yue 2020-01-10 795 else
cc5de4e70256cbf Nikolay Borisov 2018-10-30 796 fs_devices = find_fsid_changed(disk_super);
7a62d0f07377b51 Nikolay Borisov 2018-10-30 797 } else if (has_metadata_uuid) {
c6730a0e5778bf2 Su Yue 2020-01-10 798 fs_devices = find_fsid_with_metadata_uuid(disk_super);
7a62d0f07377b51 Nikolay Borisov 2018-10-30 799 } else {
1362089d2ad7e20 Nikolay Borisov 2020-01-10 800 fs_devices = find_fsid_reverted_metadata(disk_super);
1362089d2ad7e20 Nikolay Borisov 2020-01-10 801 if (!fs_devices)
7a62d0f07377b51 Nikolay Borisov 2018-10-30 802 fs_devices = find_fsid(disk_super->fsid, NULL);
7a62d0f07377b51 Nikolay Borisov 2018-10-30 803 }
7a62d0f07377b51 Nikolay Borisov 2018-10-30 804
7a62d0f07377b51 Nikolay Borisov 2018-10-30 805
8a4b83cc8bd75fc Chris Mason 2008-03-24 806 if (!fs_devices) {
7239ff4b2be8ec0 Nikolay Borisov 2018-10-30 807 if (has_metadata_uuid)
7239ff4b2be8ec0 Nikolay Borisov 2018-10-30 808 fs_devices = alloc_fs_devices(disk_super->fsid,
7239ff4b2be8ec0 Nikolay Borisov 2018-10-30 809 disk_super->metadata_uuid);
7239ff4b2be8ec0 Nikolay Borisov 2018-10-30 810 else
7239ff4b2be8ec0 Nikolay Borisov 2018-10-30 811 fs_devices = alloc_fs_devices(disk_super->fsid, NULL);
7239ff4b2be8ec0 Nikolay Borisov 2018-10-30 812
2208a378f35fea7 Ilya Dryomov 2013-08-12 813 if (IS_ERR(fs_devices))
e124ece53edf3a8 Anand Jain 2018-01-18 814 return ERR_CAST(fs_devices);
2208a378f35fea7 Ilya Dryomov 2013-08-12 815
92900e5160a5444 Al Viro 2019-01-27 816 fs_devices->fsid_change = fsid_change_in_progress;
92900e5160a5444 Al Viro 2019-01-27 817
9c6d173ea6e4c8c Anand Jain 2018-05-29 818 mutex_lock(&fs_devices->device_list_mutex);
c4babc5e38e94e7 Anand Jain 2018-04-12 819 list_add(&fs_devices->fs_list, &fs_uuids);
2208a378f35fea7 Ilya Dryomov 2013-08-12 820
8a4b83cc8bd75fc Chris Mason 2008-03-24 821 device = NULL;
8a4b83cc8bd75fc Chris Mason 2008-03-24 822 } else {
9c6d173ea6e4c8c Anand Jain 2018-05-29 823 mutex_lock(&fs_devices->device_list_mutex);
09ba3bc9dd15045 Anand Jain 2019-01-19 824 device = btrfs_find_device(fs_devices, devid,
09ba3bc9dd15045 Anand Jain 2019-01-19 825 disk_super->dev_item.uuid, NULL, false);
7a62d0f07377b51 Nikolay Borisov 2018-10-30 826
7a62d0f07377b51 Nikolay Borisov 2018-10-30 827 /*
7a62d0f07377b51 Nikolay Borisov 2018-10-30 828 * If this disk has been pulled into an fs devices created by
7a62d0f07377b51 Nikolay Borisov 2018-10-30 829 * a device which had the CHANGING_FSID_V2 flag then replace the
7a62d0f07377b51 Nikolay Borisov 2018-10-30 830 * metadata_uuid/fsid values of the fs_devices.
7a62d0f07377b51 Nikolay Borisov 2018-10-30 831 */
1362089d2ad7e20 Nikolay Borisov 2020-01-10 832 if (fs_devices->fsid_change &&
7a62d0f07377b51 Nikolay Borisov 2018-10-30 833 found_transid > fs_devices->latest_generation) {
7a62d0f07377b51 Nikolay Borisov 2018-10-30 834 memcpy(fs_devices->fsid, disk_super->fsid,
7a62d0f07377b51 Nikolay Borisov 2018-10-30 835 BTRFS_FSID_SIZE);
1362089d2ad7e20 Nikolay Borisov 2020-01-10 836
1362089d2ad7e20 Nikolay Borisov 2020-01-10 837 if (has_metadata_uuid)
1362089d2ad7e20 Nikolay Borisov 2020-01-10 838 memcpy(fs_devices->metadata_uuid,
1362089d2ad7e20 Nikolay Borisov 2020-01-10 839 disk_super->metadata_uuid,
1362089d2ad7e20 Nikolay Borisov 2020-01-10 840 BTRFS_FSID_SIZE);
1362089d2ad7e20 Nikolay Borisov 2020-01-10 841 else
7a62d0f07377b51 Nikolay Borisov 2018-10-30 842 memcpy(fs_devices->metadata_uuid,
1362089d2ad7e20 Nikolay Borisov 2020-01-10 843 disk_super->fsid, BTRFS_FSID_SIZE);
7a62d0f07377b51 Nikolay Borisov 2018-10-30 844
7a62d0f07377b51 Nikolay Borisov 2018-10-30 845 fs_devices->fsid_change = false;
7a62d0f07377b51 Nikolay Borisov 2018-10-30 846 }
8a4b83cc8bd75fc Chris Mason 2008-03-24 847 }
443f24fee731703 Miao Xie 2014-07-24 848
8a4b83cc8bd75fc Chris Mason 2008-03-24 849 if (!device) {
9c6d173ea6e4c8c Anand Jain 2018-05-29 850 if (fs_devices->opened) {
9c6d173ea6e4c8c Anand Jain 2018-05-29 851 mutex_unlock(&fs_devices->device_list_mutex);
e124ece53edf3a8 Anand Jain 2018-01-18 852 return ERR_PTR(-EBUSY);
9c6d173ea6e4c8c Anand Jain 2018-05-29 853 }
2b82032c34ec405 Yan Zheng 2008-11-17 854
12bd2fc0d2f589f Ilya Dryomov 2013-08-23 855 device = btrfs_alloc_device(NULL, &devid,
12bd2fc0d2f589f Ilya Dryomov 2013-08-23 856 disk_super->dev_item.uuid);
12bd2fc0d2f589f Ilya Dryomov 2013-08-23 857 if (IS_ERR(device)) {
9c6d173ea6e4c8c Anand Jain 2018-05-29 858 mutex_unlock(&fs_devices->device_list_mutex);
8a4b83cc8bd75fc Chris Mason 2008-03-24 859 /* we can safely leave the fs_devices entry around */
e124ece53edf3a8 Anand Jain 2018-01-18 860 return device;
8a4b83cc8bd75fc Chris Mason 2008-03-24 861 }
606686eeac4550d Josef Bacik 2012-06-04 862
606686eeac4550d Josef Bacik 2012-06-04 863 name = rcu_string_strdup(path, GFP_NOFS);
606686eeac4550d Josef Bacik 2012-06-04 864 if (!name) {
a425f9d4755a14f David Sterba 2018-03-20 865 btrfs_free_device(device);
9c6d173ea6e4c8c Anand Jain 2018-05-29 866 mutex_unlock(&fs_devices->device_list_mutex);
e124ece53edf3a8 Anand Jain 2018-01-18 867 return ERR_PTR(-ENOMEM);
8a4b83cc8bd75fc Chris Mason 2008-03-24 868 }
606686eeac4550d Josef Bacik 2012-06-04 869 rcu_assign_pointer(device->name, name);
90519d66abbccc2 Arne Jansen 2011-05-23 870
1f78160ce1b1b8e Xiao Guangrong 2011-04-20 871 list_add_rcu(&device->dev_list, &fs_devices->devices);
f71717502460c5c Filipe David Borba Manana 2013-08-12 872 fs_devices->num_devices++;
e5e9a5206a171b2 Chris Mason 2009-06-10 873
2b82032c34ec405 Yan Zheng 2008-11-17 874 device->fs_devices = fs_devices;
4306a97449f9a0f Anand Jain 2018-05-29 875 *new_device_added = true;
327f18cc7f44bc0 Anand Jain 2018-01-18 876
327f18cc7f44bc0 Anand Jain 2018-01-18 877 if (disk_super->label[0])
aa6c0df73e3b3fc Anand Jain 2019-10-02 878 pr_info(
aa6c0df73e3b3fc Anand Jain 2019-10-02 879 "BTRFS: device label %s devid %llu transid %llu %s scanned by %s (%d)\n",
aa6c0df73e3b3fc Anand Jain 2019-10-02 880 disk_super->label, devid, found_transid, path,
aa6c0df73e3b3fc Anand Jain 2019-10-02 881 current->comm, task_pid_nr(current));
327f18cc7f44bc0 Anand Jain 2018-01-18 882 else
aa6c0df73e3b3fc Anand Jain 2019-10-02 883 pr_info(
aa6c0df73e3b3fc Anand Jain 2019-10-02 884 "BTRFS: device fsid %pU devid %llu transid %llu %s scanned by %s (%d)\n",
aa6c0df73e3b3fc Anand Jain 2019-10-02 885 disk_super->fsid, devid, found_transid, path,
aa6c0df73e3b3fc Anand Jain 2019-10-02 886 current->comm, task_pid_nr(current));
327f18cc7f44bc0 Anand Jain 2018-01-18 887
606686eeac4550d Josef Bacik 2012-06-04 @888 } else if (!device->name || strcmp(device->name->str, path)) {
b96de000bc8bc96 Anand Jain 2014-07-03 889 /*
b96de000bc8bc96 Anand Jain 2014-07-03 890 * When FS is already mounted.
b96de000bc8bc96 Anand Jain 2014-07-03 891 * 1. If you are here and if the device->name is NULL that
b96de000bc8bc96 Anand Jain 2014-07-03 892 * means this device was missing at time of FS mount.
b96de000bc8bc96 Anand Jain 2014-07-03 893 * 2. If you are here and if the device->name is different
b96de000bc8bc96 Anand Jain 2014-07-03 894 * from 'path' that means either
b96de000bc8bc96 Anand Jain 2014-07-03 895 * a. The same device disappeared and reappeared with
b96de000bc8bc96 Anand Jain 2014-07-03 896 * different name. or
b96de000bc8bc96 Anand Jain 2014-07-03 897 * b. The missing-disk-which-was-replaced, has
b96de000bc8bc96 Anand Jain 2014-07-03 898 * reappeared now.
b96de000bc8bc96 Anand Jain 2014-07-03 899 *
b96de000bc8bc96 Anand Jain 2014-07-03 900 * We must allow 1 and 2a above. But 2b would be a spurious
b96de000bc8bc96 Anand Jain 2014-07-03 901 * and unintentional.
b96de000bc8bc96 Anand Jain 2014-07-03 902 *
b96de000bc8bc96 Anand Jain 2014-07-03 903 * Further in case of 1 and 2a above, the disk at 'path'
b96de000bc8bc96 Anand Jain 2014-07-03 904 * would have missed some transaction when it was away and
b96de000bc8bc96 Anand Jain 2014-07-03 905 * in case of 2a the stale bdev has to be updated as well.
b96de000bc8bc96 Anand Jain 2014-07-03 906 * 2b must not be allowed at all time.
b96de000bc8bc96 Anand Jain 2014-07-03 907 */
b96de000bc8bc96 Anand Jain 2014-07-03 908
b96de000bc8bc96 Anand Jain 2014-07-03 909 /*
0f23ae74f589304 Chris Mason 2014-09-18 910 * For now, we do allow update to btrfs_fs_device through the
0f23ae74f589304 Chris Mason 2014-09-18 911 * btrfs dev scan cli after FS has been mounted. We're still
0f23ae74f589304 Chris Mason 2014-09-18 912 * tracking a problem where systems fail mount by subvolume id
0f23ae74f589304 Chris Mason 2014-09-18 913 * when we reject replacement on a mounted FS.
b96de000bc8bc96 Anand Jain 2014-07-03 914 */
0f23ae74f589304 Chris Mason 2014-09-18 915 if (!fs_devices->opened && found_transid < device->generation) {
77bdae4d136e167 Anand Jain 2014-07-03 916 /*
77bdae4d136e167 Anand Jain 2014-07-03 917 * That is if the FS is _not_ mounted and if you
77bdae4d136e167 Anand Jain 2014-07-03 918 * are here, that means there is more than one
77bdae4d136e167 Anand Jain 2014-07-03 919 * disk with same uuid and devid.We keep the one
77bdae4d136e167 Anand Jain 2014-07-03 920 * with larger generation number or the last-in if
77bdae4d136e167 Anand Jain 2014-07-03 921 * generation are equal.
77bdae4d136e167 Anand Jain 2014-07-03 922 */
9c6d173ea6e4c8c Anand Jain 2018-05-29 923 mutex_unlock(&fs_devices->device_list_mutex);
e124ece53edf3a8 Anand Jain 2018-01-18 924 return ERR_PTR(-EEXIST);
77bdae4d136e167 Anand Jain 2014-07-03 925 }
b96de000bc8bc96 Anand Jain 2014-07-03 926
a9261d4125c97ce Anand Jain 2018-10-15 927 /*
a9261d4125c97ce Anand Jain 2018-10-15 928 * We are going to replace the device path for a given devid,
a9261d4125c97ce Anand Jain 2018-10-15 929 * make sure it's the same device if the device is mounted
a9261d4125c97ce Anand Jain 2018-10-15 930 */
a9261d4125c97ce Anand Jain 2018-10-15 931 if (device->bdev) {
a9261d4125c97ce Anand Jain 2018-10-15 932 struct block_device *path_bdev;
a9261d4125c97ce Anand Jain 2018-10-15 933
a9261d4125c97ce Anand Jain 2018-10-15 934 path_bdev = lookup_bdev(path);
a9261d4125c97ce Anand Jain 2018-10-15 935 if (IS_ERR(path_bdev)) {
a9261d4125c97ce Anand Jain 2018-10-15 936 mutex_unlock(&fs_devices->device_list_mutex);
a9261d4125c97ce Anand Jain 2018-10-15 937 return ERR_CAST(path_bdev);
a9261d4125c97ce Anand Jain 2018-10-15 938 }
a9261d4125c97ce Anand Jain 2018-10-15 939
a9261d4125c97ce Anand Jain 2018-10-15 940 if (device->bdev != path_bdev) {
a9261d4125c97ce Anand Jain 2018-10-15 941 bdput(path_bdev);
a9261d4125c97ce Anand Jain 2018-10-15 942 mutex_unlock(&fs_devices->device_list_mutex);
a9261d4125c97ce Anand Jain 2018-10-15 943 btrfs_warn_in_rcu(device->fs_info,
79dae17d8d44b2d Anand Jain 2020-09-03 944 "duplicate device %s devid %llu generation %llu scanned by %s (%d)",
79dae17d8d44b2d Anand Jain 2020-09-03 945 path, devid, found_transid,
79dae17d8d44b2d Anand Jain 2020-09-03 946 current->comm,
79dae17d8d44b2d Anand Jain 2020-09-03 947 task_pid_nr(current));
a9261d4125c97ce Anand Jain 2018-10-15 948 return ERR_PTR(-EEXIST);
a9261d4125c97ce Anand Jain 2018-10-15 949 }
a9261d4125c97ce Anand Jain 2018-10-15 950 bdput(path_bdev);
a9261d4125c97ce Anand Jain 2018-10-15 951 btrfs_info_in_rcu(device->fs_info,
79dae17d8d44b2d Anand Jain 2020-09-03 952 "devid %llu device path %s changed to %s scanned by %s (%d)",
79dae17d8d44b2d Anand Jain 2020-09-03 953 devid, rcu_str_deref(device->name),
79dae17d8d44b2d Anand Jain 2020-09-03 954 path, current->comm,
79dae17d8d44b2d Anand Jain 2020-09-03 955 task_pid_nr(current));
a9261d4125c97ce Anand Jain 2018-10-15 956 }
a9261d4125c97ce Anand Jain 2018-10-15 957
606686eeac4550d Josef Bacik 2012-06-04 958 name = rcu_string_strdup(path, GFP_NOFS);
9c6d173ea6e4c8c Anand Jain 2018-05-29 959 if (!name) {
9c6d173ea6e4c8c Anand Jain 2018-05-29 960 mutex_unlock(&fs_devices->device_list_mutex);
e124ece53edf3a8 Anand Jain 2018-01-18 961 return ERR_PTR(-ENOMEM);
9c6d173ea6e4c8c Anand Jain 2018-05-29 962 }
606686eeac4550d Josef Bacik 2012-06-04 963 rcu_string_free(device->name);
606686eeac4550d Josef Bacik 2012-06-04 964 rcu_assign_pointer(device->name, name);
e6e674bd4d54fe8 Anand Jain 2017-12-04 965 if (test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state)) {
cd02dca56442e15 Chris Mason 2010-12-13 966 fs_devices->missing_devices--;
e6e674bd4d54fe8 Anand Jain 2017-12-04 967 clear_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state);
cd02dca56442e15 Chris Mason 2010-12-13 968 }
8a4b83cc8bd75fc Chris Mason 2008-03-24 969 }
8a4b83cc8bd75fc Chris Mason 2008-03-24 970
77bdae4d136e167 Anand Jain 2014-07-03 971 /*
77bdae4d136e167 Anand Jain 2014-07-03 972 * Unmount does not free the btrfs_device struct but would zero
77bdae4d136e167 Anand Jain 2014-07-03 973 * generation along with most of the other members. So just update
77bdae4d136e167 Anand Jain 2014-07-03 974 * it back. We need it to pick the disk with largest generation
77bdae4d136e167 Anand Jain 2014-07-03 975 * (as above).
77bdae4d136e167 Anand Jain 2014-07-03 976 */
d1a63002829a4d8 Nikolay Borisov 2018-10-30 977 if (!fs_devices->opened) {
77bdae4d136e167 Anand Jain 2014-07-03 978 device->generation = found_transid;
d1a63002829a4d8 Nikolay Borisov 2018-10-30 979 fs_devices->latest_generation = max_t(u64, found_transid,
d1a63002829a4d8 Nikolay Borisov 2018-10-30 980 fs_devices->latest_generation);
d1a63002829a4d8 Nikolay Borisov 2018-10-30 981 }
77bdae4d136e167 Anand Jain 2014-07-03 982
f2788d2f76cafef Anand Jain 2018-01-18 983 fs_devices->total_devices = btrfs_super_num_devices(disk_super);
f2788d2f76cafef Anand Jain 2018-01-18 984
9c6d173ea6e4c8c Anand Jain 2018-05-29 985 mutex_unlock(&fs_devices->device_list_mutex);
e124ece53edf3a8 Anand Jain 2018-01-18 986 return device;
8a4b83cc8bd75fc Chris Mason 2008-03-24 987 }
8a4b83cc8bd75fc Chris Mason 2008-03-24 988
:::::: The code at line 888 was first introduced by commit
:::::: 606686eeac4550d2212bf3d621a810407ef5e9bf Btrfs: use rcu to protect device->name
:::::: TO: Josef Bacik <josef(a)redhat.com>
:::::: CC: Chris Mason <chris.mason(a)oracle.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
[chrome-os:chromeos-5.4 39/76] drivers/remoteproc/mtk_scp.c:306:17: sparse: sparse: incorrect type in argument 2 (different address spaces)
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head: 4e186ff60c11535b22b7f81c85606260e363989f
commit: 0b60154e37d6ff2e12c8fb52d7c715d61fd96a6a [39/76] FROMGIT: remoteproc/mediatek: Add support for mt8192 SCP
config: riscv-randconfig-s031-20201113 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.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-107-gaf3512a6-dirty
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.4
git checkout 0b60154e37d6ff2e12c8fb52d7c715d61fd96a6a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/remoteproc/mtk_scp.c:306:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2> *addr @@ got void *addr @@
>> drivers/remoteproc/mtk_scp.c:306:17: sparse: expected void volatile [noderef] <asn:2> *addr
drivers/remoteproc/mtk_scp.c:306:17: sparse: got void *addr
drivers/remoteproc/mtk_scp.c:307:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2> *addr @@ got void *addr @@
drivers/remoteproc/mtk_scp.c:307:9: sparse: expected void volatile [noderef] <asn:2> *addr
drivers/remoteproc/mtk_scp.c:307:9: sparse: got void *addr
drivers/remoteproc/mtk_scp.c:314:9: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2> *addr @@ got void *addr @@
drivers/remoteproc/mtk_scp.c:314:9: sparse: expected void volatile [noderef] <asn:2> *addr
drivers/remoteproc/mtk_scp.c:314:9: sparse: got void *addr
drivers/remoteproc/mtk_scp.c:316:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2> *addr @@ got void *addr @@
drivers/remoteproc/mtk_scp.c:316:17: sparse: expected void volatile [noderef] <asn:2> *addr
drivers/remoteproc/mtk_scp.c:316:17: sparse: got void *addr
drivers/remoteproc/mtk_scp.c:326:9: sparse: sparse: undefined identifier 'dsb'
>> drivers/remoteproc/mtk_scp.c:435:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got void [noderef] <asn:2> * @@
drivers/remoteproc/mtk_scp.c:436:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got void [noderef] <asn:2> * @@
drivers/remoteproc/mtk_scp.c:437:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got void [noderef] <asn:2> * @@
drivers/remoteproc/mtk_scp.c:438:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got void [noderef] <asn:2> * @@
drivers/remoteproc/mtk_scp.c:439:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got void [noderef] <asn:2> * @@
drivers/remoteproc/mtk_scp.c:563:23: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] <asn:2> *cpu_addr @@ got void * @@
drivers/remoteproc/mtk_scp.c:576:56: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void *cpu_addr @@ got void [noderef] <asn:2> *cpu_addr @@
vim +306 drivers/remoteproc/mtk_scp.c
300
301 static void mt8192_power_on_sram(void *addr)
302 {
303 int i;
304
305 for (i = 31; i >= 0; i--)
> 306 writel(GENMASK(i, 0), addr);
> 307 writel(0, addr);
308 }
309
310 static void mt8192_power_off_sram(void *addr)
311 {
312 int i;
313
314 writel(0, addr);
315 for (i = 0; i < 32; i++)
316 writel(GENMASK(i, 0), addr);
317 }
318
319 static int mt8192_scp_before_load(struct mtk_scp *scp)
320 {
321 /* clear SPM interrupt, SCP2SPM_IPC_CLR */
322 writel(0xff, scp->reg_base + MT8192_SCP2SPM_IPC_CLR);
323
324 writel(1, scp->reg_base + MT8192_CORE0_SW_RSTN_SET);
325
326 dsb(sy);
327
328 readl(scp->reg_base + MT8192_CORE0_SW_RSTN_SET);
329
330 /* enable SRAM clock */
331 mt8192_power_on_sram(scp->reg_base + MT8192_L2TCM_SRAM_PD_0);
332 mt8192_power_on_sram(scp->reg_base + MT8192_L2TCM_SRAM_PD_1);
333 mt8192_power_on_sram(scp->reg_base + MT8192_L2TCM_SRAM_PD_2);
334 mt8192_power_on_sram(scp->reg_base + MT8192_L1TCM_SRAM_PDN);
335 mt8192_power_on_sram(scp->reg_base + MT8192_CPU0_SRAM_PD);
336
337 return 0;
338 }
339
340 static int scp_load(struct rproc *rproc, const struct firmware *fw)
341 {
342 struct mtk_scp *scp = rproc->priv;
343 struct device *dev = scp->dev;
344 int ret;
345
346 ret = clk_prepare_enable(scp->clk);
347 if (ret) {
348 dev_err(dev, "failed to enable clocks\n");
349 return ret;
350 }
351
352 /* Hold SCP in reset while loading FW. */
353 scp->data->scp_reset_assert(scp);
354
355 ret = scp->data->scp_before_load(scp);
356 if (ret < 0)
357 return ret;
358
359 ret = scp_elf_load_segments(rproc, fw);
360 clk_disable_unprepare(scp->clk);
361
362 return ret;
363 }
364
365 static int scp_start(struct rproc *rproc)
366 {
367 struct mtk_scp *scp = (struct mtk_scp *)rproc->priv;
368 struct device *dev = scp->dev;
369 struct scp_run *run = &scp->run;
370 int ret;
371
372 ret = clk_prepare_enable(scp->clk);
373 if (ret) {
374 dev_err(dev, "failed to enable clocks\n");
375 return ret;
376 }
377
378 run->signaled = false;
379
380 scp->data->scp_reset_deassert(scp);
381
382 ret = wait_event_interruptible_timeout(
383 run->wq,
384 run->signaled,
385 msecs_to_jiffies(2000));
386
387 if (ret == 0) {
388 dev_err(dev, "wait SCP initialization timeout!\n");
389 ret = -ETIME;
390 goto stop;
391 }
392 if (ret == -ERESTARTSYS) {
393 dev_err(dev, "wait SCP interrupted by a signal!\n");
394 goto stop;
395 }
396
397 clk_disable_unprepare(scp->clk);
398 dev_info(dev, "SCP is ready. FW version %s\n", run->fw_ver);
399
400 return 0;
401
402 stop:
403 scp->data->scp_reset_assert(scp);
404 clk_disable_unprepare(scp->clk);
405 return ret;
406 }
407
408 static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len)
409 {
410 struct mtk_scp *scp = (struct mtk_scp *)rproc->priv;
411 int offset;
412
413 if (da < scp->sram_size) {
414 offset = da;
415 if (offset >= 0 && (offset + len) < scp->sram_size)
416 return (void __force *)scp->sram_base + offset;
417 } else if (scp->dram_size) {
418 offset = da - scp->dma_addr;
419 if (offset >= 0 && (offset + len) < scp->dram_size)
420 return (void __force *)scp->cpu_addr + offset;
421 }
422
423 return NULL;
424 }
425
426 static void mt8183_scp_stop(struct mtk_scp *scp)
427 {
428 /* Disable SCP watchdog */
429 writel(0, scp->reg_base + MT8183_WDT_CFG);
430 }
431
432 static void mt8192_scp_stop(struct mtk_scp *scp)
433 {
434 /* Disable SRAM clock */
> 435 mt8192_power_off_sram(scp->reg_base + MT8192_L2TCM_SRAM_PD_0);
436 mt8192_power_off_sram(scp->reg_base + MT8192_L2TCM_SRAM_PD_1);
437 mt8192_power_off_sram(scp->reg_base + MT8192_L2TCM_SRAM_PD_2);
438 mt8192_power_off_sram(scp->reg_base + MT8192_L1TCM_SRAM_PDN);
439 mt8192_power_off_sram(scp->reg_base + MT8192_CPU0_SRAM_PD);
440
441 /* Disable SCP watchdog */
442 writel(0, scp->reg_base + MT8192_CORE0_WDT_CFG);
443 }
444
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
s390-linux-ld: socfpga.c:undefined reference to `devm_ioremap_resource'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 09162bc32c880a791c6c0668ce0745cf7958f576
commit: 57e5b8bfd633b9237f0072ef8faeef9545a61ea1 iio: adc: stm32-dfsdm: Use devm_platform_get_and_ioremap_resource()
date: 7 weeks ago
config: s390-randconfig-p002-20201116 (attached as .config)
compiler: s390-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
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 57e5b8bfd633b9237f0072ef8faeef9545a61ea1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
ns-thermal.c:(.text+0x2a): undefined reference to `iounmap'
s390-linux-ld: drivers/thermal/broadcom/ns-thermal.o: in function `ns_thermal_probe':
ns-thermal.c:(.text+0x9a): undefined reference to `of_iomap'
s390-linux-ld: ns-thermal.c:(.text+0xa6): undefined reference to `iounmap'
s390-linux-ld: drivers/thermal/broadcom/sr-thermal.o: in function `sr_thermal_probe':
sr-thermal.c:(.text+0x7a): undefined reference to `devm_memremap'
s390-linux-ld: drivers/thermal/tango_thermal.o: in function `tango_thermal_probe':
tango_thermal.c:(.text+0x5c): undefined reference to `devm_ioremap_resource'
s390-linux-ld: drivers/thermal/imx8mm_thermal.o: in function `imx8mm_tmu_probe':
imx8mm_thermal.c:(.text+0x1fc): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/watchdog/armada_37xx_wdt.o: in function `armada_37xx_wdt_probe':
armada_37xx_wdt.c:(.text+0x2a4): undefined reference to `devm_ioremap'
s390-linux-ld: drivers/watchdog/asm9260_wdt.o: in function `asm9260_wdt_probe':
asm9260_wdt.c:(.text+0x3a0): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/watchdog/at91sam9_wdt.o: in function `at91wdt_probe':
at91sam9_wdt.c:(.init.text+0xbc): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/watchdog/ftwdt010_wdt.o: in function `ftwdt010_wdt_probe':
ftwdt010_wdt.c:(.text+0xf2): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/watchdog/sama5d4_wdt.o: in function `sama5d4_wdt_probe':
sama5d4_wdt.c:(.text+0x450): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/watchdog/ep93xx_wdt.o: in function `ep93xx_wdt_probe':
ep93xx_wdt.c:(.text+0xc2): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/watchdog/pnx4008_wdt.o:pnx4008_wdt.c:(.text+0x25c): more undefined references to `devm_platform_ioremap_resource' follow
s390-linux-ld: drivers/watchdog/mv64x60_wdt.o: in function `mv64x60_wdt_probe':
mv64x60_wdt.c:(.text+0x368): undefined reference to `devm_ioremap'
s390-linux-ld: drivers/clocksource/timer-of.o: in function `timer_of_init':
timer-of.c:(.init.text+0x3e): undefined reference to `of_iomap'
s390-linux-ld: timer-of.c:(.init.text+0x312): undefined reference to `iounmap'
s390-linux-ld: drivers/clocksource/timer-of.o: in function `timer_of_cleanup':
timer-of.c:(.init.text+0x3f6): undefined reference to `iounmap'
s390-linux-ld: drivers/clocksource/clps711x-timer.o: in function `clps711x_timer_init':
clps711x-timer.c:(.init.text+0x4a): undefined reference to `of_iomap'
s390-linux-ld: drivers/clocksource/timer-atlas7.o: in function `sirfsoc_of_timer_init':
timer-atlas7.c:(.init.text+0x26): undefined reference to `of_iomap'
s390-linux-ld: drivers/clocksource/timer-prima2.o: in function `sirfsoc_prima2_timer_init':
timer-prima2.c:(.init.text+0xb2): undefined reference to `of_iomap'
s390-linux-ld: drivers/clocksource/timer-zevio.o: in function `zevio_timer_add':
timer-zevio.c:(.init.text+0x4e): undefined reference to `of_iomap'
s390-linux-ld: timer-zevio.c:(.init.text+0xa6): undefined reference to `iounmap'
s390-linux-ld: timer-zevio.c:(.init.text+0xb8): undefined reference to `of_iomap'
s390-linux-ld: timer-zevio.c:(.init.text+0xe2): undefined reference to `of_address_to_resource'
s390-linux-ld: drivers/clocksource/timer-cadence-ttc.o: in function `ttc_timer_probe':
timer-cadence-ttc.c:(.init.text+0x6e): undefined reference to `of_iomap'
s390-linux-ld: drivers/clocksource/armv7m_systick.o: in function `system_timer_of_register':
armv7m_systick.c:(.init.text+0x26): undefined reference to `of_iomap'
s390-linux-ld: armv7m_systick.c:(.init.text+0x146): undefined reference to `iounmap'
s390-linux-ld: drivers/clocksource/timer-microchip-pit64b.o: in function `mchp_pit64b_dt_init_timer':
timer-microchip-pit64b.c:(.init.text+0x86): undefined reference to `of_iomap'
s390-linux-ld: timer-microchip-pit64b.c:(.init.text+0x46a): undefined reference to `iounmap'
s390-linux-ld: drivers/mailbox/imx-mailbox.o: in function `imx_mu_probe':
imx-mailbox.c:(.text+0xd7e): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/mailbox/armada-37xx-rwtm-mailbox.o: in function `armada_37xx_mbox_probe':
armada-37xx-rwtm-mailbox.c:(.text+0x146): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/mailbox/hi3660-mailbox.o: in function `hi3660_mbox_probe':
hi3660-mailbox.c:(.text+0xf4): undefined reference to `devm_ioremap_resource'
s390-linux-ld: drivers/mailbox/bcm-pdc-mailbox.o: in function `pdc_probe':
bcm-pdc-mailbox.c:(.text+0x784): undefined reference to `devm_ioremap_resource'
s390-linux-ld: drivers/mailbox/qcom-apcs-ipc-mailbox.o: in function `qcom_apcs_ipc_probe':
qcom-apcs-ipc-mailbox.c:(.text+0xdc): undefined reference to `devm_ioremap_resource'
s390-linux-ld: drivers/mailbox/sprd-mailbox.o: in function `sprd_mbox_probe':
sprd-mailbox.c:(.text+0x4e8): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: sprd-mailbox.c:(.text+0x50a): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/mailbox/qcom-ipcc.o: in function `qcom_ipcc_probe':
qcom-ipcc.c:(.text+0x340): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/hwspinlock/sirf_hwspinlock.o: in function `sirf_hwspinlock_probe':
sirf_hwspinlock.c:(.text+0x94): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/hwspinlock/sprd_hwspinlock.o: in function `sprd_hwspinlock_probe':
sprd_hwspinlock.c:(.text+0xc4): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/hwspinlock/u8500_hsem.o:u8500_hsem.c:(.text+0x80): more undefined references to `devm_platform_ioremap_resource' follow
s390-linux-ld: drivers/remoteproc/ingenic_rproc.o: in function `ingenic_rproc_probe':
ingenic_rproc.c:(.text+0x20c): undefined reference to `devm_ioremap_resource'
s390-linux-ld: ingenic_rproc.c:(.text+0x270): undefined reference to `devm_ioremap_resource'
s390-linux-ld: drivers/rpmsg/qcom_smd.o: in function `qcom_smd_channel_peek':
qcom_smd.c:(.text+0x15b4): undefined reference to `__ioread32_copy'
s390-linux-ld: qcom_smd.c:(.text+0x15f6): undefined reference to `__ioread32_copy'
s390-linux-ld: drivers/rpmsg/qcom_smd.o: in function `qcom_smd_write_fifo':
qcom_smd.c:(.text+0x1a88): undefined reference to `__iowrite32_copy'
s390-linux-ld: qcom_smd.c:(.text+0x1ace): undefined reference to `__iowrite32_copy'
s390-linux-ld: drivers/devfreq/tegra30-devfreq.o: in function `tegra_devfreq_probe':
tegra30-devfreq.c:(.text+0x942): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/iio/adc/adi-axi-adc.o: in function `adi_axi_adc_probe':
adi-axi-adc.c:(.text+0x3bc): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/iio/adc/aspeed_adc.o: in function `aspeed_adc_probe':
aspeed_adc.c:(.text+0x2ba): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/iio/adc/at91_adc.o: in function `at91_adc_probe':
at91_adc.c:(.text+0x14de): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/iio/adc/meson_saradc.o: in function `meson_sar_adc_probe':
meson_saradc.c:(.text+0xe1e): undefined reference to `devm_platform_ioremap_resource'
s390-linux-ld: drivers/iio/adc/rockchip_saradc.o: in function `rockchip_saradc_probe':
rockchip_saradc.c:(.text+0x520): undefined reference to `devm_ioremap_resource'
s390-linux-ld: drivers/iio/adc/stm32-adc-core.o: in function `stm32_adc_probe':
stm32-adc-core.c:(.text+0x866): undefined reference to `devm_ioremap_resource'
s390-linux-ld: drivers/iio/adc/stm32-dfsdm-core.o: in function `stm32_dfsdm_probe':
stm32-dfsdm-core.c:(.text+0x272): undefined reference to `devm_platform_get_and_ioremap_resource'
s390-linux-ld: drivers/nvmem/stm32-romem.o: in function `stm32_romem_probe':
stm32-romem.c:(.text+0x280): undefined reference to `devm_ioremap_resource'
s390-linux-ld: drivers/nvmem/meson-mx-efuse.o: in function `meson_mx_efuse_probe':
meson-mx-efuse.c:(.text+0x70): undefined reference to `devm_ioremap_resource'
s390-linux-ld: drivers/fpga/socfpga.o: in function `socfpga_fpga_probe':
socfpga.c:(.text+0x334): undefined reference to `devm_ioremap_resource'
>> s390-linux-ld: socfpga.c:(.text+0x368): undefined reference to `devm_ioremap_resource'
s390-linux-ld: drivers/fpga/socfpga-a10.o: in function `socfpga_a10_fpga_probe':
socfpga-a10.c:(.text+0x234): undefined reference to `devm_ioremap_resource'
s390-linux-ld: drivers/fpga/socfpga-a10.o:socfpga-a10.c:(.text+0x268): more undefined references to `devm_ioremap_resource' follow
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
Re: [PATCH v2 29/39] fs: add helpers for idmap mounts
by kernel test robot
Hi Christian,
I love your patch! Perhaps something to improve:
[auto build test WARNING on 3cea11cd5e3b00d91caf0b4730194039b45c5891]
url: https://github.com/0day-ci/linux/commits/Christian-Brauner/fs-idmapped-mo...
base: 3cea11cd5e3b00d91caf0b4730194039b45c5891
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-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
# https://github.com/0day-ci/linux/commit/be817fb36176ab0c272188d583293ba16...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Christian-Brauner/fs-idmapped-mounts/20201115-185706
git checkout be817fb36176ab0c272188d583293ba16fd84cca
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
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 >>):
drivers/android/binderfs.c: In function 'binderfs_rename':
drivers/android/binderfs.c:367:23: error: passing argument 1 of 'simple_rename' from incompatible pointer type [-Werror=incompatible-pointer-types]
367 | return simple_rename(old_dir, old_dentry, new_dir, new_dentry, flags);
| ^~~~~~~
| |
| struct inode *
In file included from drivers/android/binderfs.c:5:
include/linux/fs.h:3203:26: note: expected 'struct user_namespace *' but argument is of type 'struct inode *'
3203 | extern int simple_rename(struct user_namespace *, struct inode *,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/android/binderfs.c:367:32: error: passing argument 2 of 'simple_rename' from incompatible pointer type [-Werror=incompatible-pointer-types]
367 | return simple_rename(old_dir, old_dentry, new_dir, new_dentry, flags);
| ^~~~~~~~~~
| |
| struct dentry *
In file included from drivers/android/binderfs.c:5:
include/linux/fs.h:3203:51: note: expected 'struct inode *' but argument is of type 'struct dentry *'
3203 | extern int simple_rename(struct user_namespace *, struct inode *,
| ^~~~~~~~~~~~~~
drivers/android/binderfs.c:367:44: error: passing argument 3 of 'simple_rename' from incompatible pointer type [-Werror=incompatible-pointer-types]
367 | return simple_rename(old_dir, old_dentry, new_dir, new_dentry, flags);
| ^~~~~~~
| |
| struct inode *
In file included from drivers/android/binderfs.c:5:
include/linux/fs.h:3204:5: note: expected 'struct dentry *' but argument is of type 'struct inode *'
3204 | struct dentry *, struct inode *, struct dentry *,
| ^~~~~~~~~~~~~~~
drivers/android/binderfs.c:367:53: error: passing argument 4 of 'simple_rename' from incompatible pointer type [-Werror=incompatible-pointer-types]
367 | return simple_rename(old_dir, old_dentry, new_dir, new_dentry, flags);
| ^~~~~~~~~~
| |
| struct dentry *
In file included from drivers/android/binderfs.c:5:
include/linux/fs.h:3204:22: note: expected 'struct inode *' but argument is of type 'struct dentry *'
3204 | struct dentry *, struct inode *, struct dentry *,
| ^~~~~~~~~~~~~~
>> drivers/android/binderfs.c:367:65: warning: passing argument 5 of 'simple_rename' makes pointer from integer without a cast [-Wint-conversion]
367 | return simple_rename(old_dir, old_dentry, new_dir, new_dentry, flags);
| ^~~~~
| |
| unsigned int
In file included from drivers/android/binderfs.c:5:
include/linux/fs.h:3204:38: note: expected 'struct dentry *' but argument is of type 'unsigned int'
3204 | struct dentry *, struct inode *, struct dentry *,
| ^~~~~~~~~~~~~~~
drivers/android/binderfs.c:367:9: error: too few arguments to function 'simple_rename'
367 | return simple_rename(old_dir, old_dentry, new_dir, new_dentry, flags);
| ^~~~~~~~~~~~~
In file included from drivers/android/binderfs.c:5:
include/linux/fs.h:3203:12: note: declared here
3203 | extern int simple_rename(struct user_namespace *, struct inode *,
| ^~~~~~~~~~~~~
drivers/android/binderfs.c:368:1: error: control reaches end of non-void function [-Werror=return-type]
368 | }
| ^
cc1: some warnings being treated as errors
vim +/simple_rename +367 drivers/android/binderfs.c
e98e6fa18636609 Christian Brauner 2019-01-21 357
be817fb36176ab0 Christian Brauner 2020-11-15 358 static int binderfs_rename(struct user_namespace *user_ns,
be817fb36176ab0 Christian Brauner 2020-11-15 359 struct inode *old_dir, struct dentry *old_dentry,
3ad20fe393b3102 Christian Brauner 2018-12-14 360 struct inode *new_dir, struct dentry *new_dentry,
3ad20fe393b3102 Christian Brauner 2018-12-14 361 unsigned int flags)
3ad20fe393b3102 Christian Brauner 2018-12-14 362 {
e98e6fa18636609 Christian Brauner 2019-01-21 363 if (is_binderfs_control_device(old_dentry) ||
e98e6fa18636609 Christian Brauner 2019-01-21 364 is_binderfs_control_device(new_dentry))
3ad20fe393b3102 Christian Brauner 2018-12-14 365 return -EPERM;
3ad20fe393b3102 Christian Brauner 2018-12-14 366
e98e6fa18636609 Christian Brauner 2019-01-21 @367 return simple_rename(old_dir, old_dentry, new_dir, new_dentry, flags);
3ad20fe393b3102 Christian Brauner 2018-12-14 368 }
3ad20fe393b3102 Christian Brauner 2018-12-14 369
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
drivers/accessibility/speakup/serialio.c:48:19: warning: variable 'quot' set but not used
by kernel test robot
Hi Samuel,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: a6af8718b98e1cd37a9ea9a02269c79577fc9138
commit: 2067fd92d75b6d9085a43caf050bca5d88c491b8 staging/speakup: Move out of staging
date: 4 months ago
config: parisc-randconfig-r023-20201116 (attached as .config)
compiler: hppa-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
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 2067fd92d75b6d9085a43caf050bca5d88c491b8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc
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 >>):
drivers/accessibility/speakup/serialio.c: In function 'spk_serial_init':
>> drivers/accessibility/speakup/serialio.c:48:19: warning: variable 'quot' set but not used [-Wunused-but-set-variable]
48 | int baud = 9600, quot = 0;
| ^~~~
drivers/accessibility/speakup/serialio.c: In function 'spk_serial_tiocmset':
drivers/accessibility/speakup/serialio.c:165:6: warning: unused variable 'old' [-Wunused-variable]
165 | int old = inb(speakup_info.port_tts + UART_MCR);
| ^~~
vim +/quot +48 drivers/accessibility/speakup/serialio.c
1e441594e509c3 drivers/staging/speakup/serialio.c Okash Khawaja 2017-03-14 45
3ee0017e03cd79 drivers/staging/speakup/serialio.c Jiri Slaby 2012-03-05 46 const struct old_serial_port *spk_serial_init(int index)
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 47 {
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 @48 int baud = 9600, quot = 0;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 49 unsigned int cval = 0;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 50 int cflag = CREAD | HUPCL | CLOCAL | B9600 | CS8;
327b882d3bcc1f drivers/staging/speakup/serialio.c Samuel Thibault 2016-01-15 51 const struct old_serial_port *ser;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 52 int err;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 53
327b882d3bcc1f drivers/staging/speakup/serialio.c Samuel Thibault 2016-01-15 54 if (index >= ARRAY_SIZE(rs_table)) {
327b882d3bcc1f drivers/staging/speakup/serialio.c Samuel Thibault 2016-01-15 55 pr_info("no port info for ttyS%d\n", index);
327b882d3bcc1f drivers/staging/speakup/serialio.c Samuel Thibault 2016-01-15 56 return NULL;
327b882d3bcc1f drivers/staging/speakup/serialio.c Samuel Thibault 2016-01-15 57 }
327b882d3bcc1f drivers/staging/speakup/serialio.c Samuel Thibault 2016-01-15 58 ser = rs_table + index;
327b882d3bcc1f drivers/staging/speakup/serialio.c Samuel Thibault 2016-01-15 59
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 60 /* Divisor, bytesize and parity */
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 61 quot = ser->baud_base / baud;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 62 cval = cflag & (CSIZE | CSTOPB);
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 63 #if defined(__powerpc__) || defined(__alpha__)
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 64 cval >>= 8;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 65 #else /* !__powerpc__ && !__alpha__ */
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 66 cval >>= 4;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 67 #endif /* !__powerpc__ && !__alpha__ */
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 68 if (cflag & PARENB)
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 69 cval |= UART_LCR_PARITY;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 70 if (!(cflag & PARODD))
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 71 cval |= UART_LCR_EPAR;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 72 if (synth_request_region(ser->port, 8)) {
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 73 /* try to take it back. */
3a046c19158e89 drivers/staging/speakup/serialio.c Keerthimai Janarthanan 2014-03-18 74 pr_info("Ports not available, trying to steal them\n");
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 75 __release_region(&ioport_resource, ser->port, 8);
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 76 err = synth_request_region(ser->port, 8);
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 77 if (err) {
3ee0017e03cd79 drivers/staging/speakup/serialio.c Jiri Slaby 2012-03-05 78 pr_warn("Unable to allocate port at %x, errno %i",
baf9ac9ff8864c drivers/staging/speakup/serialio.c William Hubbs 2010-10-15 79 ser->port, err);
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 80 return NULL;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 81 }
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 82 }
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 83
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 84 /* Disable UART interrupts, set DTR and RTS high
13d825edd4441d drivers/staging/speakup/serialio.c Aleksei Fedotov 2015-08-14 85 * and set speed.
13d825edd4441d drivers/staging/speakup/serialio.c Aleksei Fedotov 2015-08-14 86 */
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 87 outb(cval | UART_LCR_DLAB, ser->port + UART_LCR); /* set DLAB */
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 88 outb(quot & 0xff, ser->port + UART_DLL); /* LS of divisor */
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 89 outb(quot >> 8, ser->port + UART_DLM); /* MS of divisor */
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 90 outb(cval, ser->port + UART_LCR); /* reset DLAB */
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 91
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 92 /* Turn off Interrupts */
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 93 outb(0, ser->port + UART_IER);
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 94 outb(UART_MCR_DTR | UART_MCR_RTS, ser->port + UART_MCR);
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 95
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 96 /* If we read 0xff from the LSR, there is no UART here. */
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 97 if (inb(ser->port + UART_LSR) == 0xff) {
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 98 synth_release_region(ser->port, 8);
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 99 serstate = NULL;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 100 return NULL;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 101 }
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 102
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 103 mdelay(1);
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 104 speakup_info.port_tts = ser->port;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 105 serstate = ser;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 106
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 107 start_serial_interrupt(ser->irq);
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 108
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 109 return ser;
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 110 }
c6e3fd22cd5383 drivers/staging/speakup/serialio.c William Hubbs 2010-10-07 111
:::::: The code at line 48 was first introduced by commit
:::::: c6e3fd22cd538365bfeb82997d5b89562e077d42 Staging: add speakup to the staging directory
:::::: TO: William Hubbs <w.d.hubbs(a)gmail.com>
:::::: CC: Greg Kroah-Hartman <gregkh(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
Re: [PATCH v2 11/39] attr: handle idmapped mounts
by kernel test robot
Hi Christian,
I love your patch! Yet something to improve:
[auto build test ERROR on 3cea11cd5e3b00d91caf0b4730194039b45c5891]
url: https://github.com/0day-ci/linux/commits/Christian-Brauner/fs-idmapped-mo...
base: 3cea11cd5e3b00d91caf0b4730194039b45c5891
config: x86_64-randconfig-r012-20201115 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/d2e8305428c77e99475427f5da2e400a1...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Christian-Brauner/fs-idmapped-mounts/20201115-185706
git checkout d2e8305428c77e99475427f5da2e400a1451bdf8
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
fs/f2fs/file.c: In function 'f2fs_setattr':
>> fs/f2fs/file.c:942:17: error: passing argument 1 of 'setattr_copy' from incompatible pointer type [-Werror=incompatible-pointer-types]
942 | __setattr_copy(inode, attr);
| ^~~~~
| |
| struct inode *
In file included from fs/f2fs/file.c:8:
include/linux/fs.h:3250:26: note: expected 'struct user_namespace *' but argument is of type 'struct inode *'
3250 | extern void setattr_copy(struct user_namespace *, struct inode *inode,
| ^~~~~~~~~~~~~~~~~~~~~~~
fs/f2fs/file.c:942:24: error: passing argument 2 of 'setattr_copy' from incompatible pointer type [-Werror=incompatible-pointer-types]
942 | __setattr_copy(inode, attr);
| ^~~~
| |
| struct iattr *
In file included from fs/f2fs/file.c:8:
include/linux/fs.h:3250:65: note: expected 'struct inode *' but argument is of type 'struct iattr *'
3250 | extern void setattr_copy(struct user_namespace *, struct inode *inode,
| ~~~~~~~~~~~~~~^~~~~
>> fs/f2fs/file.c:851:24: error: too few arguments to function 'setattr_copy'
851 | #define __setattr_copy setattr_copy
| ^~~~~~~~~~~~
fs/f2fs/file.c:942:2: note: in expansion of macro '__setattr_copy'
942 | __setattr_copy(inode, attr);
| ^~~~~~~~~~~~~~
In file included from fs/f2fs/file.c:8:
include/linux/fs.h:3250:13: note: declared here
3250 | extern void setattr_copy(struct user_namespace *, struct inode *inode,
| ^~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/setattr_copy +942 fs/f2fs/file.c
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 826
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 827 #ifdef CONFIG_F2FS_FS_POSIX_ACL
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 828 static void __setattr_copy(struct inode *inode, const struct iattr *attr)
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 829 {
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 830 unsigned int ia_valid = attr->ia_valid;
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 831
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 832 if (ia_valid & ATTR_UID)
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 833 inode->i_uid = attr->ia_uid;
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 834 if (ia_valid & ATTR_GID)
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 835 inode->i_gid = attr->ia_gid;
eb31e2f63d85d1b Amir Goldstein 2019-11-24 836 if (ia_valid & ATTR_ATIME)
eb31e2f63d85d1b Amir Goldstein 2019-11-24 837 inode->i_atime = attr->ia_atime;
eb31e2f63d85d1b Amir Goldstein 2019-11-24 838 if (ia_valid & ATTR_MTIME)
eb31e2f63d85d1b Amir Goldstein 2019-11-24 839 inode->i_mtime = attr->ia_mtime;
eb31e2f63d85d1b Amir Goldstein 2019-11-24 840 if (ia_valid & ATTR_CTIME)
eb31e2f63d85d1b Amir Goldstein 2019-11-24 841 inode->i_ctime = attr->ia_ctime;
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 842 if (ia_valid & ATTR_MODE) {
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 843 umode_t mode = attr->ia_mode;
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 844
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 845 if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID))
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 846 mode &= ~S_ISGID;
91942321e4c9f84 Jaegeuk Kim 2016-05-20 847 set_acl_inode(inode, mode);
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 848 }
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 849 }
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 850 #else
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 @851 #define __setattr_copy setattr_copy
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 852 #endif
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 853
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 854 int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 855 {
2b0143b5c986be1 David Howells 2015-03-17 856 struct inode *inode = d_inode(dentry);
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 857 int err;
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 858
1f227a3e215d361 Jaegeuk Kim 2017-10-23 859 if (unlikely(f2fs_cp_error(F2FS_I_SB(inode))))
1f227a3e215d361 Jaegeuk Kim 2017-10-23 860 return -EIO;
1f227a3e215d361 Jaegeuk Kim 2017-10-23 861
4c8ff7095bef64f Chao Yu 2019-11-01 862 if ((attr->ia_valid & ATTR_SIZE) &&
4c8ff7095bef64f Chao Yu 2019-11-01 863 !f2fs_is_compress_backend_ready(inode))
4c8ff7095bef64f Chao Yu 2019-11-01 864 return -EOPNOTSUPP;
4c8ff7095bef64f Chao Yu 2019-11-01 865
d2e8305428c77e9 Christian Brauner 2020-11-15 866 err = setattr_prepare(&init_user_ns, dentry, attr);
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 867 if (err)
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 868 return err;
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 869
20bb2479be49296 Eric Biggers 2017-11-29 870 err = fscrypt_prepare_setattr(dentry, attr);
20bb2479be49296 Eric Biggers 2017-11-29 871 if (err)
20bb2479be49296 Eric Biggers 2017-11-29 872 return err;
20bb2479be49296 Eric Biggers 2017-11-29 873
95ae251fe82838b Eric Biggers 2019-07-22 874 err = fsverity_prepare_setattr(dentry, attr);
95ae251fe82838b Eric Biggers 2019-07-22 875 if (err)
95ae251fe82838b Eric Biggers 2019-07-22 876 return err;
95ae251fe82838b Eric Biggers 2019-07-22 877
0abd675e97e60d4 Chao Yu 2017-07-09 878 if (is_quota_modification(inode, attr)) {
0abd675e97e60d4 Chao Yu 2017-07-09 879 err = dquot_initialize(inode);
0abd675e97e60d4 Chao Yu 2017-07-09 880 if (err)
0abd675e97e60d4 Chao Yu 2017-07-09 881 return err;
0abd675e97e60d4 Chao Yu 2017-07-09 882 }
0abd675e97e60d4 Chao Yu 2017-07-09 883 if ((attr->ia_valid & ATTR_UID &&
0abd675e97e60d4 Chao Yu 2017-07-09 884 !uid_eq(attr->ia_uid, inode->i_uid)) ||
0abd675e97e60d4 Chao Yu 2017-07-09 885 (attr->ia_valid & ATTR_GID &&
0abd675e97e60d4 Chao Yu 2017-07-09 886 !gid_eq(attr->ia_gid, inode->i_gid))) {
af033b2aa8a874f Chao Yu 2018-09-20 887 f2fs_lock_op(F2FS_I_SB(inode));
0abd675e97e60d4 Chao Yu 2017-07-09 888 err = dquot_transfer(inode, attr);
af033b2aa8a874f Chao Yu 2018-09-20 889 if (err) {
af033b2aa8a874f Chao Yu 2018-09-20 890 set_sbi_flag(F2FS_I_SB(inode),
af033b2aa8a874f Chao Yu 2018-09-20 891 SBI_QUOTA_NEED_REPAIR);
af033b2aa8a874f Chao Yu 2018-09-20 892 f2fs_unlock_op(F2FS_I_SB(inode));
0abd675e97e60d4 Chao Yu 2017-07-09 893 return err;
0abd675e97e60d4 Chao Yu 2017-07-09 894 }
af033b2aa8a874f Chao Yu 2018-09-20 895 /*
af033b2aa8a874f Chao Yu 2018-09-20 896 * update uid/gid under lock_op(), so that dquot and inode can
af033b2aa8a874f Chao Yu 2018-09-20 897 * be updated atomically.
af033b2aa8a874f Chao Yu 2018-09-20 898 */
af033b2aa8a874f Chao Yu 2018-09-20 899 if (attr->ia_valid & ATTR_UID)
af033b2aa8a874f Chao Yu 2018-09-20 900 inode->i_uid = attr->ia_uid;
af033b2aa8a874f Chao Yu 2018-09-20 901 if (attr->ia_valid & ATTR_GID)
af033b2aa8a874f Chao Yu 2018-09-20 902 inode->i_gid = attr->ia_gid;
af033b2aa8a874f Chao Yu 2018-09-20 903 f2fs_mark_inode_dirty_sync(inode, true);
af033b2aa8a874f Chao Yu 2018-09-20 904 f2fs_unlock_op(F2FS_I_SB(inode));
af033b2aa8a874f Chao Yu 2018-09-20 905 }
0abd675e97e60d4 Chao Yu 2017-07-09 906
09db6a2ef8d9ca6 Chao Yu 2014-09-15 907 if (attr->ia_valid & ATTR_SIZE) {
cfb9a34d147b8d0 Jaegeuk Kim 2019-09-03 908 loff_t old_size = i_size_read(inode);
cfb9a34d147b8d0 Jaegeuk Kim 2019-09-03 909
cfb9a34d147b8d0 Jaegeuk Kim 2019-09-03 910 if (attr->ia_size > MAX_INLINE_DATA(inode)) {
cfb9a34d147b8d0 Jaegeuk Kim 2019-09-03 911 /*
cfb9a34d147b8d0 Jaegeuk Kim 2019-09-03 912 * should convert inline inode before i_size_write to
cfb9a34d147b8d0 Jaegeuk Kim 2019-09-03 913 * keep smaller than inline_data size with inline flag.
cfb9a34d147b8d0 Jaegeuk Kim 2019-09-03 914 */
cfb9a34d147b8d0 Jaegeuk Kim 2019-09-03 915 err = f2fs_convert_inline_inode(inode);
cfb9a34d147b8d0 Jaegeuk Kim 2019-09-03 916 if (err)
cfb9a34d147b8d0 Jaegeuk Kim 2019-09-03 917 return err;
cfb9a34d147b8d0 Jaegeuk Kim 2019-09-03 918 }
a33c150237a20d9 Chao Yu 2018-08-05 919
a33c150237a20d9 Chao Yu 2018-08-05 920 down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
6f8d4455060dfb0 Jaegeuk Kim 2018-07-25 921 down_write(&F2FS_I(inode)->i_mmap_sem);
a33c150237a20d9 Chao Yu 2018-08-05 922
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 923 truncate_setsize(inode, attr->ia_size);
a33c150237a20d9 Chao Yu 2018-08-05 924
cfb9a34d147b8d0 Jaegeuk Kim 2019-09-03 925 if (attr->ia_size <= old_size)
9a449e9c3b34ef3 Jaegeuk Kim 2016-06-02 926 err = f2fs_truncate(inode);
09db6a2ef8d9ca6 Chao Yu 2014-09-15 927 /*
3c4541452748754 Chao Yu 2015-06-05 928 * do not trim all blocks after i_size if target size is
3c4541452748754 Chao Yu 2015-06-05 929 * larger than i_size.
09db6a2ef8d9ca6 Chao Yu 2014-09-15 930 */
5a3a2d83cda82df Qiuyang Sun 2017-05-18 931 up_write(&F2FS_I(inode)->i_mmap_sem);
6f8d4455060dfb0 Jaegeuk Kim 2018-07-25 932 up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
a33c150237a20d9 Chao Yu 2018-08-05 933 if (err)
a33c150237a20d9 Chao Yu 2018-08-05 934 return err;
a33c150237a20d9 Chao Yu 2018-08-05 935
c10c98203222f4b Chao Yu 2020-02-27 936 spin_lock(&F2FS_I(inode)->i_size_lock);
cfb9a34d147b8d0 Jaegeuk Kim 2019-09-03 937 inode->i_mtime = inode->i_ctime = current_time(inode);
a0d00fad353d4a3 Chao Yu 2017-10-09 938 F2FS_I(inode)->last_disk_size = i_size_read(inode);
c10c98203222f4b Chao Yu 2020-02-27 939 spin_unlock(&F2FS_I(inode)->i_size_lock);
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 940 }
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 941
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 @942 __setattr_copy(inode, attr);
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 943
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 944 if (attr->ia_valid & ATTR_MODE) {
4d57b86dd86404f Chao Yu 2018-05-30 945 err = posix_acl_chmod(inode, f2fs_get_inode_mode(inode));
91942321e4c9f84 Jaegeuk Kim 2016-05-20 946 if (err || is_inode_flag_set(inode, FI_ACL_MODE)) {
91942321e4c9f84 Jaegeuk Kim 2016-05-20 947 inode->i_mode = F2FS_I(inode)->i_acl_mode;
91942321e4c9f84 Jaegeuk Kim 2016-05-20 948 clear_inode_flag(inode, FI_ACL_MODE);
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 949 }
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 950 }
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 951
c0ed4405a99ec9b Yunlei He 2016-12-11 952 /* file size may changed here */
ca597bddedd9490 Chao Yu 2019-02-23 953 f2fs_mark_inode_dirty_sync(inode, true);
15d04354555fdfe Jaegeuk Kim 2016-10-14 954
15d04354555fdfe Jaegeuk Kim 2016-10-14 955 /* inode change will produce dirty node pages flushed by checkpoint */
15d04354555fdfe Jaegeuk Kim 2016-10-14 956 f2fs_balance_fs(F2FS_I_SB(inode), true);
15d04354555fdfe Jaegeuk Kim 2016-10-14 957
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 958 return err;
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 959 }
fbfa2cc58d5363f Jaegeuk Kim 2012-11-02 960
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
Re: [PATCH v6] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces
by kernel test robot
Hi Vincent,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on bff6f1db91e330d7fba56f815cdbc412c75fe163 v5.10-rc3 next-20201113]
[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]
url: https://github.com/0day-ci/linux/commits/Vincent-Mailhol/can-usb-etas_es5...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f01c30de86f1047e9bae1b1b1417b0ce8dcd15b1
config: x86_64-randconfig-a005-20201115 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 9a85643cd357e412cff69067bb5c4840e228c2ab)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/80a9b72580bad04e879752fa5c54d278b...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Vincent-Mailhol/can-usb-etas_es58X-add-support-for-ETAS-ES58X-CAN-USB-interfaces/20201114-232854
git checkout 80a9b72580bad04e879752fa5c54d278b486e2bb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/net/can/usb/etas_es58x/es58x_core.c:745:12: error: use of undeclared identifier 'CAN_MAX_RAW_DLC'
if (dlc > CAN_MAX_RAW_DLC) {
^
drivers/net/can/usb/etas_es58x/es58x_core.c:748:22: error: use of undeclared identifier 'CAN_MAX_RAW_DLC'
__func__, dlc, CAN_MAX_RAW_DLC);
^
>> drivers/net/can/usb/etas_es58x/es58x_core.c:753:9: error: implicit declaration of function 'can_fd_dlc2len' [-Werror,-Wimplicit-function-declaration]
len = can_fd_dlc2len(dlc);
^
drivers/net/can/usb/etas_es58x/es58x_core.c:753:9: note: did you mean 'can_dlc2len'?
include/linux/can/dev.h:190:4: note: 'can_dlc2len' declared here
u8 can_dlc2len(u8 can_dlc);
^
>> drivers/net/can/usb/etas_es58x/es58x_core.c:756:9: error: implicit declaration of function 'can_cc_dlc2len' [-Werror,-Wimplicit-function-declaration]
len = can_cc_dlc2len(dlc);
^
drivers/net/can/usb/etas_es58x/es58x_core.c:756:9: note: did you mean 'can_dlc2len'?
include/linux/can/dev.h:190:4: note: 'can_dlc2len' declared here
u8 can_dlc2len(u8 can_dlc);
^
>> drivers/net/can/usb/etas_es58x/es58x_core.c:775:3: error: implicit declaration of function 'can_frame_set_cc_len' [-Werror,-Wimplicit-function-declaration]
can_frame_set_cc_len(ccf, dlc, es58x_priv(netdev)->can.ctrlmode);
^
5 errors generated.
--
>> drivers/net/can/usb/etas_es58x/es581_4.c:385:20: error: implicit declaration of function 'can_get_cc_dlc' [-Werror,-Wimplicit-function-declaration]
tx_can_msg->dlc = can_get_cc_dlc(cf, priv->can.ctrlmode);
^
>> drivers/net/can/usb/etas_es58x/es581_4.c:387:41: error: no member named 'len' in 'struct can_frame'
memcpy(tx_can_msg->data, cf->data, cf->len);
~~ ^
>> drivers/net/can/usb/etas_es58x/es581_4.c:391:13: error: implicit declaration of function 'can_cc_dlc2len' [-Werror,-Wimplicit-function-declaration]
msg_len += es581_4_sizeof_rx_tx_msg(*tx_can_msg);
^
drivers/net/can/usb/etas_es58x/es581_4.c:30:29: note: expanded from macro 'es581_4_sizeof_rx_tx_msg'
offsetof(typeof(msg), data[can_cc_dlc2len((msg).dlc)])
^
drivers/net/can/usb/etas_es58x/es581_4.c:391:13: note: did you mean 'can_dlc2len'?
drivers/net/can/usb/etas_es58x/es581_4.c:30:29: note: expanded from macro 'es581_4_sizeof_rx_tx_msg'
offsetof(typeof(msg), data[can_cc_dlc2len((msg).dlc)])
^
include/linux/can/dev.h:190:4: note: 'can_dlc2len' declared here
u8 can_dlc2len(u8 can_dlc);
^
>> drivers/net/can/usb/etas_es58x/es581_4.c:515:48: error: use of undeclared identifier 'CAN_CTRLMODE_CC_LEN8_DLC'
.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK | CAN_CTRLMODE_CC_LEN8_DLC,
^
4 errors generated.
--
>> drivers/net/can/usb/etas_es58x/es58x_fd.c:119:24: error: implicit declaration of function 'can_cc_dlc2len' [-Werror,-Wimplicit-function-declaration]
u16 rx_can_msg_len = es58x_fd_sizeof_rx_tx_msg(*rx_can_msg);
^
drivers/net/can/usb/etas_es58x/es58x_fd.c:36:3: note: expanded from macro 'es58x_fd_sizeof_rx_tx_msg'
can_cc_dlc2len(__msg.dlc); \
^
drivers/net/can/usb/etas_es58x/es58x_fd.c:119:24: note: did you mean 'can_dlc2len'?
drivers/net/can/usb/etas_es58x/es58x_fd.c:36:3: note: expanded from macro 'es58x_fd_sizeof_rx_tx_msg'
can_cc_dlc2len(__msg.dlc); \
^
include/linux/can/dev.h:190:4: note: 'can_dlc2len' declared here
u8 can_dlc2len(u8 can_dlc);
^
>> drivers/net/can/usb/etas_es58x/es58x_fd.c:141:11: error: implicit declaration of function 'can_fd_len2dlc' [-Werror,-Wimplicit-function-declaration]
dlc = can_fd_len2dlc(rx_can_msg->len);
^
drivers/net/can/usb/etas_es58x/es58x_fd.c:141:11: note: did you mean 'can_len2dlc'?
include/linux/can/dev.h:193:4: note: 'can_len2dlc' declared here
u8 can_len2dlc(u8 len);
^
>> drivers/net/can/usb/etas_es58x/es58x_fd.c:371:25: error: no member named 'len' in 'struct can_frame'
tx_can_msg->len = cf->len;
~~ ^
>> drivers/net/can/usb/etas_es58x/es58x_fd.c:373:21: error: implicit declaration of function 'can_get_cc_dlc' [-Werror,-Wimplicit-function-declaration]
tx_can_msg->dlc = can_get_cc_dlc(cf, priv->can.ctrlmode);
^
drivers/net/can/usb/etas_es58x/es58x_fd.c:374:41: error: no member named 'len' in 'struct can_frame'
memcpy(tx_can_msg->data, cf->data, cf->len);
~~ ^
drivers/net/can/usb/etas_es58x/es58x_fd.c:377:13: error: implicit declaration of function 'can_cc_dlc2len' [-Werror,-Wimplicit-function-declaration]
msg_len += es58x_fd_sizeof_rx_tx_msg(*tx_can_msg);
^
drivers/net/can/usb/etas_es58x/es58x_fd.c:36:3: note: expanded from macro 'es58x_fd_sizeof_rx_tx_msg'
can_cc_dlc2len(__msg.dlc); \
^
>> drivers/net/can/usb/etas_es58x/es58x_fd.c:617:6: error: use of undeclared identifier 'CAN_CTRLMODE_CC_LEN8_DLC'
CAN_CTRLMODE_CC_LEN8_DLC,
^
7 errors generated.
vim +/CAN_MAX_RAW_DLC +745 drivers/net/can/usb/etas_es58x/es58x_core.c
718
719 /**
720 * es58x_rx_can_msg() - Handle a received a CAN message.
721 * @netdev: CAN network device.
722 * @timestamp: Hardware time stamp (only relevant in rx branches).
723 * @data: CAN payload.
724 * @can_id: CAN ID.
725 * @es58x_flags: Please refer to enum es58x_flag.
726 * @dlc: Data Length Code (raw value).
727 *
728 * Fill up a CAN skb and post it.
729 *
730 * This function handles the case where the DLC of a classical CAN
731 * frame is greater than CAN_MAX_DLEN (c.f. the len8_dlc field of
732 * struct can_frame).
733 *
734 * Return: zero on success.
735 */
736 int es58x_rx_can_msg(struct net_device *netdev, u64 timestamp, const u8 *data,
737 canid_t can_id, enum es58x_flag es58x_flags, u8 dlc)
738 {
739 struct canfd_frame *cfd;
740 struct can_frame *ccf;
741 struct sk_buff *skb;
742 u8 len;
743 bool is_can_fd = !!(es58x_flags & ES58X_FLAG_FD_DATA);
744
> 745 if (dlc > CAN_MAX_RAW_DLC) {
746 netdev_err(netdev,
747 "%s: DLC is %d but maximum should be %d\n",
748 __func__, dlc, CAN_MAX_RAW_DLC);
749 return -EMSGSIZE;
750 }
751
752 if (is_can_fd) {
> 753 len = can_fd_dlc2len(dlc);
754 skb = alloc_canfd_skb(netdev, &cfd);
755 } else {
> 756 len = can_cc_dlc2len(dlc);
757 skb = alloc_can_skb(netdev, &ccf);
758 cfd = (struct canfd_frame *)ccf;
759 }
760
761 if (!skb) {
762 netdev->stats.rx_dropped++;
763 return -ENOMEM;
764 }
765 cfd->can_id = can_id;
766 if (es58x_flags & ES58X_FLAG_EFF)
767 cfd->can_id |= CAN_EFF_FLAG;
768 if (is_can_fd) {
769 cfd->len = len;
770 if (es58x_flags & ES58X_FLAG_FD_BRS)
771 cfd->flags |= CANFD_BRS;
772 if (es58x_flags & ES58X_FLAG_FD_ESI)
773 cfd->flags |= CANFD_ESI;
774 } else {
> 775 can_frame_set_cc_len(ccf, dlc, es58x_priv(netdev)->can.ctrlmode);
776 if (es58x_flags & ES58X_FLAG_RTR) {
777 ccf->can_id |= CAN_RTR_FLAG;
778 len = 0;
779 }
780 }
781 memcpy(cfd->data, data, len);
782 netdev->stats.rx_packets++;
783 netdev->stats.rx_bytes += len;
784
785 es58x_set_skb_timestamp(netdev, skb, timestamp);
786 netif_rx(skb);
787
788 es58x_priv(netdev)->err_passive_before_rtx_success = 0;
789
790 return 0;
791 }
792
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months