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-5.5-merge-17' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Darrick Wong:
"Fix a couple of resource management errors and a hang:

- fix a crash in the log setup code when log mounting fails

- fix a hang when allocating space on the realtime device

- fix a block leak when freeing space on the realtime device"

* tag 'xfs-5.5-merge-17' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: fix mount failure crash on invalid iclog memory access
xfs: don't check for AG deadlock for realtime files in bunmapi
xfs: fix realtime file data space leak

+17 -12
+15 -12
fs/xfs/libxfs/xfs_bmap.c
··· 5404 5404 * Make sure we don't touch multiple AGF headers out of order 5405 5405 * in a single transaction, as that could cause AB-BA deadlocks. 5406 5406 */ 5407 - if (!wasdel) { 5407 + if (!wasdel && !isrt) { 5408 5408 agno = XFS_FSB_TO_AGNO(mp, del.br_startblock); 5409 5409 if (prev_agno != NULLAGNUMBER && prev_agno > agno) 5410 5410 break; ··· 5480 5480 } 5481 5481 div_u64_rem(del.br_startblock, mp->m_sb.sb_rextsize, &mod); 5482 5482 if (mod) { 5483 + xfs_extlen_t off = mp->m_sb.sb_rextsize - mod; 5484 + 5483 5485 /* 5484 5486 * Realtime extent is lined up at the end but not 5485 5487 * at the front. We'll get rid of full extents if 5486 5488 * we can. 5487 5489 */ 5488 - mod = mp->m_sb.sb_rextsize - mod; 5489 - if (del.br_blockcount > mod) { 5490 - del.br_blockcount -= mod; 5491 - del.br_startoff += mod; 5492 - del.br_startblock += mod; 5490 + if (del.br_blockcount > off) { 5491 + del.br_blockcount -= off; 5492 + del.br_startoff += off; 5493 + del.br_startblock += off; 5493 5494 } else if (del.br_startoff == start && 5494 5495 (del.br_state == XFS_EXT_UNWRITTEN || 5495 5496 tp->t_blk_res == 0)) { ··· 5508 5507 continue; 5509 5508 } else if (del.br_state == XFS_EXT_UNWRITTEN) { 5510 5509 struct xfs_bmbt_irec prev; 5510 + xfs_fileoff_t unwrite_start; 5511 5511 5512 5512 /* 5513 5513 * This one is already unwritten. ··· 5522 5520 ASSERT(!isnullstartblock(prev.br_startblock)); 5523 5521 ASSERT(del.br_startblock == 5524 5522 prev.br_startblock + prev.br_blockcount); 5525 - if (prev.br_startoff < start) { 5526 - mod = start - prev.br_startoff; 5527 - prev.br_blockcount -= mod; 5528 - prev.br_startblock += mod; 5529 - prev.br_startoff = start; 5530 - } 5523 + unwrite_start = max3(start, 5524 + del.br_startoff - mod, 5525 + prev.br_startoff); 5526 + mod = unwrite_start - prev.br_startoff; 5527 + prev.br_startoff = unwrite_start; 5528 + prev.br_startblock += mod; 5529 + prev.br_blockcount -= mod; 5531 5530 prev.br_state = XFS_EXT_UNWRITTEN; 5532 5531 error = xfs_bmap_add_extent_unwritten_real(tp, 5533 5532 ip, whichfork, &icur, &cur,
+2
fs/xfs/xfs_log.c
··· 1542 1542 prev_iclog = iclog->ic_next; 1543 1543 kmem_free(iclog->ic_data); 1544 1544 kmem_free(iclog); 1545 + if (prev_iclog == log->l_iclog) 1546 + break; 1545 1547 } 1546 1548 out_free_log: 1547 1549 kmem_free(log);