Re: [PATCH v5 2/5] btrfs: create read policy framework

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

 



Hi Anand,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on v5.6-rc2]
[also build test WARNING on next-20200219]
[cannot apply to btrfs/next]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Anand-Jain/readmirror-feature-sysfs-and-in-memory-only-approach-with-new-read_policy-device/20200219-113525
base:    11a48a5a18c63fd7621bb050228cebf13566e4d8
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

   In file included from fs/btrfs/volumes.c:18:0:
   fs/btrfs/volumes.c: In function 'find_live_mirror':
>> fs/btrfs/ctree.h:3143:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
    do {        \
       ^
>> fs/btrfs/ctree.h:3089:2: note: in expansion of macro 'btrfs_printk_ratelimited'
     btrfs_printk_ratelimited(fs_info, KERN_WARNING fmt, ##args)
     ^~~~~~~~~~~~~~~~~~~~~~~~
>> fs/btrfs/volumes.c:5367:3: note: in expansion of macro 'btrfs_warn_rl'
      btrfs_warn_rl(fs_info,
      ^~~~~~~~~~~~~
   fs/btrfs/volumes.c:5370:2: note: here
     case BTRFS_READ_POLICY_PID:
     ^~~~

vim +/btrfs_warn_rl +5367 fs/btrfs/volumes.c

  5343	
  5344	static int find_live_mirror(struct btrfs_fs_info *fs_info,
  5345				    struct map_lookup *map, int first,
  5346				    int dev_replace_is_ongoing)
  5347	{
  5348		int i;
  5349		int num_stripes;
  5350		int preferred_mirror;
  5351		int tolerance;
  5352		struct btrfs_device *srcdev;
  5353	
  5354		ASSERT((map->type &
  5355			 (BTRFS_BLOCK_GROUP_RAID1_MASK | BTRFS_BLOCK_GROUP_RAID10)));
  5356	
  5357		if (map->type & BTRFS_BLOCK_GROUP_RAID10)
  5358			num_stripes = map->sub_stripes;
  5359		else
  5360			num_stripes = map->num_stripes;
  5361	
  5362		switch (fs_info->fs_devices->read_policy) {
  5363		default:
  5364			/*
  5365			 * Shouldn't happen, just warn and use pid instead of failing.
  5366			 */
> 5367			btrfs_warn_rl(fs_info,
  5368				      "unknown read_policy type %u, fallback to pid",
  5369				      fs_info->fs_devices->read_policy);
  5370		case BTRFS_READ_POLICY_PID:
  5371			preferred_mirror = first + current->pid % num_stripes;
  5372		}
  5373	
  5374		if (dev_replace_is_ongoing &&
  5375		    fs_info->dev_replace.cont_reading_from_srcdev_mode ==
  5376		     BTRFS_DEV_REPLACE_ITEM_CONT_READING_FROM_SRCDEV_MODE_AVOID)
  5377			srcdev = fs_info->dev_replace.srcdev;
  5378		else
  5379			srcdev = NULL;
  5380	
  5381		/*
  5382		 * try to avoid the drive that is the source drive for a
  5383		 * dev-replace procedure, only choose it if no other non-missing
  5384		 * mirror is available
  5385		 */
  5386		for (tolerance = 0; tolerance < 2; tolerance++) {
  5387			if (map->stripes[preferred_mirror].dev->bdev &&
  5388			    (tolerance || map->stripes[preferred_mirror].dev != srcdev))
  5389				return preferred_mirror;
  5390			for (i = first; i < first + num_stripes; i++) {
  5391				if (map->stripes[i].dev->bdev &&
  5392				    (tolerance || map->stripes[i].dev != srcdev))
  5393					return i;
  5394			}
  5395		}
  5396	
  5397		/* we couldn't find one that doesn't fail.  Just return something
  5398		 * and the io error handling code will clean up eventually
  5399		 */
  5400		return preferred_mirror;
  5401	}
  5402	

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

Attachment: .config.gz
Description: application/gzip


[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