All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [ext4:dev 9/44] fs/ext4/fast_commit.c:1135 ext4_fc_commit() error: uninitialized symbol 'start_time'.
Date: Fri, 09 Oct 2020 15:13:06 +0800	[thread overview]
Message-ID: <202010091501.RMldRph2-lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
CC: linux-ext4(a)vger.kernel.org
TO: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
CC: "Theodore Ts'o" <tytso@mit.edu>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
head:   ab7b179af3f98772f2433ddc4ace6b7924a4e862
commit: 96df8fb629b26ce3b0b10c9b730965788786bb8c [9/44] ext4: main fast-commit commit path
:::::: branch date: 5 hours ago
:::::: commit date: 7 days ago
config: i386-randconfig-m021-20201009 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

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

smatch warnings:
fs/ext4/fast_commit.c:1135 ext4_fc_commit() error: uninitialized symbol 'start_time'.

vim +/start_time +1135 fs/ext4/fast_commit.c

96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1061  
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1062  /*
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1063   * The main commit entry point. Performs a fast commit for transaction
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1064   * commit_tid if needed. If it's not possible to perform a fast commit
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1065   * due to various reasons, we fall back to full commit. Returns 0
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1066   * on success, error otherwise.
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1067   */
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1068  int ext4_fc_commit(journal_t *journal, tid_t commit_tid)
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1069  {
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1070  	struct super_block *sb = (struct super_block *)(journal->j_private);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1071  	struct ext4_sb_info *sbi = EXT4_SB(sb);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1072  	int nblks = 0, ret, bsize = journal->j_blocksize;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1073  	int subtid = atomic_read(&sbi->s_fc_subtid);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1074  	int reason = EXT4_FC_REASON_OK, fc_bufs_before = 0;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1075  	ktime_t start_time, commit_time;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1076  
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1077  	trace_ext4_fc_commit_start(sb);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1078  
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1079  	if (!test_opt2(sb, JOURNAL_FAST_COMMIT) ||
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1080  		(ext4_fc_is_ineligible(sb))) {
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1081  		reason = EXT4_FC_REASON_INELIGIBLE;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1082  		goto out;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1083  	}
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1084  
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1085  	start_time = ktime_get();
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1086  restart_fc:
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1087  	ret = jbd2_fc_start(journal, commit_tid);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1088  	if (ret == -EALREADY) {
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1089  		/* There was an ongoing commit, check if we need to restart */
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1090  		if (atomic_read(&sbi->s_fc_subtid) <= subtid &&
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1091  			commit_tid > journal->j_commit_sequence)
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1092  			goto restart_fc;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1093  		reason = EXT4_FC_REASON_ALREADY_COMMITTED;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1094  		goto out;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1095  	} else if (ret) {
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1096  		sbi->s_fc_stats.fc_ineligible_reason_count[EXT4_FC_COMMIT_FAILED]++;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1097  		reason = EXT4_FC_REASON_FC_START_FAILED;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1098  		goto out;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1099  	}
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1100  
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1101  	fc_bufs_before = (sbi->s_fc_bytes + bsize - 1) / bsize;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1102  	ret = ext4_fc_perform_commit(journal);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1103  	if (ret < 0) {
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1104  		sbi->s_fc_stats.fc_ineligible_reason_count[EXT4_FC_COMMIT_FAILED]++;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1105  		reason = EXT4_FC_REASON_FC_FAILED;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1106  		goto out;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1107  	}
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1108  	nblks = (sbi->s_fc_bytes + bsize - 1) / bsize - fc_bufs_before;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1109  	ret = jbd2_fc_wait_bufs(journal, nblks);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1110  	if (ret < 0) {
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1111  		sbi->s_fc_stats.fc_ineligible_reason_count[EXT4_FC_COMMIT_FAILED]++;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1112  		reason = EXT4_FC_REASON_FC_FAILED;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1113  		goto out;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1114  	}
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1115  	atomic_inc(&sbi->s_fc_subtid);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1116  	jbd2_fc_stop(journal);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1117  out:
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1118  	/* Has any ineligible update happened since we started? */
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1119  	if (reason == EXT4_FC_REASON_OK && ext4_fc_is_ineligible(sb)) {
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1120  		sbi->s_fc_stats.fc_ineligible_reason_count[EXT4_FC_COMMIT_FAILED]++;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1121  		reason = EXT4_FC_REASON_INELIGIBLE;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1122  	}
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1123  
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1124  	spin_lock(&sbi->s_fc_lock);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1125  	if (reason != EXT4_FC_REASON_OK &&
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1126  		reason != EXT4_FC_REASON_ALREADY_COMMITTED) {
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1127  		sbi->s_fc_stats.fc_ineligible_commits++;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1128  	} else {
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1129  		sbi->s_fc_stats.fc_num_commits++;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1130  		sbi->s_fc_stats.fc_numblks += nblks;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1131  	}
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1132  	spin_unlock(&sbi->s_fc_lock);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1133  	nblks = (reason == EXT4_FC_REASON_OK) ? nblks : 0;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1134  	trace_ext4_fc_commit_stop(sb, nblks, reason);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18 @1135  	commit_time = ktime_to_ns(ktime_sub(ktime_get(), start_time));
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1136  	/*
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1137  	 * weight the commit time higher than the average time so we don't
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1138  	 * react too strongly to vast changes in the commit time
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1139  	 */
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1140  	if (likely(sbi->s_fc_avg_commit_time))
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1141  		sbi->s_fc_avg_commit_time = (commit_time +
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1142  				sbi->s_fc_avg_commit_time * 3) / 4;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1143  	else
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1144  		sbi->s_fc_avg_commit_time = commit_time;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1145  	jbd_debug(1,
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1146  		"Fast commit ended with blks = %d, reason = %d, subtid - %d",
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1147  		nblks, reason, subtid);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1148  	if (reason == EXT4_FC_REASON_FC_FAILED)
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1149  		return jbd2_fc_stop_do_commit(journal, commit_tid);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1150  	if (reason == EXT4_FC_REASON_FC_START_FAILED ||
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1151  		reason == EXT4_FC_REASON_INELIGIBLE)
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1152  		return jbd2_complete_transaction(journal, commit_tid);
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1153  	return 0;
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1154  }
96df8fb629b26ce Harshad Shirwadkar 2020-09-18  1155  

---
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: 35116 bytes --]

             reply	other threads:[~2020-10-09  7:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09  7:13 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-10-09 12:17 [ext4:dev 9/44] fs/ext4/fast_commit.c:1135 ext4_fc_commit() error: uninitialized symbol 'start_time' Dan Carpenter
2020-10-09 12:17 ` Dan Carpenter
2020-10-09 12:17 ` Dan Carpenter

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=202010091501.RMldRph2-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@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.