public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: remove duplicate free_async_extent_pages() on reservation error
@ 2023-07-14 15:18 Goldwyn Rodrigues
  2023-07-17 14:08 ` Josef Bacik
  0 siblings, 1 reply; 2+ messages in thread
From: Goldwyn Rodrigues @ 2023-07-14 15:18 UTC (permalink / raw)
  To: linux-btrfs

While performing compressed writes, if the extent reservation fails, the
async extent pages are first free'd in the error check for return value
ret, and then again at "goto out_free".

Remove the first call to free_async_extent_pages().

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index dbbb67293e34..cb742242ce26 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1217,7 +1217,6 @@ static int submit_one_async_extent(struct btrfs_inode *inode,
 				   async_extent->compressed_size,
 				   0, *alloc_hint, &ins, 1, 1);
 	if (ret) {
-		free_async_extent_pages(async_extent);
 		/*
 		 * Here we used to try again by going back to non-compressed
 		 * path for ENOSPC.  But we can't reserve space even for

-- 
Goldwyn

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs: remove duplicate free_async_extent_pages() on reservation error
  2023-07-14 15:18 [PATCH] btrfs: remove duplicate free_async_extent_pages() on reservation error Goldwyn Rodrigues
@ 2023-07-17 14:08 ` Josef Bacik
  0 siblings, 0 replies; 2+ messages in thread
From: Josef Bacik @ 2023-07-17 14:08 UTC (permalink / raw)
  To: Goldwyn Rodrigues; +Cc: linux-btrfs

On Fri, Jul 14, 2023 at 10:18:19AM -0500, Goldwyn Rodrigues wrote:
> While performing compressed writes, if the extent reservation fails, the
> async extent pages are first free'd in the error check for return value
> ret, and then again at "goto out_free".
> 
> Remove the first call to free_async_extent_pages().
> 
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
> 

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-17 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-14 15:18 [PATCH] btrfs: remove duplicate free_async_extent_pages() on reservation error Goldwyn Rodrigues
2023-07-17 14:08 ` Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox