Skip to contentSkip to conversation

ovl: fix nested overlayfs mount

PATCH Applied Amir Goldstein 2 participants 2 messages Nov 16, 2016 Overlay filesystem

lore
Share & tools
lore

Amir Goldstein

author maintainer
#0 lore raw

PATCH 1/1 ovl: fix nested overlayfs mount

The introduction of overlayfs features broke nested mounting of overlayfs as lowerdir of another overlayfs mount.

When the upper overlayfs checks overlayfs features xattr on the underlying overlayfs mount, it gets -EPERM and aborts.

Fix this by returning -ENODATA instead of -EPERM from ovl_own_xattr_get(). This behavior is consistent with the behavior of ovl_listxattr(), which filters out the private overlayfs xattrs.

---
 fs/overlayfs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/overlayfs/super.c +1 -1
index 625fa705..9815f1b 100644
@@ -592,7 +592,7 @@ static int ovl_own_xattr_get(const struct xattr_handler *handler,
 			     struct dentry *dentry, struct inode *inode,
 			     const char *name, void *buffer, size_t size)
 {
-	return -EPERM;
+	return -ENODATA;
 }
 
 static int ovl_own_xattr_set(const struct xattr_handler *handler,
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw
Quoted 10 lines · Amir Goldstein

The introduction of overlayfs features broke nested mounting of overlayfs as lowerdir of another overlayfs mount.

When the upper overlayfs checks overlayfs features xattr on the underlying overlayfs mount, it gets -EPERM and aborts.

Fix this by returning -ENODATA instead of -EPERM from ovl_own_xattr_get(). This behavior is consistent with the behavior of ovl_listxattr(), which filters out the private overlayfs xattrs.

Yes, it makes sense regardless of the features xattr.

Applied.

Thanks,
Miklos