Skip to content

Commit

Permalink
ANDROID: xattr: Pass EOPNOTSUPP to permission2
Browse files Browse the repository at this point in the history
The permission call for xattr operations happens regardless of
whether or not the xattr functions are implemented.

The xattr functions currently don't have support for permission2.
Passing EOPNOTSUPP as the mount point in xattr_permission allows
us to return EOPNOTSUPP early in permission2, if the filesystem
supports it.

Change-Id: I9d07e4cd633cf40af60450ffbff7ac5c1b4e8c2c
Signed-off-by: Daniel Rosenberg <[email protected]>
Bug: 35848445
  • Loading branch information
drosen-google committed Jan 24, 2018
1 parent e9dabe6 commit 29eadc4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions fs/sdcardfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,8 @@ static int sdcardfs_permission(struct vfsmount *mnt, struct inode *inode, int ma
struct inode tmp;
struct sdcardfs_inode_data *top = top_data_get(SDCARDFS_I(inode));

if (IS_ERR(mnt))
return PTR_ERR(mnt);
if (!top)
return -EINVAL;

Expand Down
2 changes: 1 addition & 1 deletion fs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ xattr_permission(struct inode *inode, const char *name, int mask)
return -EPERM;
}

return inode_permission(inode, mask);
return inode_permission2(ERR_PTR(-EOPNOTSUPP), inode, mask);
}

int
Expand Down

0 comments on commit 29eadc4

Please sign in to comment.