aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-12-03 13:54:33 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-12-03 13:54:33 +0000
commitb9849f286b81ffb65208dd5f4bf6162efe1eca97 (patch)
tree1ac15f0afb693974074a90207ba20d03c8cdfefb
parent2bcbe28580e50b12dcd39865575e7a8576a89cd1 (diff)
downloadupstream-b9849f286b81ffb65208dd5f4bf6162efe1eca97.tar.gz
upstream-b9849f286b81ffb65208dd5f4bf6162efe1eca97.tar.bz2
upstream-b9849f286b81ffb65208dd5f4bf6162efe1eca97.zip
kernel: add overlayfs stacking fix from upstream
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 <roman@advem.lv> Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 47714
-rw-r--r--target/linux/generic/patches-4.1/040-fs-overlay-fix-stacking.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/target/linux/generic/patches-4.1/040-fs-overlay-fix-stacking.patch b/target/linux/generic/patches-4.1/040-fs-overlay-fix-stacking.patch
new file mode 100644
index 0000000000..b3bb5c7e8a
--- /dev/null
+++ b/target/linux/generic/patches-4.1/040-fs-overlay-fix-stacking.patch
@@ -0,0 +1,33 @@
+From 1c8a47df36d72ace8cf78eb6c228aa0f8027d3c2 Mon Sep 17 00:00:00 2001
+From: Miklos Szeredi <miklos@szeredi.hu>
+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 <alban.crequy@gmail.com>
+Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
+Fixes: 4bacc9c9234c ("overlayfs: Make f_path always point to the overlay...")
+Cc: David Howells <dhowells@redhat.com>
+Cc: <stable@vger.kernel.org> # v4.2+
+---
+ fs/overlayfs/inode.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/fs/overlayfs/inode.c
++++ b/fs/overlayfs/inode.c
+@@ -362,6 +362,9 @@ struct inode *ovl_d_select_inode(struct
+ 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);
+ }
+