Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'xfs-fixes-6.13-rc2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Carlos Maiolino:

- Use xchg() in xlog_cil_insert_pcp_aggregate()

- Fix ABBA deadlock on a race between mount and log shutdown

- Fix quota softlimit incoherency on delalloc

- Fix sparse inode limits on runt AG

- remove unknown compat feature checks in SB write valdation

- Eliminate a lockdep false positive

* tag 'xfs-fixes-6.13-rc2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: don't call xfs_bmap_same_rtgroup in xfs_bmap_add_extent_hole_delay
xfs: Use xchg() in xlog_cil_insert_pcp_aggregate()
xfs: prevent mount and log shutdown race
xfs: delalloc and quota softlimit timers are incoherent
xfs: fix sparse inode limits on runt AG
xfs: remove unknown compat feature check in superblock write validation
xfs: eliminate lockdep false positives in xfs_attr_shortform_list

+26 -36
+2 -4
fs/xfs/libxfs/xfs_bmap.c
··· 2620 2620 */ 2621 2621 if ((state & BMAP_LEFT_VALID) && (state & BMAP_LEFT_DELAY) && 2622 2622 left.br_startoff + left.br_blockcount == new->br_startoff && 2623 - left.br_blockcount + new->br_blockcount <= XFS_MAX_BMBT_EXTLEN && 2624 - xfs_bmap_same_rtgroup(ip, whichfork, &left, new)) 2623 + left.br_blockcount + new->br_blockcount <= XFS_MAX_BMBT_EXTLEN) 2625 2624 state |= BMAP_LEFT_CONTIG; 2626 2625 2627 2626 if ((state & BMAP_RIGHT_VALID) && (state & BMAP_RIGHT_DELAY) && ··· 2628 2629 new->br_blockcount + right.br_blockcount <= XFS_MAX_BMBT_EXTLEN && 2629 2630 (!(state & BMAP_LEFT_CONTIG) || 2630 2631 (left.br_blockcount + new->br_blockcount + 2631 - right.br_blockcount <= XFS_MAX_BMBT_EXTLEN)) && 2632 - xfs_bmap_same_rtgroup(ip, whichfork, new, &right)) 2632 + right.br_blockcount <= XFS_MAX_BMBT_EXTLEN))) 2633 2633 state |= BMAP_RIGHT_CONTIG; 2634 2634 2635 2635 /*
+9 -7
fs/xfs/libxfs/xfs_ialloc.c
··· 853 853 * the end of the AG. 854 854 */ 855 855 args.min_agbno = args.mp->m_sb.sb_inoalignmt; 856 - args.max_agbno = round_down(args.mp->m_sb.sb_agblocks, 856 + args.max_agbno = round_down(xfs_ag_block_count(args.mp, 857 + pag_agno(pag)), 857 858 args.mp->m_sb.sb_inoalignmt) - 858 859 igeo->ialloc_blks; 859 860 ··· 2350 2349 return -EINVAL; 2351 2350 } 2352 2351 agbno = XFS_AGINO_TO_AGBNO(mp, agino); 2353 - if (agbno >= mp->m_sb.sb_agblocks) { 2354 - xfs_warn(mp, "%s: agbno >= mp->m_sb.sb_agblocks (%d >= %d).", 2355 - __func__, agbno, mp->m_sb.sb_agblocks); 2352 + if (agbno >= xfs_ag_block_count(mp, pag_agno(pag))) { 2353 + xfs_warn(mp, "%s: agbno >= xfs_ag_block_count (%d >= %d).", 2354 + __func__, agbno, xfs_ag_block_count(mp, pag_agno(pag))); 2356 2355 ASSERT(0); 2357 2356 return -EINVAL; 2358 2357 } ··· 2475 2474 */ 2476 2475 agino = XFS_INO_TO_AGINO(mp, ino); 2477 2476 agbno = XFS_AGINO_TO_AGBNO(mp, agino); 2478 - if (agbno >= mp->m_sb.sb_agblocks || 2477 + if (agbno >= xfs_ag_block_count(mp, pag_agno(pag)) || 2479 2478 ino != xfs_agino_to_ino(pag, agino)) { 2480 2479 error = -EINVAL; 2481 2480 #ifdef DEBUG ··· 2485 2484 */ 2486 2485 if (flags & XFS_IGET_UNTRUSTED) 2487 2486 return error; 2488 - if (agbno >= mp->m_sb.sb_agblocks) { 2487 + if (agbno >= xfs_ag_block_count(mp, pag_agno(pag))) { 2489 2488 xfs_alert(mp, 2490 2489 "%s: agbno (0x%llx) >= mp->m_sb.sb_agblocks (0x%lx)", 2491 2490 __func__, (unsigned long long)agbno, 2492 - (unsigned long)mp->m_sb.sb_agblocks); 2491 + (unsigned long)xfs_ag_block_count(mp, 2492 + pag_agno(pag))); 2493 2493 } 2494 2494 if (ino != xfs_agino_to_ino(pag, agino)) { 2495 2495 xfs_alert(mp,
-7
fs/xfs/libxfs/xfs_sb.c
··· 326 326 * the kernel cannot support since we checked for unsupported bits in 327 327 * the read verifier, which means that memory is corrupt. 328 328 */ 329 - if (xfs_sb_has_compat_feature(sbp, XFS_SB_FEAT_COMPAT_UNKNOWN)) { 330 - xfs_warn(mp, 331 - "Corruption detected in superblock compatible features (0x%x)!", 332 - (sbp->sb_features_compat & XFS_SB_FEAT_COMPAT_UNKNOWN)); 333 - return -EFSCORRUPTED; 334 - } 335 - 336 329 if (!xfs_is_readonly(mp) && 337 330 xfs_sb_has_ro_compat_feature(sbp, XFS_SB_FEAT_RO_COMPAT_UNKNOWN)) { 338 331 xfs_alert(mp,
+2 -1
fs/xfs/xfs_attr_list.c
··· 114 114 * It didn't all fit, so we have to sort everything on hashval. 115 115 */ 116 116 sbsize = sf->count * sizeof(*sbuf); 117 - sbp = sbuf = kmalloc(sbsize, GFP_KERNEL | __GFP_NOFAIL); 117 + sbp = sbuf = kmalloc(sbsize, 118 + GFP_KERNEL | __GFP_NOLOCKDEP | __GFP_NOFAIL); 118 119 119 120 /* 120 121 * Scan the attribute list for the rest of the entries, storing
+11
fs/xfs/xfs_log.c
··· 3456 3456 return false; 3457 3457 3458 3458 /* 3459 + * Ensure that there is only ever one log shutdown being processed. 3460 + * If we allow the log force below on a second pass after shutting 3461 + * down the log, we risk deadlocking the CIL push as it may require 3462 + * locks on objects the current shutdown context holds (e.g. taking 3463 + * buffer locks to abort buffers on last unpin of buf log items). 3464 + */ 3465 + if (test_and_set_bit(XLOG_SHUTDOWN_STARTED, &log->l_opstate)) 3466 + return false; 3467 + 3468 + /* 3459 3469 * Flush all the completed transactions to disk before marking the log 3460 3470 * being shut down. We need to do this first as shutting down the log 3461 3471 * before the force will prevent the log force from flushing the iclogs ··· 3497 3487 spin_lock(&log->l_icloglock); 3498 3488 if (test_and_set_bit(XLOG_IO_ERROR, &log->l_opstate)) { 3499 3489 spin_unlock(&log->l_icloglock); 3490 + ASSERT(0); 3500 3491 return false; 3501 3492 } 3502 3493 spin_unlock(&log->l_icloglock);
+1 -4
fs/xfs/xfs_log_cil.c
··· 171 171 */ 172 172 for_each_cpu(cpu, &ctx->cil_pcpmask) { 173 173 struct xlog_cil_pcp *cilpcp = per_cpu_ptr(cil->xc_pcp, cpu); 174 - int old = READ_ONCE(cilpcp->space_used); 175 174 176 - while (!try_cmpxchg(&cilpcp->space_used, &old, 0)) 177 - ; 178 - count += old; 175 + count += xchg(&cilpcp->space_used, 0); 179 176 } 180 177 atomic_add(count, &ctx->space_used); 181 178 }
+1
fs/xfs/xfs_log_priv.h
··· 458 458 #define XLOG_IO_ERROR 2 /* log hit an I/O error, and being 459 459 shutdown */ 460 460 #define XLOG_TAIL_WARN 3 /* log tail verify warning issued */ 461 + #define XLOG_SHUTDOWN_STARTED 4 /* xlog_force_shutdown() exclusion */ 461 462 462 463 static inline bool 463 464 xlog_recovery_needed(struct xlog *log)
-13
fs/xfs/xfs_qm_syscalls.c
··· 427 427 dst->d_ino_timer = 0; 428 428 dst->d_rt_spc_timer = 0; 429 429 } 430 - 431 - #ifdef DEBUG 432 - if (xfs_dquot_is_enforced(dqp) && dqp->q_id != 0) { 433 - if ((dst->d_space > dst->d_spc_softlimit) && 434 - (dst->d_spc_softlimit > 0)) { 435 - ASSERT(dst->d_spc_timer != 0); 436 - } 437 - if ((dst->d_ino_count > dqp->q_ino.softlimit) && 438 - (dqp->q_ino.softlimit > 0)) { 439 - ASSERT(dst->d_ino_timer != 0); 440 - } 441 - } 442 - #endif 443 430 } 444 431 445 432 /* Return the quota information for the dquot matching id. */