summaryrefslogtreecommitdiff
path: root/fs/sdcardfs
diff options
context:
space:
mode:
authorDaniel Rosenberg <drosen@google.com>2017-03-09 21:24:58 -0800
committerAmit Pundir <amit.pundir@linaro.org>2017-04-10 13:29:53 +0530
commit2c852b7279a7a406631d671a9ede48420fb1e85f (patch)
tree388046a417823833cb9e3d509b780f82670f1619 /fs/sdcardfs
parent4e2cd7c27606e5666d679b692242132d9abdebb8 (diff)
ANDROID: sdcardfs: copy lower inode attributes in ->ioctl
Adapted from wrapfs commit fbc9c6f83ea6 ("Wrapfs: copy lower inode attributes in ->ioctl") commit e97d8e26cc9e ("Wrapfs: use file_inode helper") Some ioctls (e.g., EXT2_IOC_SETFLAGS) can change inode attributes, so copy them from lower inode. Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu> Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 35766959 Change-Id: I0f12684b9dbd4088b4a622c7ea9c03087f40e572
Diffstat (limited to 'fs/sdcardfs')
-rw-r--r--fs/sdcardfs/file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/sdcardfs/file.c b/fs/sdcardfs/file.c
index 7e2c50b30782..41a550fec3f2 100644
--- a/fs/sdcardfs/file.c
+++ b/fs/sdcardfs/file.c
@@ -113,6 +113,10 @@ static long sdcardfs_unlocked_ioctl(struct file *file, unsigned int cmd,
if (lower_file->f_op->unlocked_ioctl)
err = lower_file->f_op->unlocked_ioctl(lower_file, cmd, arg);
+ /* some ioctls can change inode attributes (EXT2_IOC_SETFLAGS) */
+ if (!err)
+ sdcardfs_copy_and_fix_attrs(file_inode(file),
+ file_inode(lower_file));
out:
return err;
}