Skip to contentSkip to conversation

brtfs: less- and greater than confusion

PATCH In review Roel Kluin 5 participants 6 messages Jul 12, 2009 – Jul 13, 2009 Btrfs file system

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 brtfs: less- and greater than confusion

Without this the loop won't start

---

fs/btrfs/volumes.c +1 -1
index 3ab80e9..2c873c9 100644
@@ -2795,7 +2795,7 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
 		}
 	}
 
-	for (i = 0; i > nr; i++) {
+	for (i = 0; i < nr; i++) {
 		struct btrfs_multi_bio *multi;
 		struct btrfs_bio_stripe *stripe;
 		int ret;
#1 lore raw
Quoted 9 lines · Roel Kluin

Without this the loop won't start

---

fs/btrfs/volumes.c +0 -0
index 3ab80e9..2c873c9 100644

fs/btrfs/volumes.c int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, · line 2801

Quoted 8 lines
fs/btrfs/volumes.c +1 -1
@@ -2795,7 +2795,7 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
 		}
 	}
 
-	for (i = 0; i > nr; i++) {
+	for (i = 0; i < nr; i++) {
 		struct btrfs_multi_bio *multi;
 		struct btrfs_bio_stripe *stripe;
 		int ret;

Thanks, this does look buggy. That second loop should just be to verify the first loop didn't mess things up. Yan Zheng, is there any reason we shouldn't delete it?

-chris

#2 lore raw

[ sorry, fixed up cc ]

Quoted 25 lines · Chris Mason
Quoted 9 lines · Roel Kluin

Without this the loop won't start

---

fs/btrfs/volumes.c +0 -0
index 3ab80e9..2c873c9 100644

fs/btrfs/volumes.c int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, · line 2801

Quoted 8 lines
fs/btrfs/volumes.c +1 -1
@@ -2795,7 +2795,7 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
 		}
 	}
 
-	for (i = 0; i > nr; i++) {
+	for (i = 0; i < nr; i++) {
 		struct btrfs_multi_bio *multi;
 		struct btrfs_bio_stripe *stripe;
 		int ret;

Thanks, this does look buggy. That second loop should just be to verify the first loop didn't mess things up. Yan Zheng, is there any reason we shouldn't delete it?

-chris

#3 lore raw
Quoted 25 lines · Chris Mason

[ sorry, fixed up cc ]

Quoted 22 lines · Chris Mason
Quoted 9 lines · Roel Kluin

Without this the loop won't start

---

fs/btrfs/volumes.c +0 -0
index 3ab80e9..2c873c9 100644

fs/btrfs/volumes.c int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, · line 2801

Quoted 8 lines
fs/btrfs/volumes.c +1 -1
@@ -2795,7 +2795,7 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
 		}
 	}
 
-	for (i = 0; i > nr; i++) {
+	for (i = 0; i < nr; i++) {
 		struct btrfs_multi_bio *multi;
 		struct btrfs_bio_stripe *stripe;
 		int ret;

Thanks, this does look buggy. That second loop should just be to verify the first loop didn't mess things up. Yan Zheng, is there any reason we shouldn't delete it?

It's OK to delete it.

Yan Zheng

#4 lore raw
In reply to Chris Mason
Quoted 13 lines · Chris Mason
Quoted 12 lines · Roel Kluin

Without this the loop won't start

---

fs/btrfs/volumes.c +0 -0
index 3ab80e9..2c873c9 100644
@@ -2795,7 +2795,7 @@ int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
 		}
 	}
 
Quoted 9 lines

fs/btrfs/volumes.c int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, · line 2801

Quoted 5 lines
fs/btrfs/volumes.c +1 -1
-	for (i = 0; i > nr; i++) {
+	for (i = 0; i < nr; i++) {
 		struct btrfs_multi_bio *multi;
 		struct btrfs_bio_stripe *stripe;
 		int ret;

Thanks, this does look buggy. That second loop should just be to verify the first loop didn't mess things up. Yan Zheng, is there any reason we shouldn't delete it?

I deleted it in my tree because it made my head hurt for RAID5:
http://git.infradead.org/users/dwmw2/btrfs-raid56.git?a=commitdiff;h=93562d49

Signature · 2 lines
David Woodhouse                            Open Source Technology Centre
[email protected]                              Intel Corporation
#5 lore raw
In reply to Chris Mason

2009/7/13 Chris Mason <[email protected]>:

Quoted 10 lines · Roel Kluin

fs/btrfs/volumes.c int btrfs_rmap_block(struct btrfs_mapping_tree=

Quoted 9 lines

Without this the loop won't start

---

fs/btrfs/volumes.c +0 -0
index 3ab80e9..2c873c9 100644
@@ -2795,7 +2795,7 @@ int btrfs_rmap_block(struct btrfs_mapping_tree=

*map_tree,

Quoted 10 lines

fs/btrfs/volumes.c int btrfs_rmap_block(struct btrfs_mapping_tree= · line 2801

Quoted 8 lines
fs/btrfs/volumes.c +1 -1
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
 =A0 =A0 =A0 }
 
- =A0 =A0 for (i =3D 0; i > nr; i++) {
+ =A0 =A0 for (i =3D 0; i < nr; i++) {
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct btrfs_multi_bio *multi;
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct btrfs_bio_stripe *stripe;
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 int ret;

Thanks, this does look buggy. =A0That second loop should just be to v=

erify

Quoted 1 line

the first loop didn't mess things up. =A0Yan Zheng, is there any reas=

on we

Quoted 2 lines

shouldn't delete it?

It's OK to delete it.

Yan Zheng
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html