these patches consolidate the former

301-kmod-fuse-dcache-bug-r4k.patch
302-kmod-fuse-dcache-bug-fuse.patch

of which 302 was missing in trunk's /target/linux/brcm47xx/patches-2.6.{36,37} 
. this let to the reappearance of the DCACHE bug on brcm47xx platforms using 
these kernels (listing a fuse mount point hung indefinitely).

replacing the current half of the patch (301) in 
/target/linux/brcm47xx/patches-2.6.{36,37} with the attached patches will fix 
the issue. the number was raised to bring it closer to other patches modifying 
r4k cache.

please add to trunk. regards bud

diff -Nurp a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
--- a/arch/mips/mm/c-r4k.c	2011-01-16 12:29:16.166698663 +0100
+++ b/arch/mips/mm/c-r4k.c	2011-01-16 12:50:58.041826753 +0100
@@ -373,7 +373,8 @@ static inline void local_r4k___flush_cac
 	}
 }
 
-static void r4k___flush_cache_all(void)
+/* make flush cache available for export */
+void r4k___flush_cache_all(void)
 {
 	r4k_on_each_cpu(local_r4k___flush_cache_all, NULL, 1);
 }
@@ -1469,3 +1470,7 @@ void __cpuinit r4k_cache_init(void)
 	coherency_setup();
 #endif
 }
+
+/* fuse package DCACHE BUG patch exports */
+void (*fuse_flush_cache_all)(void) = r4k___flush_cache_all;
+EXPORT_SYMBOL(fuse_flush_cache_all);
diff -Nurp a/fs/fuse/dev.c b/fs/fuse/dev.c
--- a/fs/fuse/dev.c	2010-12-09 23:17:27.000000000 +0100
+++ b/fs/fuse/dev.c	2011-01-16 12:47:49.524876000 +0100
@@ -639,11 +639,20 @@ static int fuse_copy_fill(struct fuse_co
 	return lock_request(cs->fc, cs->req);
 }
 
+#ifdef DCACHE_BUG
+extern void (*fuse_flush_cache_all)(void);
+#endif
+
 /* Do as much copy to/from userspace buffer as we can */
 static int fuse_copy_do(struct fuse_copy_state *cs, void **val, unsigned *size)
 {
 	unsigned ncpy = min(*size, cs->len);
 	if (val) {
+#ifdef DCACHE_BUG
+		// patch from mailing list, it is very important, otherwise,
+		// can't mount, or ls mount point will hang
+		fuse_flush_cache_all();
+#endif
 		if (cs->write)
 			memcpy(cs->buf, *val, ncpy);
 		else
diff -Nurp a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
--- a/fs/fuse/fuse_i.h	2010-12-09 23:17:27.000000000 +0100
+++ b/fs/fuse/fuse_i.h	2011-01-16 12:48:08.869244000 +0100
@@ -8,6 +8,7 @@
 
 #ifndef _FS_FUSE_I_H
 #define _FS_FUSE_I_H
+#define DCACHE_BUG
 
 #include <linux/fuse.h>
 #include <linux/fs.h>
diff -Nurp a/fs/fuse/inode.c b/fs/fuse/inode.c
--- a/fs/fuse/inode.c	2010-12-09 23:17:27.000000000 +0100
+++ b/fs/fuse/inode.c	2011-01-16 12:49:39.749618000 +0100
@@ -1203,6 +1203,10 @@ static int __init fuse_init(void)
 	printk(KERN_INFO "fuse init (API version %i.%i)\n",
 	       FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION);
 
+#ifdef DCACHE_BUG
+	printk("fuse init DCACHE_BUG workaround enabled\n");
+#endif
+
 	INIT_LIST_HEAD(&fuse_conn_list);
 	res = fuse_fs_init();
 	if (res)

diff -Nurp a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
--- a/arch/mips/mm/c-r4k.c	2011-01-16 14:16:58.298816000 +0100
+++ b/arch/mips/mm/c-r4k.c	2011-01-16 14:35:53.593044000 +0100
@@ -373,7 +373,8 @@ static inline void local_r4k___flush_cac
 	}
 }
 
-static void r4k___flush_cache_all(void)
+/* make flush cache available for export */
+void r4k___flush_cache_all(void)
 {
 	r4k_on_each_cpu(local_r4k___flush_cache_all, NULL);
 }
@@ -1468,3 +1469,7 @@ void __cpuinit r4k_cache_init(void)
 	coherency_setup();
 #endif
 }
+
+/* fuse package DCACHE BUG patch exports */
+void (*fuse_flush_cache_all)(void) = r4k___flush_cache_all;
+EXPORT_SYMBOL(fuse_flush_cache_all);
diff -Nurp a/fs/fuse/dev.c b/fs/fuse/dev.c
--- a/fs/fuse/dev.c	2011-01-05 01:50:19.000000000 +0100
+++ b/fs/fuse/dev.c	2011-01-16 14:35:53.909601000 +0100
@@ -639,11 +639,20 @@ static int fuse_copy_fill(struct fuse_co
 	return lock_request(cs->fc, cs->req);
 }
 
+#ifdef DCACHE_BUG
+extern void (*fuse_flush_cache_all)(void);
+#endif
+
 /* Do as much copy to/from userspace buffer as we can */
 static int fuse_copy_do(struct fuse_copy_state *cs, void **val, unsigned *size)
 {
 	unsigned ncpy = min(*size, cs->len);
 	if (val) {
+#ifdef DCACHE_BUG
+		// patch from mailing list, it is very important, otherwise,
+		// can't mount, or ls mount point will hang
+		fuse_flush_cache_all();
+#endif
 		if (cs->write)
 			memcpy(cs->buf, *val, ncpy);
 		else
diff -Nurp a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
--- a/fs/fuse/fuse_i.h	2011-01-05 01:50:19.000000000 +0100
+++ b/fs/fuse/fuse_i.h	2011-01-16 14:35:54.016239000 +0100
@@ -8,6 +8,7 @@
 
 #ifndef _FS_FUSE_I_H
 #define _FS_FUSE_I_H
+#define DCACHE_BUG
 
 #include <linux/fuse.h>
 #include <linux/fs.h>
diff -Nurp a/fs/fuse/inode.c b/fs/fuse/inode.c
--- a/fs/fuse/inode.c	2011-01-05 01:50:19.000000000 +0100
+++ b/fs/fuse/inode.c	2011-01-16 14:35:54.152580000 +0100
@@ -1202,6 +1202,10 @@ static int __init fuse_init(void)
 	printk(KERN_INFO "fuse init (API version %i.%i)\n",
 	       FUSE_KERNEL_VERSION, FUSE_KERNEL_MINOR_VERSION);
 
+#ifdef DCACHE_BUG
+	printk("fuse init DCACHE_BUG workaround enabled\n");
+#endif
+
 	INIT_LIST_HEAD(&fuse_conn_list);
 	res = fuse_fs_init();
 	if (res)

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to