Skip to contentSkip to conversation

fs/ext4/super.c:796 update_super_work() error: uninitialized symbol 'call_notify_err'.

PATCH New Dan Carpenter 1 participant 1 message Sep 5, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 12036/12910 fs/ext4/super.c:796 update_super_work() error: uninitialized symbol 'call_notify_err'.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   a47fc304d2b678db1a5d760a7d644dac9b067752
commit: 22fe4b80ee8de5a551a27a2c91f54594b99c1db5 [12036/12910] ext4: rename s_error_work to s_sb_upd_work
config: x86_64-randconfig-161-20230902 (https://download.01.org/0day-ci/archive/20230903/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230903/[email protected]/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 <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

smatch warnings:
fs/ext4/super.c:796 update_super_work() error: uninitialized symbol 'call_notify_err'.

vim +/call_notify_err +796 fs/ext4/super.c

22fe4b80ee8de5 Theodore Ts'o     2023-08-22  753  static void update_super_work(struct work_struct *work)
c92dc856848f32 Jan Kara          2020-11-27  754  {
c92dc856848f32 Jan Kara          2020-11-27  755  	struct ext4_sb_info *sbi = container_of(work, struct ext4_sb_info,
22fe4b80ee8de5 Theodore Ts'o     2023-08-22  756  						s_sb_upd_work);
2d01ddc8660656 Jan Kara          2020-12-16  757  	journal_t *journal = sbi->s_journal;
2d01ddc8660656 Jan Kara          2020-12-16  758  	handle_t *handle;
c92dc856848f32 Jan Kara          2020-11-27  759  
2d01ddc8660656 Jan Kara          2020-12-16  760  	/*
2d01ddc8660656 Jan Kara          2020-12-16  761  	 * If the journal is still running, we have to write out superblock
2d01ddc8660656 Jan Kara          2020-12-16  762  	 * through the journal to avoid collisions of other journalled sb
2d01ddc8660656 Jan Kara          2020-12-16  763  	 * updates.
2d01ddc8660656 Jan Kara          2020-12-16  764  	 *
2d01ddc8660656 Jan Kara          2020-12-16  765  	 * We use directly jbd2 functions here to avoid recursing back into
2d01ddc8660656 Jan Kara          2020-12-16  766  	 * ext4 error handling code during handling of previous errors.
2d01ddc8660656 Jan Kara          2020-12-16  767  	 */
2d01ddc8660656 Jan Kara          2020-12-16  768  	if (!sb_rdonly(sbi->s_sb) && journal) {
558d6450c7755a Ye Bin            2021-06-15  769  		struct buffer_head *sbh = sbi->s_sbh;
58d85f2e88c97c Vitaliy Kuznetsov 2023-08-10  770  		bool call_notify_err;

Needs to be:

	bool call_notify_err = false;
2d01ddc8660656 Jan Kara          2020-12-16  771  		handle = jbd2_journal_start(journal, 1);
2d01ddc8660656 Jan Kara          2020-12-16  772  		if (IS_ERR(handle))
2d01ddc8660656 Jan Kara          2020-12-16  773  			goto write_directly;
558d6450c7755a Ye Bin            2021-06-15  774  		if (jbd2_journal_get_write_access(handle, sbh)) {
2d01ddc8660656 Jan Kara          2020-12-16  775  			jbd2_journal_stop(handle);
2d01ddc8660656 Jan Kara          2020-12-16  776  			goto write_directly;
2d01ddc8660656 Jan Kara          2020-12-16  777  		}
58d85f2e88c97c Vitaliy Kuznetsov 2023-08-10  778  
58d85f2e88c97c Vitaliy Kuznetsov 2023-08-10  779  		if (sbi->s_add_error_count > 0)
58d85f2e88c97c Vitaliy Kuznetsov 2023-08-10  780  			call_notify_err = true;
58d85f2e88c97c Vitaliy Kuznetsov 2023-08-10  781  
2d01ddc8660656 Jan Kara          2020-12-16  782  		ext4_update_super(sbi->s_sb);
558d6450c7755a Ye Bin            2021-06-15  783  		if (buffer_write_io_error(sbh) || !buffer_uptodate(sbh)) {
558d6450c7755a Ye Bin            2021-06-15  784  			ext4_msg(sbi->s_sb, KERN_ERR, "previous I/O error to "
558d6450c7755a Ye Bin            2021-06-15  785  				 "superblock detected");
558d6450c7755a Ye Bin            2021-06-15  786  			clear_buffer_write_io_error(sbh);
558d6450c7755a Ye Bin            2021-06-15  787  			set_buffer_uptodate(sbh);
558d6450c7755a Ye Bin            2021-06-15  788  		}
558d6450c7755a Ye Bin            2021-06-15  789  
558d6450c7755a Ye Bin            2021-06-15  790  		if (jbd2_journal_dirty_metadata(handle, sbh)) {
2d01ddc8660656 Jan Kara          2020-12-16  791  			jbd2_journal_stop(handle);
2d01ddc8660656 Jan Kara          2020-12-16  792  			goto write_directly;
2d01ddc8660656 Jan Kara          2020-12-16  793  		}
2d01ddc8660656 Jan Kara          2020-12-16  794  		jbd2_journal_stop(handle);
58d85f2e88c97c Vitaliy Kuznetsov 2023-08-10  795  
58d85f2e88c97c Vitaliy Kuznetsov 2023-08-10 @796  		if (call_notify_err)
d578b99443fde0 Jonathan Davies   2021-06-11  797  			ext4_notify_error_sysfs(sbi);
58d85f2e88c97c Vitaliy Kuznetsov 2023-08-10  798  
2d01ddc8660656 Jan Kara          2020-12-16  799  		return;
2d01ddc8660656 Jan Kara          2020-12-16  800  	}
2d01ddc8660656 Jan Kara          2020-12-16  801  write_directly:
2d01ddc8660656 Jan Kara          2020-12-16  802  	/*
2d01ddc8660656 Jan Kara          2020-12-16  803  	 * Write through journal failed. Write sb directly to get error info
2d01ddc8660656 Jan Kara          2020-12-16  804  	 * out and hope for the best.
2d01ddc8660656 Jan Kara          2020-12-16  805  	 */
4392fbc4bab57d Jan Kara          2020-12-16  806  	ext4_commit_super(sbi->s_sb);
d578b99443fde0 Jonathan Davies   2021-06-11  807  	ext4_notify_error_sysfs(sbi);
4327ba52afd03f Daeho Jeong       2015-10-18  808  }
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki