mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
xfs: don't leak new_bp if xfs_btree_bload_drop_buf fails
LOLLM observes that in xfs_btree_bload_prep_block,
xfs_btree_bload_drop_buf can hit an IO error if writing the delwri
buffer list to disk fails. In this case, we fail to release new_bp,
which means we lose a locked buffer. Fix that.
Cc: stable@vger.kernel.org # v6.8
Fixes: e069d54970 ("xfs: constrain dirty buffers while formatting a staged btree")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
5287e56cba
commit
f1930bc578
|
|
@ -336,8 +336,10 @@ xfs_btree_bload_prep_block(
|
|||
xfs_btree_set_sibling(cur, *blockp, &new_ptr, XFS_BB_RIGHTSIB);
|
||||
|
||||
ret = xfs_btree_bload_drop_buf(bbl, buffers_list, bpp);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
xfs_buf_relse(new_bp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Initialize the new btree block. */
|
||||
xfs_btree_init_block_cur(cur, new_bp, level, nr_this_block);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user