[Btrfs-devel][PATCH] Fix "no csum found for inode" issue.

Yan Zheng yanzheng at 21cn.com
Thu Feb 14 14:10:10 PST 2008


Hello,

A few codes were not properly updated for changes of extent map.  This
may be the causes of "no csum found for inode" issue.

Regards
YZ
---
diff -r c048e905f04f extent_io.c
--- a/extent_io.c	Wed Feb 06 11:37:39 2008 -0500
+++ b/extent_io.c	Fri Feb 15 05:30:28 2008 +0800
@@ -2420,9 +2420,11 @@ int try_release_extent_mapping(struct ex

 	if ((mask & __GFP_WAIT) &&
 	    page->mapping->host->i_size > 16 * 1024 * 1024) {
+		u64 len;
 		while (start <= end) {
+			len = end - start + 1;
 			spin_lock(&map->lock);
-			em = lookup_extent_mapping(map, start, end);
+			em = lookup_extent_mapping(map, start, len);
 			if (!em || IS_ERR(em)) {
 				spin_unlock(&map->lock);
 				break;
diff -r c048e905f04f file.c
--- a/file.c	Wed Feb 06 11:37:39 2008 -0500
+++ b/file.c	Fri Feb 15 05:30:28 2008 +0800
@@ -356,10 +356,14 @@ int btrfs_drop_extent_cache(struct inode
 {
 	struct extent_map *em;
 	struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
+	u64 len = end - start + 1;
+	
+	if (end == (u64)-1)
+		len = (u64)-1;

 	while(1) {
 		spin_lock(&em_tree->lock);
-		em = lookup_extent_mapping(em_tree, start, end);
+		em = lookup_extent_mapping(em_tree, start, len);
 		if (!em) {
 			spin_unlock(&em_tree->lock);
 			break;



More information about the Btrfs-devel mailing list