summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Rosenberg <drosen@google.com>2018-01-23 14:34:38 -0800
committerDaniel Rosenberg <drosen@google.com>2018-01-24 13:14:17 -0800
commite70c132b2dac4fa9287f08f7572907ed99cbb65b (patch)
tree3f31124fc85ee2eafe83e81c52ade32c3a4ca557
parentef588ef53d3e62d3898e27276d52eda066dbe07e (diff)
ANDROID: xattr: Pass EOPNOTSUPP to permission2
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 <drosen@google.com> Bug: 35848445
-rw-r--r--fs/sdcardfs/inode.c2
-rw-r--r--fs/xattr.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/fs/sdcardfs/inode.c b/fs/sdcardfs/inode.c
index 36c36590bcea..3ef34874fd7b 100644
--- a/fs/sdcardfs/inode.c
+++ b/fs/sdcardfs/inode.c
@@ -625,6 +625,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;
diff --git a/fs/xattr.c b/fs/xattr.c
index 76f01bf4b048..a40f49cc04c3 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -70,7 +70,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);
}
/**