linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [akpm-mm:mm-nonmm-unstable 66/67] fs/ocfs2/aops.c:1133:17: warning: variable 'i' is uninitialized when used here
@ 2025-04-19  1:21 kernel test robot
  2025-04-22 20:12 ` Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2025-04-19  1:21 UTC (permalink / raw)
  To: Mark Tinguely
  Cc: llvm, oe-kbuild-all, Andrew Morton, Linux Memory Management List,
	Matthew Wilcox (Oracle),
	Joseph Qi

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
head:   d1a9b961293d30be9a865d8685590635db282957
commit: 89e3e963129e945e0333e474709bde627b6a9cee [66/67] ocfs2: fix panic in failed foilio allocation
config: s390-randconfig-001-20250419 (https://download.01.org/0day-ci/archive/20250419/202504190950.rq1NDlDz-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250419/202504190950.rq1NDlDz-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/202504190950.rq1NDlDz-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/ocfs2/aops.c:1133:17: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
    1133 |                         wc->w_folios[i] = NULL;
         |                                      ^
   fs/ocfs2/aops.c:1101:12: note: initialize the variable 'i' to silence this warning
    1101 |         int ret, i;
         |                   ^
         |                    = 0
   1 warning generated.


vim +/i +1133 fs/ocfs2/aops.c

  1088	
  1089	/*
  1090	 * Prepare a single cluster for write one cluster into the file.
  1091	 */
  1092	static int ocfs2_write_cluster(struct address_space *mapping,
  1093				       u32 *phys, unsigned int new,
  1094				       unsigned int clear_unwritten,
  1095				       unsigned int should_zero,
  1096				       struct ocfs2_alloc_context *data_ac,
  1097				       struct ocfs2_alloc_context *meta_ac,
  1098				       struct ocfs2_write_ctxt *wc, u32 cpos,
  1099				       loff_t user_pos, unsigned user_len)
  1100	{
  1101		int ret, i;
  1102		u64 p_blkno;
  1103		struct inode *inode = mapping->host;
  1104		struct ocfs2_extent_tree et;
  1105		int bpc = ocfs2_clusters_to_blocks(inode->i_sb, 1);
  1106	
  1107		if (new) {
  1108			u32 tmp_pos;
  1109	
  1110			/*
  1111			 * This is safe to call with the page locks - it won't take
  1112			 * any additional semaphores or cluster locks.
  1113			 */
  1114			tmp_pos = cpos;
  1115			ret = ocfs2_add_inode_data(OCFS2_SB(inode->i_sb), inode,
  1116						   &tmp_pos, 1, !clear_unwritten,
  1117						   wc->w_di_bh, wc->w_handle,
  1118						   data_ac, meta_ac, NULL);
  1119			/*
  1120			 * This shouldn't happen because we must have already
  1121			 * calculated the correct meta data allocation required. The
  1122			 * internal tree allocation code should know how to increase
  1123			 * transaction credits itself.
  1124			 *
  1125			 * If need be, we could handle -EAGAIN for a
  1126			 * RESTART_TRANS here.
  1127			 */
  1128			mlog_bug_on_msg(ret == -EAGAIN,
  1129					"Inode %llu: EAGAIN return during allocation.\n",
  1130					(unsigned long long)OCFS2_I(inode)->ip_blkno);
  1131			if (ret < 0) {
  1132				mlog_errno(ret);
> 1133				wc->w_folios[i] = NULL;
  1134				goto out;
  1135			}
  1136		} else if (clear_unwritten) {
  1137			ocfs2_init_dinode_extent_tree(&et, INODE_CACHE(inode),
  1138						      wc->w_di_bh);
  1139			ret = ocfs2_mark_extent_written(inode, &et,
  1140							wc->w_handle, cpos, 1, *phys,
  1141							meta_ac, &wc->w_dealloc);
  1142			if (ret < 0) {
  1143				mlog_errno(ret);
  1144				goto out;
  1145			}
  1146		}
  1147	
  1148		/*
  1149		 * The only reason this should fail is due to an inability to
  1150		 * find the extent added.
  1151		 */
  1152		ret = ocfs2_get_clusters(inode, cpos, phys, NULL, NULL);
  1153		if (ret < 0) {
  1154			mlog(ML_ERROR, "Get physical blkno failed for inode %llu, "
  1155				    "at logical cluster %u",
  1156				    (unsigned long long)OCFS2_I(inode)->ip_blkno, cpos);
  1157			goto out;
  1158		}
  1159	
  1160		BUG_ON(*phys == 0);
  1161	
  1162		p_blkno = ocfs2_clusters_to_blocks(inode->i_sb, *phys);
  1163		if (!should_zero)
  1164			p_blkno += (user_pos >> inode->i_sb->s_blocksize_bits) & (u64)(bpc - 1);
  1165	
  1166		for (i = 0; i < wc->w_num_folios; i++) {
  1167			int tmpret;
  1168	
  1169			/* This is the direct io target page. */
  1170			if (wc->w_folios[i] == NULL) {
  1171				p_blkno += (1 << (PAGE_SHIFT - inode->i_sb->s_blocksize_bits));
  1172				continue;
  1173			}
  1174	
  1175			tmpret = ocfs2_prepare_folio_for_write(inode, &p_blkno, wc,
  1176					wc->w_folios[i], cpos, user_pos, user_len,
  1177					should_zero);
  1178			if (tmpret) {
  1179				mlog_errno(tmpret);
  1180				if (ret == 0)
  1181					ret = tmpret;
  1182			}
  1183		}
  1184	
  1185		/*
  1186		 * We only have cleanup to do in case of allocating write.
  1187		 */
  1188		if (ret && new)
  1189			ocfs2_write_failure(inode, wc, user_pos, user_len);
  1190	
  1191	out:
  1192	
  1193		return ret;
  1194	}
  1195	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [akpm-mm:mm-nonmm-unstable 66/67] fs/ocfs2/aops.c:1133:17: warning: variable 'i' is uninitialized when used here
  2025-04-19  1:21 [akpm-mm:mm-nonmm-unstable 66/67] fs/ocfs2/aops.c:1133:17: warning: variable 'i' is uninitialized when used here kernel test robot
@ 2025-04-22 20:12 ` Nathan Chancellor
  2025-04-23  0:55   ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2025-04-22 20:12 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mark Tinguely, llvm, oe-kbuild-all, kernel test robot,
	Linux Memory Management List, Matthew Wilcox (Oracle),
	Joseph Qi

Hi Andrew,

On Sat, Apr 19, 2025 at 09:21:13AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
> head:   d1a9b961293d30be9a865d8685590635db282957
> commit: 89e3e963129e945e0333e474709bde627b6a9cee [66/67] ocfs2: fix panic in failed foilio allocation
> config: s390-randconfig-001-20250419 (https://download.01.org/0day-ci/archive/20250419/202504190950.rq1NDlDz-lkp@intel.com/config)
> compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250419/202504190950.rq1NDlDz-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/202504190950.rq1NDlDz-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
> >> fs/ocfs2/aops.c:1133:17: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
>     1133 |                         wc->w_folios[i] = NULL;
>          |                                      ^
>    fs/ocfs2/aops.c:1101:12: note: initialize the variable 'i' to silence this warning
>     1101 |         int ret, i;
>          |                   ^
>          |                    = 0

There appears to be something funky going on with "ocfs2: fix panic in
failed foilio allocation" in your tree, perhaps as a result of applying
v2 to mm-nonmm-unstable and v1 to mm-hotfixes-unstable? If you compare
https://git.kernel.org/akpm/mm/c/392a664f6d2740eeae23df0d29b56f444f558a7c
to https://lore.kernel.org/c879a52b-835c-4fa0-902b-8b2e9196dcbd@oracle.com/,
the second hunks do not match, which is what this is warning about. I
see this same warning in next-20250422.

Cheers,
Nathan



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [akpm-mm:mm-nonmm-unstable 66/67] fs/ocfs2/aops.c:1133:17: warning: variable 'i' is uninitialized when used here
  2025-04-22 20:12 ` Nathan Chancellor
@ 2025-04-23  0:55   ` Andrew Morton
  2025-04-23 14:13     ` [External] : " Mark Tinguely
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2025-04-23  0:55 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Mark Tinguely, llvm, oe-kbuild-all, kernel test robot,
	Linux Memory Management List, Matthew Wilcox (Oracle),
	Joseph Qi

On Tue, 22 Apr 2025 13:12:41 -0700 Nathan Chancellor <nathan@kernel.org> wrote:

> Hi Andrew,
> 
> On Sat, Apr 19, 2025 at 09:21:13AM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
> > head:   d1a9b961293d30be9a865d8685590635db282957
> > commit: 89e3e963129e945e0333e474709bde627b6a9cee [66/67] ocfs2: fix panic in failed foilio allocation
> > config: s390-randconfig-001-20250419 (https://download.01.org/0day-ci/archive/20250419/202504190950.rq1NDlDz-lkp@intel.com/config)
> > compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250419/202504190950.rq1NDlDz-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/202504190950.rq1NDlDz-lkp@intel.com/
> > 
> > All warnings (new ones prefixed by >>):
> > 
> > >> fs/ocfs2/aops.c:1133:17: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
> >     1133 |                         wc->w_folios[i] = NULL;
> >          |                                      ^
> >    fs/ocfs2/aops.c:1101:12: note: initialize the variable 'i' to silence this warning
> >     1101 |         int ret, i;
> >          |                   ^
> >          |                    = 0
> 
> There appears to be something funky going on with "ocfs2: fix panic in
> failed foilio allocation" in your tree, perhaps as a result of applying
> v2 to mm-nonmm-unstable and v1 to mm-hotfixes-unstable? If you compare
> https://git.kernel.org/akpm/mm/c/392a664f6d2740eeae23df0d29b56f444f558a7c
> to https://lore.kernel.org/c879a52b-835c-4fa0-902b-8b2e9196dcbd@oracle.com/,
> the second hunks do not match, which is what this is warning about. I
> see this same warning in next-20250422.

Thanks.  Confirms that the universe is a plot to confuse akpm.

I dropped everything and remerged the v2 patch.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [External] : Re: [akpm-mm:mm-nonmm-unstable 66/67] fs/ocfs2/aops.c:1133:17: warning: variable 'i' is uninitialized when used here
  2025-04-23  0:55   ` Andrew Morton
@ 2025-04-23 14:13     ` Mark Tinguely
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Tinguely @ 2025-04-23 14:13 UTC (permalink / raw)
  To: Andrew Morton, Nathan Chancellor
  Cc: llvm, oe-kbuild-all, kernel test robot,
	Linux Memory Management List, Matthew Wilcox (Oracle),
	Joseph Qi

On 4/22/25 7:55 PM, Andrew Morton wrote:
> On Tue, 22 Apr 2025 13:12:41 -0700 Nathan Chancellor <nathan@kernel.org> wrote:
> 
>> Hi Andrew,
>>
>> On Sat, Apr 19, 2025 at 09:21:13AM +0800, kernel test robot wrote:
>>> tree:   https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git__;!!ACWV5N9M2RV99hQ!NYsFjZmx0oSNmGPOQ57M8FqiwN9x_0uNHOsZ0H_bxMZw11U8F1-i2FIS7wctmB4sSockZwPpufGxuROeTnhBAaPs$  mm-nonmm-unstable
>>> head:   d1a9b961293d30be9a865d8685590635db282957
>>> commit: 89e3e963129e945e0333e474709bde627b6a9cee [66/67] ocfs2: fix panic in failed foilio allocation
>>> config: s390-randconfig-001-20250419 (https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/20250419/202504190950.rq1NDlDz-lkp@intel.com/config__;!!ACWV5N9M2RV99hQ!NYsFjZmx0oSNmGPOQ57M8FqiwN9x_0uNHOsZ0H_bxMZw11U8F1-i2FIS7wctmB4sSockZwPpufGxuROeTvSadMWN$ )
>>> compiler: clang version 21.0.0git (https://urldefense.com/v3/__https://github.com/llvm/llvm-project__;!!ACWV5N9M2RV99hQ!NYsFjZmx0oSNmGPOQ57M8FqiwN9x_0uNHOsZ0H_bxMZw11U8F1-i2FIS7wctmB4sSockZwPpufGxuROeTvn1221-$  f819f46284f2a79790038e1f6649172789734ae8)
>>> reproduce (this is a W=1 build): (https://urldefense.com/v3/__https://download.01.org/0day-ci/archive/20250419/202504190950.rq1NDlDz-lkp@intel.com/reproduce__;!!ACWV5N9M2RV99hQ!NYsFjZmx0oSNmGPOQ57M8FqiwN9x_0uNHOsZ0H_bxMZw11U8F1-i2FIS7wctmB4sSockZwPpufGxuROeTuWmwFGg$ )
>>>
>>> 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://urldefense.com/v3/__https://lore.kernel.org/oe-kbuild-all/202504190950.rq1NDlDz-lkp@intel.com/__;!!ACWV5N9M2RV99hQ!NYsFjZmx0oSNmGPOQ57M8FqiwN9x_0uNHOsZ0H_bxMZw11U8F1-i2FIS7wctmB4sSockZwPpufGxuROeTgKlYSkL$
>>>
>>> All warnings (new ones prefixed by >>):
>>>
>>>>> fs/ocfs2/aops.c:1133:17: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
>>>      1133 |                         wc->w_folios[i] = NULL;
>>>           |                                      ^
>>>     fs/ocfs2/aops.c:1101:12: note: initialize the variable 'i' to silence this warning
>>>      1101 |         int ret, i;
>>>           |                   ^
>>>           |                    = 0
>>
>> There appears to be something funky going on with "ocfs2: fix panic in
>> failed foilio allocation" in your tree, perhaps as a result of applying
>> v2 to mm-nonmm-unstable and v1 to mm-hotfixes-unstable? If you compare
>> https://urldefense.com/v3/__https://git.kernel.org/akpm/mm/c/392a664f6d2740eeae23df0d29b56f444f558a7c__;!!ACWV5N9M2RV99hQ!NYsFjZmx0oSNmGPOQ57M8FqiwN9x_0uNHOsZ0H_bxMZw11U8F1-i2FIS7wctmB4sSockZwPpufGxuROeTnnwerZK$
>> to https://urldefense.com/v3/__https://lore.kernel.org/c879a52b-835c-4fa0-902b-8b2e9196dcbd@oracle.com/__;!!ACWV5N9M2RV99hQ!NYsFjZmx0oSNmGPOQ57M8FqiwN9x_0uNHOsZ0H_bxMZw11U8F1-i2FIS7wctmB4sSockZwPpufGxuROeTnn7W1rC$ ,
>> the second hunks do not match, which is what this is warning about. I
>> see this same warning in next-20250422.
> 
> Thanks.  Confirms that the universe is a plot to confuse akpm.
> 
> I dropped everything and remerged the v2 patch.
> 

Thank-you for remerging the patch.
I did see the automaic tool complaint and I visually verified the 
indexes and discredited the complaint.

--Mark Tinguely


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-23 14:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-19  1:21 [akpm-mm:mm-nonmm-unstable 66/67] fs/ocfs2/aops.c:1133:17: warning: variable 'i' is uninitialized when used here kernel test robot
2025-04-22 20:12 ` Nathan Chancellor
2025-04-23  0:55   ` Andrew Morton
2025-04-23 14:13     ` [External] : " Mark Tinguely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox