tree:
https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
repair-xattrs
head: 3e70ca2b22ea70af0d1579536c4377530abcc8ee
commit: 78e538ffa882a05793dd6d8a0a10a01e2136023c [44/141] xfs: split the incore dquot type
into a separate field
config: arm64-randconfig-r032-20200714 (attached as .config)
compiler: clang version 11.0.0 (
https://github.com/llvm/llvm-project
02946de3802d3bc65bc9f2eb9b8d4969b5a7add8)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git checkout 78e538ffa882a05793dd6d8a0a10a01e2136023c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> fs/xfs/xfs_dquot.c:262:2: warning: variable 'blftype' is
used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
fs/xfs/xfs_dquot.c:267:30: note: uninitialized use occurs here
xfs_trans_dquot_buf(tp, bp, blftype);
^~~~~~~
fs/xfs/xfs_dquot.c:224:23: note: initialize the variable 'blftype' to silence
this warning
unsigned int blftype;
^
= 0
> fs/xfs/xfs_dquot.c:262:2: warning: variable 'qflag' is
used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
default:
^~~~~~~
fs/xfs/xfs_dquot.c:285:23: note: uninitialized use occurs here
if (!(mp->m_qflags & qflag))
^~~~~
fs/xfs/xfs_dquot.c:223:21: note: initialize the variable 'qflag' to silence
this warning
unsigned int qflag;
^
= 0
2 warnings generated.
vim +/blftype +262 fs/xfs/xfs_dquot.c
208
209 /*
210 * initialize a buffer full of dquots and log the whole thing
211 */
212 STATIC void
213 xfs_qm_init_dquot_blk(
214 struct xfs_trans *tp,
215 struct xfs_mount *mp,
216 xfs_dqid_t id,
217 xfs_dqtype_t type,
218 struct xfs_buf *bp)
219 {
220 struct xfs_quotainfo *q = mp->m_quotainfo;
221 struct xfs_dqblk *d;
222 xfs_dqid_t curid;
223 unsigned int qflag;
224 unsigned int blftype;
225 int i;
226
227 ASSERT(tp);
228 ASSERT(xfs_buf_islocked(bp));
229
230 d = bp->b_addr;
231
232 /*
233 * ID of the first dquot in the block - id's are zero based.
234 */
235 curid = id - (id % q->qi_dqperchunk);
236 memset(d, 0, BBTOB(q->qi_dqchunklen));
237 for (i = 0; i < q->qi_dqperchunk; i++, d++, curid++) {
238 d->dd_diskdq.d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
239 d->dd_diskdq.d_version = XFS_DQUOT_VERSION;
240 d->dd_diskdq.d_id = cpu_to_be32(curid);
241 d->dd_diskdq.d_flags = xfs_dquot_type_to_disk(type);
242 if (xfs_sb_version_hascrc(&mp->m_sb)) {
243 uuid_copy(&d->dd_uuid, &mp->m_sb.sb_meta_uuid);
244 xfs_update_cksum((char *)d, sizeof(struct xfs_dqblk),
245 XFS_DQUOT_CRC_OFF);
246 }
247 }
248
249 switch (type) {
250 case XFS_DQTYPE_USER:
251 qflag = XFS_UQUOTA_CHKD;
252 blftype = XFS_BLF_UDQUOT_BUF;
253 break;
254 case XFS_DQTYPE_PROJ:
255 qflag = XFS_PQUOTA_CHKD;
256 blftype = XFS_BLF_PDQUOT_BUF;
257 break;
258 case XFS_DQTYPE_GROUP:
259 qflag = XFS_GQUOTA_CHKD;
260 blftype = XFS_BLF_GDQUOT_BUF;
261 break;
262 default:
263 ASSERT(0);
264 break;
265 }
266
267 xfs_trans_dquot_buf(tp, bp, blftype);
268
269 /*
270 * quotacheck uses delayed writes to update all the dquots on disk in an
271 * efficient manner instead of logging the individual dquot changes as
272 * they are made. However if we log the buffer allocated here and crash
273 * after quotacheck while the logged initialisation is still in the
274 * active region of the log, log recovery can replay the dquot buffer
275 * initialisation over the top of the checked dquots and corrupt quota
276 * accounting.
277 *
278 * To avoid this problem, quotacheck cannot log the initialised buffer.
279 * We must still dirty the buffer and write it back before the
280 * allocation transaction clears the log. Therefore, mark the buffer as
281 * ordered instead of logging it directly. This is safe for quotacheck
282 * because it detects and repairs allocated but initialized dquot blocks
283 * in the quota inodes.
284 */
285 if (!(mp->m_qflags & qflag))
286 xfs_trans_ordered_buf(tp, bp);
287 else
288 xfs_trans_log_buf(tp, bp, 0, BBTOB(q->qi_dqchunklen) - 1);
289 }
290
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org