Skip to content

Commit 87b2c60

Browse files
author
Miklos Szeredi
committed
ovl: do not get metacopy for userxattr
When looking up an inode on the lower layer for which the mounter lacks read permisison the metacopy check will fail. This causes the lookup to fail as well, even though the directory is readable. So ignore EACCES for the "userxattr" case and assume no metacopy for the unreadable file. Signed-off-by: Miklos Szeredi <[email protected]>
1 parent b6650da commit 87b2c60

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/overlayfs/util.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,13 @@ int ovl_check_metacopy_xattr(struct ovl_fs *ofs, struct dentry *dentry)
884884
if (res < 0) {
885885
if (res == -ENODATA || res == -EOPNOTSUPP)
886886
return 0;
887+
/*
888+
* getxattr on user.* may fail with EACCES in case there's no
889+
* read permission on the inode. Not much we can do, other than
890+
* tell the caller that this is not a metacopy inode.
891+
*/
892+
if (ofs->config.userxattr && res == -EACCES)
893+
return 0;
887894
goto out;
888895
}
889896

0 commit comments

Comments
 (0)