Skip to contentSkip to conversation

ocfs2: Fix contiguousness check in ocfs2_try_to_merge_extent_map()

PATCH In review Roel Kluin 2 participants 2 messages Feb 5, 2010 OCFS2

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 ocfs2: Fix contiguousness check in ocfs2_try_to_merge_extent_map()

The wrong member was compared in the continguousness check.

---

Quoted 5 lines
Quoted 4 lines
        } else if ((ins->ei_phys + ins->ei_clusters) == emi->ei_phys &&
                   (ins->ei_cpos + ins->ei_clusters) == emi->ei_phys &&

should that 2nd emi->ei_phys be emi->ei_cpos?

oh, yes, you are right. Do you want to provide a patch?

Here, I added your ack.

fs/ocfs2/extent_map.c +1 -1
index d35a27f..5328529 100644
@@ -192,7 +192,7 @@ static int ocfs2_try_to_merge_extent_map(struct ocfs2_extent_map_item *emi,
 		emi->ei_clusters += ins->ei_clusters;
 		return 1;
 	} else if ((ins->ei_phys + ins->ei_clusters) == emi->ei_phys &&
-		   (ins->ei_cpos + ins->ei_clusters) == emi->ei_phys &&
+		   (ins->ei_cpos + ins->ei_clusters) == emi->ei_cpos &&
 		   ins->ei_flags == emi->ei_flags) {
 		emi->ei_phys = ins->ei_phys;
 		emi->ei_cpos = ins->ei_cpos;
#1 lore raw
Quoted 4 lines · Roel Kluin

The wrong member was compared in the continguousness check.

This patch is now in the fixes branch of ocfs2.git.

Joel

Signature · 9 lines
"Sometimes when reading Goethe I have the paralyzing suspicion
 that he is trying to be funny."
         - Guy Davenport

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127