All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH 3/3] Btrfs: only allocate necessary space when relocating a data block group
Date: Tue, 09 Jun 2020 20:07:45 +0800	[thread overview]
Message-ID: <202006092051.Jhmog4bc%lkp@intel.com> (raw)
In-Reply-To: <20200609101953.29559-1-fdmanana@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 5930 bytes --]

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on kdave/for-next]
[also build test WARNING on v5.7 next-20200608]
[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/fdmanana-kernel-org/Btrfs-remove-the-start-argument-from-btrfs_free_reserved_data_space_noquota/20200609-182248
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
config: nios2-allyesconfig (attached as .config)
compiler: nios2-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
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nios2 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

In file included from fs/btrfs/relocation.c:13:
fs/btrfs/ctree.h:2216:8: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
2216 | size_t __const btrfs_get_num_csums(void);
|        ^~~~~~~
fs/btrfs/relocation.c: In function 'prealloc_file_extent_cluster':
>> fs/btrfs/relocation.c:2587:6: warning: variable 'cur_offset' set but not used [-Wunused-but-set-variable]
2587 |  u64 cur_offset;
|      ^~~~~~~~~~

vim +/cur_offset +2587 fs/btrfs/relocation.c

5d4f98a28c7d33 Yan Zheng      2009-06-10  2574  
efa56464562991 Yan, Zheng     2010-05-16  2575  static noinline_for_stack
efa56464562991 Yan, Zheng     2010-05-16  2576  int prealloc_file_extent_cluster(struct inode *inode,
efa56464562991 Yan, Zheng     2010-05-16  2577  				 struct file_extent_cluster *cluster)
efa56464562991 Yan, Zheng     2010-05-16  2578  {
efa56464562991 Yan, Zheng     2010-05-16  2579  	u64 alloc_hint = 0;
efa56464562991 Yan, Zheng     2010-05-16  2580  	u64 start;
efa56464562991 Yan, Zheng     2010-05-16  2581  	u64 end;
efa56464562991 Yan, Zheng     2010-05-16  2582  	u64 offset = BTRFS_I(inode)->index_cnt;
efa56464562991 Yan, Zheng     2010-05-16  2583  	u64 num_bytes;
efa56464562991 Yan, Zheng     2010-05-16  2584  	int nr = 0;
efa56464562991 Yan, Zheng     2010-05-16  2585  	int ret = 0;
dcb40c196fc85c Wang Xiaoguang 2016-07-25  2586  	u64 prealloc_start = cluster->start - offset;
18513091af9483 Wang Xiaoguang 2016-07-25 @2587  	u64 cur_offset;
eb4d9ef455539b Filipe Manana  2020-06-09  2588  	u64 allocated = 0;
efa56464562991 Yan, Zheng     2010-05-16  2589  
efa56464562991 Yan, Zheng     2010-05-16  2590  	BUG_ON(cluster->start != cluster->boundary[0]);
5955102c9984fa Al Viro        2016-01-22  2591  	inode_lock(inode);
efa56464562991 Yan, Zheng     2010-05-16  2592  
8fa95e39f0371b Filipe Manana  2020-06-09  2593  	ret = btrfs_alloc_data_chunk_ondemand(BTRFS_I(inode),
eb4d9ef455539b Filipe Manana  2020-06-09  2594  					      cluster->total_bytes);
efa56464562991 Yan, Zheng     2010-05-16  2595  	if (ret)
efa56464562991 Yan, Zheng     2010-05-16  2596  		goto out;
efa56464562991 Yan, Zheng     2010-05-16  2597  
18513091af9483 Wang Xiaoguang 2016-07-25  2598  	cur_offset = prealloc_start;
efa56464562991 Yan, Zheng     2010-05-16  2599  	while (nr < cluster->nr) {
efa56464562991 Yan, Zheng     2010-05-16  2600  		start = cluster->boundary[nr] - offset;
efa56464562991 Yan, Zheng     2010-05-16  2601  		if (nr + 1 < cluster->nr)
efa56464562991 Yan, Zheng     2010-05-16  2602  			end = cluster->boundary[nr + 1] - 1 - offset;
efa56464562991 Yan, Zheng     2010-05-16  2603  		else
efa56464562991 Yan, Zheng     2010-05-16  2604  			end = cluster->end - offset;
efa56464562991 Yan, Zheng     2010-05-16  2605  
d0082371cf086e Jeff Mahoney   2012-03-01  2606  		lock_extent(&BTRFS_I(inode)->io_tree, start, end);
efa56464562991 Yan, Zheng     2010-05-16  2607  		num_bytes = end + 1 - start;
efa56464562991 Yan, Zheng     2010-05-16  2608  		ret = btrfs_prealloc_file_range(inode, 0, start,
efa56464562991 Yan, Zheng     2010-05-16  2609  						num_bytes, num_bytes,
efa56464562991 Yan, Zheng     2010-05-16  2610  						end + 1, &alloc_hint);
18513091af9483 Wang Xiaoguang 2016-07-25  2611  		cur_offset = end + 1;
eb4d9ef455539b Filipe Manana  2020-06-09  2612  		allocated += num_bytes;
d0082371cf086e Jeff Mahoney   2012-03-01  2613  		unlock_extent(&BTRFS_I(inode)->io_tree, start, end);
efa56464562991 Yan, Zheng     2010-05-16  2614  		if (ret)
efa56464562991 Yan, Zheng     2010-05-16  2615  			break;
efa56464562991 Yan, Zheng     2010-05-16  2616  		nr++;
efa56464562991 Yan, Zheng     2010-05-16  2617  	}
eb4d9ef455539b Filipe Manana  2020-06-09  2618  	if (allocated < cluster->total_bytes)
8fa95e39f0371b Filipe Manana  2020-06-09  2619  		btrfs_free_reserved_data_space_noquota(inode,
eb4d9ef455539b Filipe Manana  2020-06-09  2620  				       cluster->total_bytes - allocated);
efa56464562991 Yan, Zheng     2010-05-16  2621  out:
5955102c9984fa Al Viro        2016-01-22  2622  	inode_unlock(inode);
efa56464562991 Yan, Zheng     2010-05-16  2623  	return ret;
efa56464562991 Yan, Zheng     2010-05-16  2624  }
efa56464562991 Yan, Zheng     2010-05-16  2625  

:::::: The code at line 2587 was first introduced by commit
:::::: 18513091af9483ba84328d42092bd4d42a3c958f btrfs: update btrfs_space_info's bytes_may_use timely

:::::: TO: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
:::::: CC: Chris Mason <clm@fb.com>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 55376 bytes --]

      parent reply	other threads:[~2020-06-09 12:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 10:19 [PATCH 3/3] Btrfs: only allocate necessary space when relocating a data block group fdmanana
2020-06-09 10:50 ` Nikolay Borisov
2020-06-09 10:57   ` Filipe Manana
2020-06-09 11:28     ` Nikolay Borisov
2020-06-09 12:07 ` kernel test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202006092051.Jhmog4bc%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.