Re: [PATCH] btrfs: debug: procfs-devlist: introduce procfs interface for the device list for debugging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Anand,

[auto build test ERROR on btrfs/next]
[also build test ERROR on v4.6-rc1 next-20160329]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Anand-Jain/btrfs-debug-procfs-devlist-introduce-procfs-interface-for-the-device-list-for-debugging/20160329-223332
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git next
config: x86_64-allmodconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   include/linux/compiler.h:228:8: sparse: attribute 'no_sanitize_address': unknown attribute
   fs/btrfs/procfs.c:64:17: sparse: no member 'spare' in struct btrfs_fs_devices
   fs/btrfs/procfs.c:81:25: sparse: incompatible types in comparison expression (different address spaces)
   fs/btrfs/procfs.c:101:25: sparse: no member 'failed' in struct btrfs_device
   fs/btrfs/procfs.c:102:25: sparse: no member 'offline' in struct btrfs_device
   fs/btrfs/procfs.c:193:66: sparse: no member 'spare' in struct btrfs_fs_devices
   fs/btrfs/procfs.c:213:48: sparse: incompatible types in comparison expression (different address spaces)
   fs/btrfs/procfs.c:232:71: sparse: no member 'failed' in struct btrfs_device
   fs/btrfs/procfs.c:233:70: sparse: no member 'offline' in struct btrfs_device
   fs/btrfs/procfs.c: In function 'btrfs_print_devlist':
>> fs/btrfs/procfs.c:64:51: error: 'struct btrfs_fs_devices' has no member named 'spare'
      BTRFS_SEQ_PRINT("\tspare:\t\t\t%d\n", fs_devices->spare);
                                                      ^
   fs/btrfs/procfs.c:19:30: note: in definition of macro 'BTRFS_SEQ_PRINT'
      snprintf(str, BPSL, plist, arg);\
                                 ^
>> fs/btrfs/procfs.c:101:49: error: 'struct btrfs_device' has no member named 'failed'
       BTRFS_SEQ_PRINT("\t\tfailed:\t\t%d\n", device->failed);
                                                    ^
   fs/btrfs/procfs.c:19:30: note: in definition of macro 'BTRFS_SEQ_PRINT'
      snprintf(str, BPSL, plist, arg);\
                                 ^
>> fs/btrfs/procfs.c:102:48: error: 'struct btrfs_device' has no member named 'offline'
       BTRFS_SEQ_PRINT("\t\toffline:\t%d\n", device->offline);
                                                   ^
   fs/btrfs/procfs.c:19:30: note: in definition of macro 'BTRFS_SEQ_PRINT'
      snprintf(str, BPSL, plist, arg);\
                                 ^
   fs/btrfs/procfs.c: In function 'btrfs_printk_fsdev':
   fs/btrfs/procfs.c:193:52: error: 'struct btrfs_fs_devices' has no member named 'spare'
      printk(KERN_INFO "\tspare:\t\t\t%d\n", fs_devices->spare);
                                                       ^
   fs/btrfs/procfs.c:232:50: error: 'struct btrfs_device' has no member named 'failed'
       printk(KERN_INFO "\t\tfailed:\t\t%d\n", device->failed);
                                                     ^
   fs/btrfs/procfs.c:233:49: error: 'struct btrfs_device' has no member named 'offline'
       printk(KERN_INFO "\t\toffline:\t%d\n", device->offline);
                                                    ^

sparse warnings: (new ones prefixed by >>)

   include/linux/compiler.h:228:8: sparse: attribute 'no_sanitize_address': unknown attribute
   fs/btrfs/procfs.c:64:17: sparse: no member 'spare' in struct btrfs_fs_devices
>> fs/btrfs/procfs.c:81:25: sparse: incompatible types in comparison expression (different address spaces)
   fs/btrfs/procfs.c:101:25: sparse: no member 'failed' in struct btrfs_device
   fs/btrfs/procfs.c:102:25: sparse: no member 'offline' in struct btrfs_device
   fs/btrfs/procfs.c:193:66: sparse: no member 'spare' in struct btrfs_fs_devices
   fs/btrfs/procfs.c:213:48: sparse: incompatible types in comparison expression (different address spaces)
   fs/btrfs/procfs.c:232:71: sparse: no member 'failed' in struct btrfs_device
   fs/btrfs/procfs.c:233:70: sparse: no member 'offline' in struct btrfs_device
   fs/btrfs/procfs.c: In function 'btrfs_print_devlist':
   fs/btrfs/procfs.c:64:51: error: 'struct btrfs_fs_devices' has no member named 'spare'
      BTRFS_SEQ_PRINT("\tspare:\t\t\t%d\n", fs_devices->spare);
                                                      ^
   fs/btrfs/procfs.c:19:30: note: in definition of macro 'BTRFS_SEQ_PRINT'
      snprintf(str, BPSL, plist, arg);\
                                 ^
   fs/btrfs/procfs.c:101:49: error: 'struct btrfs_device' has no member named 'failed'
       BTRFS_SEQ_PRINT("\t\tfailed:\t\t%d\n", device->failed);
                                                    ^
   fs/btrfs/procfs.c:19:30: note: in definition of macro 'BTRFS_SEQ_PRINT'
      snprintf(str, BPSL, plist, arg);\
                                 ^
   fs/btrfs/procfs.c:102:48: error: 'struct btrfs_device' has no member named 'offline'
       BTRFS_SEQ_PRINT("\t\toffline:\t%d\n", device->offline);
                                                   ^
   fs/btrfs/procfs.c:19:30: note: in definition of macro 'BTRFS_SEQ_PRINT'
      snprintf(str, BPSL, plist, arg);\
                                 ^
   fs/btrfs/procfs.c: In function 'btrfs_printk_fsdev':
   fs/btrfs/procfs.c:193:52: error: 'struct btrfs_fs_devices' has no member named 'spare'
      printk(KERN_INFO "\tspare:\t\t\t%d\n", fs_devices->spare);
                                                       ^
   fs/btrfs/procfs.c:232:50: error: 'struct btrfs_device' has no member named 'failed'
       printk(KERN_INFO "\t\tfailed:\t\t%d\n", device->failed);
                                                     ^
   fs/btrfs/procfs.c:233:49: error: 'struct btrfs_device' has no member named 'offline'
       printk(KERN_INFO "\t\toffline:\t%d\n", device->offline);
                                                    ^

vim +64 fs/btrfs/procfs.c

    13	void btrfs_print_devlist(struct seq_file *seq)
    14	{
    15	
    16		/* Btrfs Procfs String Len */
    17	#define BPSL	256
    18	#define BTRFS_SEQ_PRINT(plist, arg)\
  > 19			snprintf(str, BPSL, plist, arg);\
    20			if (sprt)\
    21				seq_printf(seq, "\t");\
    22			seq_printf(seq, str)
    23	
    24		char str[BPSL];
    25		struct btrfs_device *device;
    26		struct btrfs_fs_devices *fs_devices;
    27		struct btrfs_fs_devices *cur_fs_devices;
    28		struct btrfs_fs_devices *sprt; //sprout fs devices
    29		struct list_head *fs_uuids = btrfs_get_fs_uuids();
    30		struct list_head *cur_uuid;
    31	
    32		seq_printf(seq, "\n#Its Experimental, parameters may change without notice.\n\n");
    33	
    34		mutex_lock(&uuid_mutex);
    35		/* Todo: there must be better way than nested locks */
    36		list_for_each(cur_uuid, fs_uuids) {
    37			cur_fs_devices  = list_entry(cur_uuid, struct btrfs_fs_devices, list);
    38	
    39			mutex_lock(&cur_fs_devices->device_list_mutex);
    40	
    41			fs_devices = cur_fs_devices;
    42			sprt = NULL;
    43	
    44	again_fs_devs:
    45			if (sprt) {
    46				BTRFS_SEQ_PRINT("[[seed_fsid: %pU]]\n", fs_devices->fsid);
    47				BTRFS_SEQ_PRINT("\tsprout_fsid:\t\t%pU\n", sprt->fsid);
    48			} else {
    49				BTRFS_SEQ_PRINT("[fsid: %pU]\n", fs_devices->fsid);
    50			}
    51			if (fs_devices->seed) {
    52				BTRFS_SEQ_PRINT("\tseed_fsid:\t\t%pU\n", fs_devices->seed->fsid);
    53			}
    54			BTRFS_SEQ_PRINT("\tfs_devs_addr:\t\t%p\n", fs_devices);
    55			BTRFS_SEQ_PRINT("\tnum_devices:\t\t%llu\n", fs_devices->num_devices);
    56			BTRFS_SEQ_PRINT("\topen_devices:\t\t%llu\n", fs_devices->open_devices);
    57			BTRFS_SEQ_PRINT("\trw_devices:\t\t%llu\n", fs_devices->rw_devices);
    58			BTRFS_SEQ_PRINT("\tmissing_devices:\t%llu\n", fs_devices->missing_devices);
    59			BTRFS_SEQ_PRINT("\ttotal_rw_devices:\t%llu\n", fs_devices->total_rw_bytes);
    60			BTRFS_SEQ_PRINT("\ttotal_devices:\t\t%llu\n", fs_devices->total_devices);
    61			BTRFS_SEQ_PRINT("\topened:\t\t\t%d\n", fs_devices->opened);
    62			BTRFS_SEQ_PRINT("\tseeding:\t\t%d\n", fs_devices->seeding);
    63			BTRFS_SEQ_PRINT("\trotating:\t\t%d\n", fs_devices->rotating);
  > 64			BTRFS_SEQ_PRINT("\tspare:\t\t\t%d\n", fs_devices->spare);
    65	
    66			BTRFS_SEQ_PRINT("\tfsid_kobj_state:\t%d\n", fs_devices->fsid_kobj.state_initialized);
    67			BTRFS_SEQ_PRINT("\tfsid_kobj_insysfs:\t%d\n", fs_devices->fsid_kobj.state_in_sysfs);
    68	
    69			if (fs_devices->device_dir_kobj) {
    70			BTRFS_SEQ_PRINT("\tdevice_kobj_state:\t%d\n", fs_devices->device_dir_kobj->state_initialized);
    71			BTRFS_SEQ_PRINT("\tdevice_kobj_insysfs:\t%d\n", fs_devices->device_dir_kobj->state_in_sysfs);
    72			} else {
    73			BTRFS_SEQ_PRINT("\tdevice_kobj_state:\t%s\n", "null");
    74			BTRFS_SEQ_PRINT("\tdevice_kobj_insysfs:\t%s\n", "null");
    75			}
    76	
    77			list_for_each_entry(device, &fs_devices->devices, dev_list) {
    78				BTRFS_SEQ_PRINT("\t[[uuid: %pU]]\n", device->uuid);
    79				BTRFS_SEQ_PRINT("\t\tdev_addr:\t%p\n", device);
    80				rcu_read_lock();
  > 81				BTRFS_SEQ_PRINT("\t\tdevice:\t\t%s\n",
    82					device->name ? rcu_str_deref(device->name): "(null)");
    83				rcu_read_unlock();
    84				BTRFS_SEQ_PRINT("\t\tdevid:\t\t%llu\n", device->devid);
    85				if (device->dev_root) {
    86					BTRFS_SEQ_PRINT("\t\tdev_root_fsid:\t%pU\n",
    87							device->dev_root->fs_info->fsid);
    88				}
    89				BTRFS_SEQ_PRINT("\t\tgeneration:\t%llu\n", device->generation);
    90				BTRFS_SEQ_PRINT("\t\ttotal_bytes:\t%llu\n", device->total_bytes);
    91				BTRFS_SEQ_PRINT("\t\tdev_totalbytes:\t%llu\n", device->disk_total_bytes);
    92				BTRFS_SEQ_PRINT("\t\tbytes_used:\t%llu\n", device->bytes_used);
    93				BTRFS_SEQ_PRINT("\t\ttype:\t\t%llu\n", device->type);
    94				BTRFS_SEQ_PRINT("\t\tio_align:\t%u\n", device->io_align);
    95				BTRFS_SEQ_PRINT("\t\tio_width:\t%u\n", device->io_width);
    96				BTRFS_SEQ_PRINT("\t\tsector_size:\t%u\n", device->sector_size);
    97				BTRFS_SEQ_PRINT("\t\tmode:\t\t0x%llx\n", (u64)device->mode);
    98				BTRFS_SEQ_PRINT("\t\twriteable:\t%d\n", device->writeable);
    99				BTRFS_SEQ_PRINT("\t\tin_fs_metadata:\t%d\n", device->in_fs_metadata);
   100				BTRFS_SEQ_PRINT("\t\tmissing:\t%d\n", device->missing);
 > 101				BTRFS_SEQ_PRINT("\t\tfailed:\t\t%d\n", device->failed);
 > 102				BTRFS_SEQ_PRINT("\t\toffline:\t%d\n", device->offline);
   103				BTRFS_SEQ_PRINT("\t\tcan_discard:\t%d\n", device->can_discard);
   104				BTRFS_SEQ_PRINT("\t\treplace_tgtdev:\t%d\n",
   105									device->is_tgtdev_for_dev_replace);
   106				BTRFS_SEQ_PRINT("\t\tactive_pending:\t%d\n", device->running_pending);
   107				BTRFS_SEQ_PRINT("\t\tnobarriers:\t%d\n", device->nobarriers);
   108				BTRFS_SEQ_PRINT("\t\tdevstats_valid:\t%d\n", device->dev_stats_valid);
   109				BTRFS_SEQ_PRINT("\t\tbdev:\t\t%s\n", device->bdev ? "not_null":"null");
   110			}
   111	
   112			if (fs_devices->seed) {
   113				sprt = fs_devices;
   114				fs_devices = fs_devices->seed;
   115				goto again_fs_devs;
   116			}
   117			seq_printf(seq, "\n");
   118	
   119			mutex_unlock(&cur_fs_devices->device_list_mutex);
   120		}
   121		mutex_unlock(&uuid_mutex);
   122	}
   123	static int btrfs_devlist_show(struct seq_file *seq, void *offset)
   124	{
   125		btrfs_print_devlist(seq);
   126		return 0;
   127	}
   128	
   129	static int btrfs_seq_open(struct inode *inode, struct file *file)
   130	{
   131		return single_open(file, btrfs_devlist_show, PDE_DATA(inode));
   132	}
   133	
   134	static const struct file_operations btrfs_seq_fops = {
   135		.owner   = THIS_MODULE,
   136		.open    = btrfs_seq_open,
   137		.read    = seq_read,
   138		.llseek  = seq_lseek,
   139		.release = single_release,
   140	};
   141	
   142	void btrfs_init_procfs(void)
   143	{
   144		btrfs_proc_root = proc_mkdir(BTRFS_PROC_PATH, NULL);
   145		if (btrfs_proc_root)
   146			proc_create_data(BTRFS_PROC_DEVLIST, S_IRUGO, btrfs_proc_root,
   147						&btrfs_seq_fops, NULL);
   148		return;
   149	}
   150	
   151	void btrfs_exit_procfs(void)
   152	{
   153		if (btrfs_proc_root)
   154			remove_proc_entry(BTRFS_PROC_DEVLIST, btrfs_proc_root);
   155		remove_proc_entry(BTRFS_PROC_PATH, NULL);
   156	}
   157	
   158	void btrfs_printk_fsdev(void)
   159	{
   160		struct btrfs_device *device;
   161		struct btrfs_fs_devices *fs_devices;
   162		struct btrfs_fs_devices *cur_fs_devices;
   163		struct btrfs_fs_devices *sprt; //sprout fs devices
   164		struct list_head *fs_uuids = btrfs_get_fs_uuids();
   165		struct list_head *cur_uuid;
   166	
   167		list_for_each(cur_uuid, fs_uuids) {
   168			cur_fs_devices  = list_entry(cur_uuid, struct btrfs_fs_devices, list);
   169	
   170			fs_devices = cur_fs_devices;
   171			sprt = NULL;
   172	
   173	again_fs_devs:
   174			if (sprt) {
   175				printk(KERN_INFO "[[seed_fsid: %pU]]\n", fs_devices->fsid);
   176				printk(KERN_INFO "\tsprout_fsid:\t\t%pU\n", sprt->fsid);
   177			} else {
   178				printk(KERN_INFO "[fsid: %pU]\n", fs_devices->fsid);
   179			}
   180			if (fs_devices->seed) {
   181				printk(KERN_INFO "\tseed_fsid:\t\t%pU\n", fs_devices->seed->fsid);
   182			}
   183			printk(KERN_INFO "\tfs_devs_addr:\t\t%p\n", fs_devices);
   184			printk(KERN_INFO "\tnum_devices:\t\t%llu\n", fs_devices->num_devices);
   185			printk(KERN_INFO "\topen_devices:\t\t%llu\n", fs_devices->open_devices);
   186			printk(KERN_INFO "\trw_devices:\t\t%llu\n", fs_devices->rw_devices);
   187			printk(KERN_INFO "\tmissing_devices:\t%llu\n", fs_devices->missing_devices);
   188			printk(KERN_INFO "\ttotal_rw_devices:\t%llu\n", fs_devices->total_rw_bytes);
   189			printk(KERN_INFO "\ttotal_devices:\t\t%llu\n", fs_devices->total_devices);
   190			printk(KERN_INFO "\topened:\t\t\t%d\n", fs_devices->opened);
   191			printk(KERN_INFO "\tseeding:\t\t%d\n", fs_devices->seeding);
   192			printk(KERN_INFO "\trotating:\t\t%d\n", fs_devices->rotating);
   193			printk(KERN_INFO "\tspare:\t\t\t%d\n", fs_devices->spare);
   194	
   195			printk(KERN_INFO "\tfsid_kobj_state:\t%d\n", fs_devices->fsid_kobj.state_initialized);
   196			printk(KERN_INFO "\tfsid_kobj_insysfs:\t%d\n", fs_devices->fsid_kobj.state_in_sysfs);
   197	
   198			if (fs_devices->device_dir_kobj) {
   199			printk(KERN_INFO "\tdevice_kobj_state:\t%d\n", fs_devices->device_dir_kobj->state_initialized);
   200			printk(KERN_INFO "\tdevice_kobj_insysfs:\t%d\n", fs_devices->device_dir_kobj->state_in_sysfs);
   201			} else {
   202			printk(KERN_INFO "\tdevice_kobj_state:\t%s\n", "null");
   203			printk(KERN_INFO "\tdevice_kobj_insysfs:\t%s\n", "null");
   204			}
   205	
   206			printk(KERN_INFO "\tfs_info:\t\t%pK\n", fs_devices->fs_info);
   207	
   208			list_for_each_entry(device, &fs_devices->devices, dev_list) {
   209				printk(KERN_INFO "\t[[uuid: %pU]]\n", device->uuid);
   210				printk(KERN_INFO "\t\tdev_addr:\t%p\n", device);
   211				rcu_read_lock();
   212				printk(KERN_INFO "\t\tdevice:\t\t%s\n",
   213					device->name ? rcu_str_deref(device->name): "(null)");
   214				rcu_read_unlock();
   215				printk(KERN_INFO "\t\tdevid:\t\t%llu\n", device->devid);
   216				if (device->dev_root) {
   217					printk(KERN_INFO "\t\tdev_root_fsid:\t%pU\n",
   218							device->dev_root->fs_info->fsid);
   219				}
   220				printk(KERN_INFO "\t\tgeneration:\t%llu\n", device->generation);
   221				printk(KERN_INFO "\t\ttotal_bytes:\t%llu\n", device->total_bytes);
   222				printk(KERN_INFO "\t\tdev_totalbytes:\t%llu\n", device->disk_total_bytes);
   223				printk(KERN_INFO "\t\tbytes_used:\t%llu\n", device->bytes_used);
   224				printk(KERN_INFO "\t\ttype:\t\t%llu\n", device->type);
   225				printk(KERN_INFO "\t\tio_align:\t%u\n", device->io_align);
   226				printk(KERN_INFO "\t\tio_width:\t%u\n", device->io_width);
   227				printk(KERN_INFO "\t\tsector_size:\t%u\n", device->sector_size);
   228				printk(KERN_INFO "\t\tmode:\t\t0x%llx\n", (u64)device->mode);
   229				printk(KERN_INFO "\t\twriteable:\t%d\n", device->writeable);
   230				printk(KERN_INFO "\t\tin_fs_metadata:\t%d\n", device->in_fs_metadata);
   231				printk(KERN_INFO "\t\tmissing:\t%d\n", device->missing);
 > 232				printk(KERN_INFO "\t\tfailed:\t\t%d\n", device->failed);
   233				printk(KERN_INFO "\t\toffline:\t%d\n", device->offline);
   234				printk(KERN_INFO "\t\tcan_discard:\t%d\n", device->can_discard);
   235				printk(KERN_INFO "\t\treplace_tgtdev:\t%d\n",

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: Binary data


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux