tree:
https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
repair-metadata-atomically
head: 86c04a058fa54dc7345c478b33d9e958a3eafae6
commit: 04cc199fb4900199ac53eea844b6f96d5b9db3af [190/204] xfs: create deferred log items
for extent swapping
config: ia64-defconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 04cc199fb4900199ac53eea844b6f96d5b9db3af
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/uapi/linux/signal.h:6,
from include/linux/signal_types.h:10,
from include/linux/sched.h:29,
from fs/xfs/kmem.h:10,
from fs/xfs/xfs_linux.h:24,
from fs/xfs/xfs.h:22,
from fs/xfs/xfs_trace.c:6:
> arch/ia64/include/uapi/asm/siginfo.h:15:27: error: expected
':', ',', ';', '}' or '__attribute__' before
'.' token
15 | #define si_flags _sifields._sigfault._flags
| ^
fs/xfs/libxfs/xfs_swapext.h:31:12: note: in expansion of macro 'si_flags'
31 | uint64_t si_flags;
| ^~~~~~~~
--
In file included from include/uapi/linux/signal.h:6,
from include/linux/signal_types.h:10,
from include/linux/sched.h:29,
from fs/xfs/kmem.h:10,
from fs/xfs/xfs_linux.h:24,
from fs/xfs/xfs.h:22,
from fs/xfs/libxfs/xfs_swapext.c:6:
> arch/ia64/include/uapi/asm/siginfo.h:15:27: error: expected
':', ',', ';', '}' or '__attribute__' before
'.' token
15 | #define si_flags _sifields._sigfault._flags
| ^
fs/xfs/libxfs/xfs_swapext.h:31:12: note: in expansion of macro 'si_flags'
31 | uint64_t si_flags;
| ^~~~~~~~
fs/xfs/libxfs/xfs_swapext.c: In function 'xfs_swapext_finish_one':
> fs/xfs/libxfs/xfs_swapext.c:221:18: error: 'struct
xfs_swapext_intent' has no member named '_sifields'
221 |
whichfork = (sxi->si_flags & XFS_SWAP_EXTENT_ATTR_FORK) ?
| ^~
fs/xfs/libxfs/xfs_swapext.c:328:9: error: 'struct xfs_swapext_intent' has no
member named 'si_isize1'
328 | sxi->si_isize1);
| ^~
> fs/xfs/libxfs/xfs_swapext.c:330:9: error: 'struct
xfs_swapext_intent' has no member named 'si_isize2'
330 |
sxi->si_isize2);
| ^~
fs/xfs/libxfs/xfs_swapext.c:350:10: error: 'struct xfs_swapext_intent' has no
member named '_sifields'
350 | (sxi->si_flags & XFS_SWAP_EXTENT_SET_SIZES)) {
| ^~
fs/xfs/libxfs/xfs_swapext.c:351:33: error: 'struct xfs_swapext_intent' has no
member named 'si_isize1'
351 | sxi->si_ip1->i_d.di_size = sxi->si_isize1;
| ^~
fs/xfs/libxfs/xfs_swapext.c:352:33: error: 'struct xfs_swapext_intent' has no
member named 'si_isize2'
352 | sxi->si_ip2->i_d.di_size = sxi->si_isize2;
| ^~
fs/xfs/libxfs/xfs_swapext.c: In function 'xfs_swapext_init_intent':
fs/xfs/libxfs/xfs_swapext.c:374:5: error: 'struct xfs_swapext_intent' has no
member named '_sifields'
374 | sxi->si_flags = 0;
| ^~
fs/xfs/libxfs/xfs_swapext.c:376:6: error: 'struct xfs_swapext_intent' has no
member named '_sifields'
376 | sxi->si_flags |= XFS_SWAP_EXTENT_ATTR_FORK;
| ^~
fs/xfs/libxfs/xfs_swapext.c:377:5: error: 'struct xfs_swapext_intent' has no
member named 'si_isize1'
377 | sxi->si_isize1 = sxi->si_isize2 = -1;
| ^~
fs/xfs/libxfs/xfs_swapext.c:377:22: error: 'struct xfs_swapext_intent' has no
member named 'si_isize2'
377 | sxi->si_isize1 = sxi->si_isize2 = -1;
| ^~
fs/xfs/libxfs/xfs_swapext.c:379:6: error: 'struct xfs_swapext_intent' has no
member named '_sifields'
379 | sxi->si_flags |= XFS_SWAP_EXTENT_SET_SIZES;
| ^~
fs/xfs/libxfs/xfs_swapext.c:380:6: error: 'struct xfs_swapext_intent' has no
member named 'si_isize1'
380 | sxi->si_isize1 = ip2->i_d.di_size;
| ^~
fs/xfs/libxfs/xfs_swapext.c:381:6: error: 'struct xfs_swapext_intent' has no
member named 'si_isize2'
381 | sxi->si_isize2 = ip1->i_d.di_size;
| ^~
--
In file included from include/uapi/linux/signal.h:6,
from include/linux/signal_types.h:10,
from include/linux/sched.h:29,
from fs/xfs/kmem.h:10,
from fs/xfs/xfs_linux.h:24,
from fs/xfs/xfs.h:22,
from fs/xfs/xfs_swapext_item.c:6:
> arch/ia64/include/uapi/asm/siginfo.h:15:27: error: expected
':', ',', ';', '}' or '__attribute__' before
'.' token
15 | #define si_flags _sifields._sigfault._flags
| ^
fs/xfs/libxfs/xfs_swapext.h:31:12: note: in expansion of macro 'si_flags'
31 | uint64_t si_flags;
| ^~~~~~~~
fs/xfs/xfs_swapext_item.c: In function 'xfs_swapext_log_item':
> fs/xfs/xfs_swapext_item.c:315:21: error: 'struct
xfs_swapext_intent' has no member named 'si_isize1'
315 |
se->se_isize1 = sxi->si_isize1;
| ^~
fs/xfs/xfs_swapext_item.c:316:21: error: 'struct xfs_swapext_intent' has no
member named 'si_isize2'
316 | se->se_isize2 = sxi->si_isize2;
| ^~
> fs/xfs/xfs_swapext_item.c:317:20: error: 'struct
xfs_swapext_intent' has no member named '_sifields'
317 |
se->se_flags = sxi->si_flags;
| ^~
fs/xfs/xfs_swapext_item.c: In function 'xfs_sxi_recover':
fs/xfs/xfs_swapext_item.c:518:5: error: 'struct xfs_swapext_intent' has no
member named '_sifields'
518 | sxi.si_flags = se->se_flags;
| ^
fs/xfs/xfs_swapext_item.c:522:5: error: 'struct xfs_swapext_intent' has no
member named 'si_isize1'
522 | sxi.si_isize1 = se->se_isize1;
| ^
fs/xfs/xfs_swapext_item.c:523:5: error: 'struct xfs_swapext_intent' has no
member named 'si_isize2'
523 | sxi.si_isize2 = se->se_isize2;
| ^
vim +221 fs/xfs/libxfs/xfs_swapext.c
208
209 /* Finish one extent swap, possibly log more. */
210 int
211 xfs_swapext_finish_one(
212 struct xfs_trans *tp,
213 struct xfs_swapext_intent *sxi)
214 {
215 struct xfs_bmbt_irec irec1, irec2;
216 int whichfork;
217 int nimaps;
218 int bmap_flags;
219 int error;
220
221 whichfork = (sxi->si_flags & XFS_SWAP_EXTENT_ATTR_FORK) ?
222 XFS_ATTR_FORK : XFS_DATA_FORK;
223 bmap_flags = xfs_bmapi_aflag(whichfork);
224
225 while (sxi->si_blockcount > 0) {
226 int64_t ip1_delta = 0, ip2_delta = 0;
227
228 /* Read extent from the first file */
229 nimaps = 1;
230 error = xfs_bmapi_read(sxi->si_ip1, sxi->si_startoff1,
231 sxi->si_blockcount, &irec1, &nimaps,
232 bmap_flags);
233 if (error)
234 return error;
235 if (nimaps != 1 ||
236 irec1.br_startblock == DELAYSTARTBLOCK ||
237 irec1.br_startoff != sxi->si_startoff1) {
238 /*
239 * We should never get no mapping or a delalloc extent
240 * or something that doesn't match what we asked for,
241 * since the caller flushed both inodes and we hold the
242 * ILOCKs for both inodes.
243 */
244 ASSERT(0);
245 return -EINVAL;
246 }
247
248 /* Read extent from the second file */
249 nimaps = 1;
250 error = xfs_bmapi_read(sxi->si_ip2, sxi->si_startoff2,
251 irec1.br_blockcount, &irec2, &nimaps,
252 bmap_flags);
253 if (error)
254 return error;
255 if (nimaps != 1 ||
256 irec2.br_startblock == DELAYSTARTBLOCK ||
257 irec2.br_startoff != sxi->si_startoff2) {
258 /*
259 * We should never get no mapping or a delalloc extent
260 * or something that doesn't match what we asked for,
261 * since the caller flushed both inodes and we hold the
262 * ILOCKs for both inodes.
263 */
264 ASSERT(0);
265 return -EINVAL;
266 }
267
268 /*
269 * We can only swap as many blocks as the smaller of the two
270 * extent maps.
271 */
272 irec1.br_blockcount = min(irec1.br_blockcount,
273 irec2.br_blockcount);
274
275 trace_xfs_swapext_extent1(sxi->si_ip1, &irec1);
276 trace_xfs_swapext_extent2(sxi->si_ip2, &irec2);
277
278 /*
279 * Two extents mapped to the same physical block must not have
280 * different states; that's filesystem corruption. Move on to
281 * the next extent if they're both holes or both the same
282 * physical extent.
283 */
284 if (irec1.br_startblock == irec2.br_startblock) {
285 if (irec1.br_state != irec2.br_state)
286 return -EFSCORRUPTED;
287
288 sxi->si_startoff1 += irec1.br_blockcount;
289 sxi->si_startoff2 += irec1.br_blockcount;
290 sxi->si_blockcount -= irec1.br_blockcount;
291 continue;
292 }
293
294 /* Update quota accounting. */
295 if (xfs_bmap_is_mapped_extent(&irec1)) {
296 ip1_delta -= irec1.br_blockcount;
297 ip2_delta += irec1.br_blockcount;
298 }
299 if (xfs_bmap_is_mapped_extent(&irec2)) {
300 ip1_delta += irec2.br_blockcount;
301 ip2_delta -= irec2.br_blockcount;
302 }
303
304 if (ip1_delta)
305 xfs_trans_mod_dquot_byino(tp, sxi->si_ip1,
306 XFS_TRANS_DQ_BCOUNT, ip1_delta);
307 if (ip2_delta)
308 xfs_trans_mod_dquot_byino(tp, sxi->si_ip2,
309 XFS_TRANS_DQ_BCOUNT, ip2_delta);
310
311 /* Remove both mappings. */
312 xfs_bmap_unmap_extent(tp, sxi->si_ip1, whichfork, &irec1);
313 xfs_bmap_unmap_extent(tp, sxi->si_ip2, whichfork, &irec2);
314
315 /*
316 * Re-add both mappings. We swap the file offsets between the
317 * two maps and add the opposite map, which has the effect of
318 * filling the logical offsets we just unmapped, but with with
319 * the physical mapping information swapped.
320 */
321 swap(irec1.br_startoff, irec2.br_startoff);
322 xfs_bmap_map_extent(tp, sxi->si_ip1, whichfork, &irec2);
323 xfs_bmap_map_extent(tp, sxi->si_ip2, whichfork, &irec1);
324
325 /* Make sure we're not mapping extents past EOF. */
326 if (whichfork == XFS_DATA_FORK) {
327 xfs_swapext_update_size(tp, sxi->si_ip1, &irec2,
328 sxi->si_isize1);
329 xfs_swapext_update_size(tp, sxi->si_ip2, &irec1,
330 sxi->si_isize2);
331 }
332
333 /*
334 * Advance our cursor and exit. The caller (either defer ops
335 * or log recovery) will log the SXD item, and if *blockcount
336 * is nonzero, it will log a new SXI item for the remainder
337 * and call us back.
338 */
339 sxi->si_startoff1 += irec1.br_blockcount;
340 sxi->si_startoff2 += irec1.br_blockcount;
341 sxi->si_blockcount -= irec1.br_blockcount;
342 break;
343 }
344
345 /*
346 * If we've reached the end of the remap operation and the caller
347 * wanted us to exchange the sizes, do that now.
348 */
349 if (sxi->si_blockcount == 0 &&
350 (sxi->si_flags & XFS_SWAP_EXTENT_SET_SIZES)) {
351 sxi->si_ip1->i_d.di_size = sxi->si_isize1;
352 sxi->si_ip2->i_d.di_size = sxi->si_isize2;
353 xfs_trans_log_inode(tp, sxi->si_ip1, XFS_ILOG_CORE);
354 xfs_trans_log_inode(tp, sxi->si_ip2, XFS_ILOG_CORE);
355 }
356
357 if (xfs_swapext_has_more_work(sxi))
358 trace_xfs_swapext_defer(tp->t_mountp, sxi);
359 return 0;
360 }
361
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org