ovl: fix nested overlayfs mount
Amir Goldstein
maintainerPATCH 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
@@ -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
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
-EPERMand aborts.Fix this by returning
-ENODATAinstead of-EPERMfromovl_own_xattr_get(). This behavior is consistent with the behavior ofovl_listxattr(), which filters out the private overlayfs xattrs.
Yes, it makes sense regardless of the features xattr.
Applied.
Thanks,
Miklos