aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2016-10-11 13:26:17 +0530
committerAmit Pundir <amit.pundir@linaro.org>2017-01-16 15:54:02 +0530
commit65117109f6344fa46542f85844bc292842116192 (patch)
treebe2e8f2c73b13efdec2b093969596312639f042e
parentcb67f58a757cea1b816f1f992c2f3d6f67d005a6 (diff)
ANDROID: sdcardfs: Propagate dentry down to inode_change_ok()
Since commit 31051c85b5e2 ("fs: Give dentry to inode_change_ok() instead of inode"), to avoid clearing of capabilities or security related extended attributes too early, inode_change_ok() will need to take dentry instead of inode. Propagate it down to sdcardfs_setattr() and also rename it to setattr_prepare(), otherwise we run into following build error: CC [M] fs/sdcardfs/inode.o fs/sdcardfs/inode.c: In function ‘sdcardfs_setattr’: fs/sdcardfs/inode.c:644:8: error: implicit declaration of function ‘inode_change_ok’ [-Werror=implicit-function-declaration] err = inode_change_ok(inode, ia); ^ Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r--fs/sdcardfs/inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/sdcardfs/inode.c b/fs/sdcardfs/inode.c
index 17435631ca1f..878546ff78b2 100644
--- a/fs/sdcardfs/inode.c
+++ b/fs/sdcardfs/inode.c
@@ -639,11 +639,11 @@ static int sdcardfs_setattr(struct dentry *dentry, struct iattr *ia)
inode = d_inode(dentry);
/*
- * Check if user has permission to change inode. We don't check if
+ * Check if user has permission to change dentry. We don't check if
* this user can change the lower inode: that should happen when
* calling notify_change on the lower inode.
*/
- err = inode_change_ok(inode, ia);
+ err = setattr_prepare(dentry, ia);
/* no vfs_XXX operations required, cred overriding will be skipped. wj*/
if (!err) {