[btrfs-devel][patch]remove warning when file size is 1

Yan Zheng yanzheng at 21cn.com
Tue Sep 18 00:18:24 PDT 2007


Hello

When file size is 1,  both the 'start' and 'end' of a extent_state are
set to 0 by set_extent_uptodate.

Regards
YZ


diff -r d0921c0349a9 extent_map.c
--- a/extent_map.c	Fri Sep 14 10:23:29 2007 -0400
+++ b/extent_map.c	Tue Sep 18 11:56:17 2007 +0800
@@ -353,7 +353,7 @@ static int insert_state(struct extent_ma
 	state->state |= bits;
 	state->start = start;
 	state->end = end;
-	if ((end & 4095) == 0) {
+	if (end != start && (end & 4095) == 0) {
 		printk("insert state %Lu %Lu strange end\n", start, end);
 		WARN_ON(1);
 	}
@@ -391,7 +391,7 @@ static int split_state(struct extent_map
 	prealloc->end = split - 1;
 	prealloc->state = orig->state;
 	orig->start = split;
-	if ((prealloc->end & 4095) == 0) {
+	if (prealloc->end != prealloc->start && (prealloc->end & 4095) == 0) {
 		printk("insert state %Lu %Lu strange end\n", prealloc->start,
 		       prealloc->end);
 		WARN_ON(1);



More information about the Btrfs-devel mailing list