All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: tests: remove if duplicate in __check_free_space_extents()
@ 2020-06-22 20:18 Denis Efremov
  2020-06-24 16:16 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Efremov @ 2020-06-22 20:18 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik; +Cc: Denis Efremov, linux-btrfs, linux-kernel

num_extents is already checked in the next if condition and can
be safely removed.

Signed-off-by: Denis Efremov <efremov@linux.com>
---
 fs/btrfs/tests/free-space-tree-tests.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/btrfs/tests/free-space-tree-tests.c b/fs/btrfs/tests/free-space-tree-tests.c
index 914eea5ba6a7..2c783d2f5228 100644
--- a/fs/btrfs/tests/free-space-tree-tests.c
+++ b/fs/btrfs/tests/free-space-tree-tests.c
@@ -60,8 +60,6 @@ static int __check_free_space_extents(struct btrfs_trans_handle *trans,
 				if (prev_bit == 0 && bit == 1) {
 					extent_start = offset;
 				} else if (prev_bit == 1 && bit == 0) {
-					if (i >= num_extents)
-						goto invalid;
 					if (i >= num_extents ||
 					    extent_start != extents[i].start ||
 					    offset - extent_start != extents[i].length)
-- 
2.26.2


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

* Re: [PATCH] btrfs: tests: remove if duplicate in __check_free_space_extents()
  2020-06-22 20:18 [PATCH] btrfs: tests: remove if duplicate in __check_free_space_extents() Denis Efremov
@ 2020-06-24 16:16 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2020-06-24 16:16 UTC (permalink / raw)
  To: Denis Efremov; +Cc: Chris Mason, Josef Bacik, linux-btrfs, linux-kernel

On Mon, Jun 22, 2020 at 11:18:41PM +0300, Denis Efremov wrote:
> num_extents is already checked in the next if condition and can
> be safely removed.
> 
> Signed-off-by: Denis Efremov <efremov@linux.com>

Added to misc-next, thanks.

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

end of thread, other threads:[~2020-06-24 16:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22 20:18 [PATCH] btrfs: tests: remove if duplicate in __check_free_space_extents() Denis Efremov
2020-06-24 16:16 ` 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.