All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Btrfs: remove useless check for copy_items() return value
@ 2020-04-21 10:25 fdmanana
  2020-04-23  0:42 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: fdmanana @ 2020-04-21 10:25 UTC (permalink / raw)
  To: linux-btrfs

From: Filipe Manana <fdmanana@suse.com>

At btrfs_log_prealloc_extents() we are checking if copy_items() returns a
value greater than 0. That used to happen in the past to signal the caller
that the path given to it was released and reused for other searches, but
as of commit 0e56315ca147b3 ("Btrfs: fix missing hole after hole punching
and fsync when using NO_HOLES"), the copy_items() function does not have
that behaviour anymore and always returns 0 or a negative value. So just
remove that check at btrfs_log_prealloc_extents(), which the previously
mentioned commit forgot to remove.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/tree-log.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 9761e6d538fb..0352ba62ec2b 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -4336,12 +4336,9 @@ static int btrfs_log_prealloc_extents(struct btrfs_trans_handle *trans,
 			}
 		}
 	}
-	if (ins_nr > 0) {
+	if (ins_nr > 0)
 		ret = copy_items(trans, inode, dst_path, path,
 				 start_slot, ins_nr, 1, 0);
-		if (ret > 0)
-			ret = 0;
-	}
 out:
 	btrfs_release_path(path);
 	btrfs_free_path(dst_path);
-- 
2.11.0


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

* Re: [PATCH] Btrfs: remove useless check for copy_items() return value
  2020-04-21 10:25 [PATCH] Btrfs: remove useless check for copy_items() return value fdmanana
@ 2020-04-23  0:42 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2020-04-23  0:42 UTC (permalink / raw)
  To: fdmanana; +Cc: linux-btrfs

On Tue, Apr 21, 2020 at 11:25:31AM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> At btrfs_log_prealloc_extents() we are checking if copy_items() returns a
> value greater than 0. That used to happen in the past to signal the caller
> that the path given to it was released and reused for other searches, but
> as of commit 0e56315ca147b3 ("Btrfs: fix missing hole after hole punching
> and fsync when using NO_HOLES"), the copy_items() function does not have
> that behaviour anymore and always returns 0 or a negative value. So just
> remove that check at btrfs_log_prealloc_extents(), which the previously
> mentioned commit forgot to remove.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Added to misc-next, thanks.

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

end of thread, other threads:[~2020-04-23  0:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 10:25 [PATCH] Btrfs: remove useless check for copy_items() return value fdmanana
2020-04-23  0:42 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.