Overlayfs stacking was broken in 4.1.12 but now fixed in upstream branch.
Stacking allows experimenting with configurations without the need to
reset a device to factory config.

Signed-off-by: Roman Yeryomin <[email protected]>
---
 .../patches-4.1/510-fs-overlay-fix-stacking.patch  | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 
target/linux/generic/patches-4.1/510-fs-overlay-fix-stacking.patch

diff --git a/target/linux/generic/patches-4.1/510-fs-overlay-fix-stacking.patch 
b/target/linux/generic/patches-4.1/510-fs-overlay-fix-stacking.patch
new file mode 100644
index 0000000..5db52d3
--- /dev/null
+++ b/target/linux/generic/patches-4.1/510-fs-overlay-fix-stacking.patch
@@ -0,0 +1,38 @@
+From 1c8a47df36d72ace8cf78eb6c228aa0f8027d3c2 Mon Sep 17 00:00:00 2001
+From: Miklos Szeredi <[email protected]>
+Date: Mon, 12 Oct 2015 15:56:20 +0200
+Subject: ovl: fix open in stacked overlay
+
+If two overlayfs filesystems are stacked on top of each other, then we need
+recursion in ovl_d_select_inode().
+
+I guess d_backing_inode() is supposed to do that.  But currently it doesn't
+and that functionality is open coded in vfs_open().  This is now copied
+into ovl_d_select_inode() to fix this regression.
+
+Reported-by: Alban Crequy <[email protected]>
+Signed-off-by: Miklos Szeredi <[email protected]>
+Fixes: 4bacc9c9234c ("overlayfs: Make f_path always point to the overlay...")
+Cc: David Howells <[email protected]>
+Cc: <[email protected]> # v4.2+
+---
+ fs/overlayfs/inode.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
+index d9da5a4..ec0c2a0 100644
+--- a/fs/overlayfs/inode.c
++++ b/fs/overlayfs/inode.c
+@@ -363,6 +363,9 @@ struct inode *ovl_d_select_inode(struct dentry *dentry, 
unsigned file_flags)
+               ovl_path_upper(dentry, &realpath);
+       }
+ 
++      if (realpath.dentry->d_flags & DCACHE_OP_SELECT_INODE)
++              return realpath.dentry->d_op->d_select_inode(realpath.dentry, 
file_flags);
++
+       return d_backing_inode(realpath.dentry);
+ }
+ 
+-- 
+cgit v0.11.2
+
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to