From: kernel test robot <lkp@intel.com>
To: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
linux-ext4@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>
Subject: [ext4:dev 11/44] fs/ext4/mballoc.c:5221:6: warning: no previous prototype for function 'ext4_free_blocks_simple'
Date: Fri, 9 Oct 2020 19:20:34 +0800 [thread overview]
Message-ID: <202010091929.BdAjFoPr-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 5678 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
head: ab7b179af3f98772f2433ddc4ace6b7924a4e862
commit: 090f311f4264ec136e6dcd19804eb9665230e67f [11/44] ext4: fast commit recovery path
config: x86_64-randconfig-a004-20201009 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 4cfc4025cc1433ca5ef1c526053fc9c4bfe64109)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git/commit/?id=090f311f4264ec136e6dcd19804eb9665230e67f
git remote add ext4 https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git
git fetch --no-tags ext4 dev
git checkout 090f311f4264ec136e6dcd19804eb9665230e67f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
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 >>):
>> fs/ext4/mballoc.c:5221:6: warning: no previous prototype for function 'ext4_free_blocks_simple' [-Wmissing-prototypes]
void ext4_free_blocks_simple(struct inode *inode, ext4_fsblk_t block,
^
fs/ext4/mballoc.c:5221:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void ext4_free_blocks_simple(struct inode *inode, ext4_fsblk_t block,
^
static
1 warning generated.
--
fs/ext4/fast_commit.c:1091:6: warning: variable 'start_time' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!test_opt2(sb, JOURNAL_FAST_COMMIT) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext4/fast_commit.c:1147:51: note: uninitialized use occurs here
commit_time = ktime_to_ns(ktime_sub(ktime_get(), start_time));
^~~~~~~~~~
include/linux/ktime.h:47:39: note: expanded from macro 'ktime_sub'
#define ktime_sub(lhs, rhs) ((lhs) - (rhs))
^~~
fs/ext4/fast_commit.c:1091:2: note: remove the 'if' if its condition is always false
if (!test_opt2(sb, JOURNAL_FAST_COMMIT) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext4/fast_commit.c:1091:6: warning: variable 'start_time' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if (!test_opt2(sb, JOURNAL_FAST_COMMIT) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext4/fast_commit.c:1147:51: note: uninitialized use occurs here
commit_time = ktime_to_ns(ktime_sub(ktime_get(), start_time));
^~~~~~~~~~
include/linux/ktime.h:47:39: note: expanded from macro 'ktime_sub'
#define ktime_sub(lhs, rhs) ((lhs) - (rhs))
^~~
fs/ext4/fast_commit.c:1091:6: note: remove the '||' if its condition is always false
if (!test_opt2(sb, JOURNAL_FAST_COMMIT) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ext4/fast_commit.c:1087:20: note: initialize the variable 'start_time' to silence this warning
ktime_t start_time, commit_time;
^
= 0
>> fs/ext4/fast_commit.c:1787:6: warning: no previous prototype for function 'ext4_fc_set_bitmaps_and_counters' [-Wmissing-prototypes]
void ext4_fc_set_bitmaps_and_counters(struct super_block *sb)
^
fs/ext4/fast_commit.c:1787:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void ext4_fc_set_bitmaps_and_counters(struct super_block *sb)
^
static
3 warnings generated.
vim +/ext4_free_blocks_simple +5221 fs/ext4/mballoc.c
5220
> 5221 void ext4_free_blocks_simple(struct inode *inode, ext4_fsblk_t block,
5222 unsigned long count)
5223 {
5224 struct buffer_head *bitmap_bh;
5225 struct super_block *sb = inode->i_sb;
5226 struct ext4_group_desc *gdp;
5227 struct buffer_head *gdp_bh;
5228 ext4_group_t group;
5229 ext4_grpblk_t blkoff;
5230 int already_freed = 0, err, i;
5231
5232 ext4_get_group_no_and_offset(sb, block, &group, &blkoff);
5233 bitmap_bh = ext4_read_block_bitmap(sb, group);
5234 if (IS_ERR(bitmap_bh)) {
5235 err = PTR_ERR(bitmap_bh);
5236 pr_warn("Failed to read block bitmap\n");
5237 return;
5238 }
5239 gdp = ext4_get_group_desc(sb, group, &gdp_bh);
5240 if (!gdp)
5241 return;
5242
5243 for (i = 0; i < count; i++) {
5244 if (!mb_test_bit(blkoff + i, bitmap_bh->b_data))
5245 already_freed++;
5246 }
5247 mb_clear_bits(bitmap_bh->b_data, blkoff, count);
5248 err = ext4_handle_dirty_metadata(NULL, NULL, bitmap_bh);
5249 if (err)
5250 return;
5251 ext4_free_group_clusters_set(
5252 sb, gdp, ext4_free_group_clusters(sb, gdp) +
5253 count - already_freed);
5254 ext4_block_bitmap_csum_set(sb, group, gdp, bitmap_bh);
5255 ext4_group_desc_csum_set(sb, group, gdp);
5256 ext4_handle_dirty_metadata(NULL, NULL, gdp_bh);
5257 sync_dirty_buffer(bitmap_bh);
5258 sync_dirty_buffer(gdp_bh);
5259 brelse(bitmap_bh);
5260 }
5261
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35031 bytes --]
reply other threads:[~2020-10-09 11:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202010091929.BdAjFoPr-lkp@intel.com \
--to=lkp@intel.com \
--cc=clang-built-linux@googlegroups.com \
--cc=harshadshirwadkar@gmail.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).