Thread (16 messages) 16 messages, 5 authors, 2021-06-10

Re: [PATCH] btrfs: sysfs: export dev stats in devinfo directory

From: kernel test robot <hidden>
Date: 2021-06-04 15:14:32
Also in: oe-kbuild-all

Hi David,

I love your patch! Perhaps something to improve:

[auto build test WARNING on kdave/for-next]
[also build test WARNING on next-20210604]
[cannot apply to v5.13-rc4]
[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/David-Sterba/btrfs-sysfs-export-dev-stats-in-devinfo-directory/20210604-212445
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: riscv-randconfig-s032-20210604 (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-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/8a58ea51305ace4835c7abc51e46b7b64e25b793
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review David-Sterba/btrfs-sysfs-export-dev-stats-in-devinfo-directory/20210604-212445
        git checkout 8a58ea51305ace4835c7abc51e46b7b64e25b793
        # 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__' W=1 ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <redacted>

All warnings (new ones prefixed by >>):

   fs/btrfs/sysfs.c: In function 'btrfs_devinfo_stats_show':
quoted
fs/btrfs/sysfs.c:1510:17: warning: format '%d' expects argument of type 'int', but argument 4 has type 'char *' [-Wformat=]
    1510 |   "stats_valid %d\n",
         |                ~^
         |                 |
         |                 int
         |                %s
    1511 |   "write_errs %d\n"
         |   ~~~~~~~~~~~~~~~~~
         |   |
         |   char *
quoted
fs/btrfs/sysfs.c:1510:3: warning: too many arguments for format [-Wformat-extra-args]
    1510 |   "stats_valid %d\n",
         |   ^~~~~~~~~~~~~~~~~~


vim +1510 fs/btrfs/sysfs.c

  1497	
  1498	static ssize_t btrfs_devinfo_stats_show(struct kobject *kobj,
  1499			struct kobj_attribute *a, char *buf)
  1500	{
  1501		struct btrfs_device *device = container_of(kobj, struct btrfs_device,
  1502							   devid_kobj);
  1503	
  1504		/*
  1505		 * Print all at once so we get a snapshot of all values from the same
  1506		 * time. Keep them in sync and in order of definition of
  1507		 * btrfs_dev_stat_values.
  1508		 */
  1509		return scnprintf(buf, PAGE_SIZE,
1510			"stats_valid %d\n",
  1511			"write_errs %d\n"
  1512			"read_errs %d\n"
  1513			"flush_errs %d\n"
  1514			"corruption_errs %d\n"
  1515			"generation_errs %d\n",
  1516			!!(device->dev_stats_valid),
  1517			btrfs_dev_stat_read(device, BTRFS_DEV_STAT_WRITE_ERRS),
  1518			btrfs_dev_stat_read(device, BTRFS_DEV_STAT_READ_ERRS),
  1519			btrfs_dev_stat_read(device, BTRFS_DEV_STAT_FLUSH_ERRS),
  1520			btrfs_dev_stat_read(device, BTRFS_DEV_STAT_CORRUPTION_ERRS),
  1521			btrfs_dev_stat_read(device, BTRFS_DEV_STAT_GENERATION_ERRS));
  1522	}
  1523	BTRFS_ATTR(devid, stats, btrfs_devinfo_stats_show);
  1524	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help