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...
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(a)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(a)cn.fujitsu.com>
:::::: CC: Chris Mason <clm(a)fb.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org