tree:
https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git djwong-wtf
head: dc36d6ffb18ee08b34171a9355b844bbd4534baa
commit: f3744d427b4da5d427216e5be41f7eac9c59c5ce [224/234] xfs: remove old swap extents
implementation
config: parisc-randconfig-r005-20200524 (attached as .config)
compiler: hppa64-linux-gcc (GCC) 9.3.0
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
git checkout f3744d427b4da5d427216e5be41f7eac9c59c5ce
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/mm.h:95,
from fs/xfs/kmem.h:11,
from fs/xfs/xfs_linux.h:24,
from fs/xfs/xfs.h:22,
from fs/xfs/xfs_swaprange.c:11:
include/asm-generic/pgtable.h: In function 'pte_clear_not_present_full':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not
used [-Wunused-but-set-variable]
96 | pte_t old_pte; | ^~~~~~~
arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro
'set_pte_at'
322 | #define pte_clear(mm, addr, xp) set_pte_at(mm, addr, xp, __pte(0))
| ^~~~~~~~~~
include/asm-generic/pgtable.h:202:2: note: in expansion of macro 'pte_clear'
202 | pte_clear(mm, address, ptep);
| ^~~~~~~~~
include/asm-generic/pgtable.h: In function '__ptep_modify_prot_commit':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not
used [-Wunused-but-set-variable]
96 | pte_t old_pte; | ^~~~~~~
include/asm-generic/pgtable.h:641:2: note: in expansion of macro 'set_pte_at'
641 | set_pte_at(vma->vm_mm, addr, ptep, pte);
| ^~~~~~~~~~
fs/xfs/xfs_swaprange.c: In function 'xfs_swap_extent_forks':
> fs/xfs/xfs_swaprange.c:202:12: warning: variable
'temp_blks' set but not used [-Wunused-but-set-variable]
202 | int64_t
temp_blks;
| ^~~~~~~~~
vim +/temp_blks +202 fs/xfs/xfs_swaprange.c
191
192 /* Swap the extents of two files by swapping data forks. */
193 static int
194 xfs_swap_extent_forks(
195 struct xfs_trans **tpp,
196 struct xfs_swapext_req *req)
197 {
198 struct xfs_inode *ip = req->ip1;
199 struct xfs_inode *tip = req->ip2;
200 xfs_filblks_t aforkblks = 0;
201 xfs_filblks_t taforkblks = 0;
202 int64_t temp_blks;
203 xfs_extnum_t junk;
204 uint64_t tmp;
205 unsigned int reflink_state;
206 int src_log_flags = XFS_ILOG_CORE;
207 int target_log_flags = XFS_ILOG_CORE;
208 int error;
209
210 reflink_state = xfs_swapext_reflink_prep(req);
211
212 /*
213 * Count the number of extended attribute blocks
214 */
215 if ( ((XFS_IFORK_Q(ip) != 0) && (ip->i_d.di_anextents > 0))
&&
216 (ip->i_d.di_aformat != XFS_DINODE_FMT_LOCAL)) {
217 error = xfs_bmap_count_blocks(*tpp, ip, XFS_ATTR_FORK, &junk,
218 &aforkblks);
219 if (error)
220 return error;
221 }
222 if ( ((XFS_IFORK_Q(tip) != 0) && (tip->i_d.di_anextents > 0))
&&
223 (tip->i_d.di_aformat != XFS_DINODE_FMT_LOCAL)) {
224 error = xfs_bmap_count_blocks(*tpp, tip, XFS_ATTR_FORK, &junk,
225 &taforkblks);
226 if (error)
227 return error;
228 }
229
230 /*
231 * Btree format (v3) inodes have the inode number stamped in the bmbt
232 * block headers. We can't start changing the bmbt blocks until the
233 * inode owner change is logged so recovery does the right thing in the
234 * event of a crash. Set the owner change log flags now and leave the
235 * bmbt scan as the last step.
236 */
237 if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
238 if (ip->i_d.di_format == XFS_DINODE_FMT_BTREE)
239 target_log_flags |= XFS_ILOG_DOWNER;
240 if (tip->i_d.di_format == XFS_DINODE_FMT_BTREE)
241 src_log_flags |= XFS_ILOG_DOWNER;
242 }
243
244 /*
245 * Swap the data forks of the inodes
246 */
247 swap(ip->i_df, tip->i_df);
248
249 /* Update quota accounting. */
250 temp_blks = tip->i_d.di_nblocks - taforkblks + aforkblks;
251 xfs_trans_mod_dquot_byino(*tpp, ip, XFS_TRANS_DQ_BCOUNT,
252 temp_blks - ip->i_d.di_nblocks);
253
254 temp_blks = ip->i_d.di_nblocks + taforkblks - aforkblks;
255 xfs_trans_mod_dquot_byino(*tpp, tip, XFS_TRANS_DQ_BCOUNT,
256 temp_blks - tip->i_d.di_nblocks);
257
258 /*
259 * Fix the on-disk inode values
260 */
261 tmp = (uint64_t)ip->i_d.di_nblocks;
262 ip->i_d.di_nblocks = tip->i_d.di_nblocks - taforkblks + aforkblks;
263 tip->i_d.di_nblocks = tmp + taforkblks - aforkblks;
264
265 swap(ip->i_d.di_nextents, tip->i_d.di_nextents);
266 swap(ip->i_d.di_format, tip->i_d.di_format);
267
268 /*
269 * The extents in the source inode could still contain speculative
270 * preallocation beyond EOF (e.g. the file is open but not modified
271 * while defrag is in progress). In that case, we need to copy over the
272 * number of delalloc blocks the data fork in the source inode is
273 * tracking beyond EOF so that when the fork is truncated away when the
274 * temporary inode is unlinked we don't underrun the i_delayed_blks
275 * counter on that inode.
276 */
277 ASSERT(tip->i_delayed_blks == 0);
278 tip->i_delayed_blks = ip->i_delayed_blks;
279 ip->i_delayed_blks = 0;
280
281 switch (ip->i_d.di_format) {
282 case XFS_DINODE_FMT_EXTENTS:
283 src_log_flags |= XFS_ILOG_DEXT;
284 break;
285 case XFS_DINODE_FMT_BTREE:
286 ASSERT(!xfs_sb_version_has_v3inode(&ip->i_mount->m_sb) ||
287 (src_log_flags & XFS_ILOG_DOWNER));
288 src_log_flags |= XFS_ILOG_DBROOT;
289 break;
290 }
291
292 switch (tip->i_d.di_format) {
293 case XFS_DINODE_FMT_EXTENTS:
294 target_log_flags |= XFS_ILOG_DEXT;
295 break;
296 case XFS_DINODE_FMT_BTREE:
297 target_log_flags |= XFS_ILOG_DBROOT;
298 ASSERT(!xfs_sb_version_has_v3inode(&ip->i_mount->m_sb) ||
299 (target_log_flags & XFS_ILOG_DOWNER));
300 break;
301 }
302
303 xfs_swapext_reflink_finish(*tpp, req, reflink_state);
304
305 xfs_trans_log_inode(*tpp, ip, src_log_flags);
306 xfs_trans_log_inode(*tpp, tip, target_log_flags);
307
308 /*
309 * The extent forks have been swapped, but crc=1,rmapbt=0 filesystems
310 * have inode number owner values in the bmbt blocks that still refer to
311 * the old inode. Scan each bmbt to fix up the owner values with the
312 * inode number of the current inode.
313 */
314 if (src_log_flags & XFS_ILOG_DOWNER) {
315 error = xfs_swap_change_owner(tpp, ip, tip);
316 if (error)
317 return error;
318 }
319 if (target_log_flags & XFS_ILOG_DOWNER) {
320 error = xfs_swap_change_owner(tpp, tip, ip);
321 if (error)
322 return error;
323 }
324
325 return 0;
326 }
327
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org