diff mbox series

btrfs: tests: remove if duplicate in __check_free_space_extents()

Message ID 20200622201841.14619-1-efremov@linux.com
State New, archived
Headers show
Series btrfs: tests: remove if duplicate in __check_free_space_extents() | expand

Commit Message

Denis Efremov June 22, 2020, 8:18 p.m. UTC
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(-)

Comments

David Sterba June 24, 2020, 4:16 p.m. UTC | #1
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.
diff mbox series

Patch

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)