* [linkinjeon-exfat:iomap-work 8/9] fs/exfat/file.c:303:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true
@ 2026-05-12 2:24 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-05-12 2:24 UTC (permalink / raw)
To: Namjae Jeon; +Cc: llvm, oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat.git iomap-work
head: 6bbe9d8bf6e38726b6d4421a7b144186d8e10a9f
commit: c5b2f44ae0af3036dffc5f3252cd807e42ac8d2b [8/9] exfat: add iomap direct I/O support
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20260512/202605120425.jIp6e2MN-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260512/202605120425.jIp6e2MN-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605120425.jIp6e2MN-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/exfat/file.c:303:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
303 | if (ei->start_clu == 0) {
| ^~~~~~~~~~~~~~~~~~
fs/exfat/file.c:319:9: note: uninitialized use occurs here
319 | return err;
| ^~~
fs/exfat/file.c:303:2: note: remove the 'if' if its condition is always false
303 | if (ei->start_clu == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
304 | /*
| ~~
305 | * Empty start_clu != ~0 (not allocated)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306 | */
| ~~
307 | exfat_fs_error(sb, "tried to truncate zeroed cluster.");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308 | goto write_size;
| ~~~~~~~~~~~~~~~~
309 | }
| ~
fs/exfat/file.c:300:9: note: initialize the variable 'err' to silence this warning
300 | int err;
| ^
| = 0
1 warning generated.
vim +303 fs/exfat/file.c
98d917047e8b7f Namjae Jeon 2020-03-02 294
c5b2f44ae0af30 Namjae Jeon 2026-05-07 295 static int exfat_truncate(struct inode *inode)
98d917047e8b7f Namjae Jeon 2020-03-02 296 {
98d917047e8b7f Namjae Jeon 2020-03-02 297 struct super_block *sb = inode->i_sb;
98d917047e8b7f Namjae Jeon 2020-03-02 298 struct exfat_sb_info *sbi = EXFAT_SB(sb);
7dee6f57d7f22a Christophe Vu-Brugier 2021-11-02 299 struct exfat_inode_info *ei = EXFAT_I(inode);
98d917047e8b7f Namjae Jeon 2020-03-02 300 int err;
98d917047e8b7f Namjae Jeon 2020-03-02 301
98d917047e8b7f Namjae Jeon 2020-03-02 302 mutex_lock(&sbi->s_lock);
7dee6f57d7f22a Christophe Vu-Brugier 2021-11-02 @303 if (ei->start_clu == 0) {
98d917047e8b7f Namjae Jeon 2020-03-02 304 /*
98d917047e8b7f Namjae Jeon 2020-03-02 305 * Empty start_clu != ~0 (not allocated)
98d917047e8b7f Namjae Jeon 2020-03-02 306 */
98d917047e8b7f Namjae Jeon 2020-03-02 307 exfat_fs_error(sb, "tried to truncate zeroed cluster.");
98d917047e8b7f Namjae Jeon 2020-03-02 308 goto write_size;
98d917047e8b7f Namjae Jeon 2020-03-02 309 }
98d917047e8b7f Namjae Jeon 2020-03-02 310
f7cde96710a436 Yuezhang Mo 2022-03-28 311 err = __exfat_truncate(inode);
98d917047e8b7f Namjae Jeon 2020-03-02 312 if (err)
98d917047e8b7f Namjae Jeon 2020-03-02 313 goto write_size;
98d917047e8b7f Namjae Jeon 2020-03-02 314
39c1ce8eafc0ff Yuezhang Mo 2023-01-04 315 inode->i_blocks = round_up(i_size_read(inode), sbi->cluster_size) >> 9;
98d917047e8b7f Namjae Jeon 2020-03-02 316 write_size:
98d917047e8b7f Namjae Jeon 2020-03-02 317 mutex_unlock(&sbi->s_lock);
c5b2f44ae0af30 Namjae Jeon 2026-05-07 318
c5b2f44ae0af30 Namjae Jeon 2026-05-07 319 return err;
98d917047e8b7f Namjae Jeon 2020-03-02 320 }
98d917047e8b7f Namjae Jeon 2020-03-02 321
:::::: The code at line 303 was first introduced by commit
:::::: 7dee6f57d7f22a89dd214518c778aec448270d4c exfat: reuse exfat_inode_info variable instead of calling EXFAT_I()
:::::: TO: Christophe Vu-Brugier <christophe.vu-brugier@seagate.com>
:::::: CC: Namjae Jeon <linkinjeon@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread* [linkinjeon-exfat:iomap-work 8/9] fs/exfat/file.c:303:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true
@ 2026-05-11 22:06 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-05-11 22:06 UTC (permalink / raw)
To: Namjae Jeon; +Cc: llvm, oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat.git iomap-work
head: 6bbe9d8bf6e38726b6d4421a7b144186d8e10a9f
commit: c5b2f44ae0af3036dffc5f3252cd807e42ac8d2b [8/9] exfat: add iomap direct I/O support
config: hexagon-randconfig-002-20260512 (https://download.01.org/0day-ci/archive/20260512/202605120615.e3bxdRhJ-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 5bac06718f502014fade905512f1d26d578a18f3)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260512/202605120615.e3bxdRhJ-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605120615.e3bxdRhJ-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/exfat/file.c:303:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
303 | if (ei->start_clu == 0) {
| ^~~~~~~~~~~~~~~~~~
fs/exfat/file.c:319:9: note: uninitialized use occurs here
319 | return err;
| ^~~
fs/exfat/file.c:303:2: note: remove the 'if' if its condition is always false
303 | if (ei->start_clu == 0) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
304 | /*
| ~~
305 | * Empty start_clu != ~0 (not allocated)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306 | */
| ~~
307 | exfat_fs_error(sb, "tried to truncate zeroed cluster.");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
308 | goto write_size;
| ~~~~~~~~~~~~~~~~
309 | }
| ~
fs/exfat/file.c:300:9: note: initialize the variable 'err' to silence this warning
300 | int err;
| ^
| = 0
1 warning generated.
vim +303 fs/exfat/file.c
98d917047e8b7f Namjae Jeon 2020-03-02 294
c5b2f44ae0af30 Namjae Jeon 2026-05-07 295 static int exfat_truncate(struct inode *inode)
98d917047e8b7f Namjae Jeon 2020-03-02 296 {
98d917047e8b7f Namjae Jeon 2020-03-02 297 struct super_block *sb = inode->i_sb;
98d917047e8b7f Namjae Jeon 2020-03-02 298 struct exfat_sb_info *sbi = EXFAT_SB(sb);
7dee6f57d7f22a Christophe Vu-Brugier 2021-11-02 299 struct exfat_inode_info *ei = EXFAT_I(inode);
98d917047e8b7f Namjae Jeon 2020-03-02 300 int err;
98d917047e8b7f Namjae Jeon 2020-03-02 301
98d917047e8b7f Namjae Jeon 2020-03-02 302 mutex_lock(&sbi->s_lock);
7dee6f57d7f22a Christophe Vu-Brugier 2021-11-02 @303 if (ei->start_clu == 0) {
98d917047e8b7f Namjae Jeon 2020-03-02 304 /*
98d917047e8b7f Namjae Jeon 2020-03-02 305 * Empty start_clu != ~0 (not allocated)
98d917047e8b7f Namjae Jeon 2020-03-02 306 */
98d917047e8b7f Namjae Jeon 2020-03-02 307 exfat_fs_error(sb, "tried to truncate zeroed cluster.");
98d917047e8b7f Namjae Jeon 2020-03-02 308 goto write_size;
98d917047e8b7f Namjae Jeon 2020-03-02 309 }
98d917047e8b7f Namjae Jeon 2020-03-02 310
f7cde96710a436 Yuezhang Mo 2022-03-28 311 err = __exfat_truncate(inode);
98d917047e8b7f Namjae Jeon 2020-03-02 312 if (err)
98d917047e8b7f Namjae Jeon 2020-03-02 313 goto write_size;
98d917047e8b7f Namjae Jeon 2020-03-02 314
39c1ce8eafc0ff Yuezhang Mo 2023-01-04 315 inode->i_blocks = round_up(i_size_read(inode), sbi->cluster_size) >> 9;
98d917047e8b7f Namjae Jeon 2020-03-02 316 write_size:
98d917047e8b7f Namjae Jeon 2020-03-02 317 mutex_unlock(&sbi->s_lock);
c5b2f44ae0af30 Namjae Jeon 2026-05-07 318
c5b2f44ae0af30 Namjae Jeon 2026-05-07 319 return err;
98d917047e8b7f Namjae Jeon 2020-03-02 320 }
98d917047e8b7f Namjae Jeon 2020-03-02 321
:::::: The code at line 303 was first introduced by commit
:::::: 7dee6f57d7f22a89dd214518c778aec448270d4c exfat: reuse exfat_inode_info variable instead of calling EXFAT_I()
:::::: TO: Christophe Vu-Brugier <christophe.vu-brugier@seagate.com>
:::::: CC: Namjae Jeon <linkinjeon@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-12 2:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12 2:24 [linkinjeon-exfat:iomap-work 8/9] fs/exfat/file.c:303:6: warning: variable 'err' is used uninitialized whenever 'if' condition is true kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2026-05-11 22:06 kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox