Revert "ANDROID: Incremental fs: Fix selinux issues"

This reverts commit 75c93eb439.

Reason for revert: rolling the three fixes into one with feature flag
Bug: 174692664
Test: incfs_test passes
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: I838bed85d6682aba44165a58c22e6a0e10c49d58
Mot-CRs-fixed: (CR)
Reviewed-on: https://gerrit.mot.com/1975975
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: gaoyx9 <gaoyx9@motorola.com>
Submit-Approved: gaoyx9 <gaoyx9@motorola.com>
Tested-by: gaoyx9 <gaoyx9@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
This commit is contained in:
Paul Lawrence 2021-04-22 13:19:19 -07:00 • committed by Xiaojun Ji
commit 288b84103d

View file

@ -903,7 +903,7 @@ static int init_new_file(struct mount_info *mi, struct dentry *dentry,
.dentry = dentry
};
new_file = dentry_open(&path, O_RDWR | O_NOATIME | O_LARGEFILE,
current_cred());
mi->mi_owner);
if (IS_ERR(new_file)) {
error = PTR_ERR(new_file);
@ -1031,7 +1031,7 @@ static int dir_relative_path_resolve(
if (dir_fd < 0)
return dir_fd;
dir_f = dentry_open(base_path, O_RDONLY | O_NOATIME, current_cred());
dir_f = dentry_open(base_path, O_RDONLY | O_NOATIME, mi->mi_owner);
if (IS_ERR(dir_f)) {
error = PTR_ERR(dir_f);
@ -1909,13 +1909,10 @@ static int file_open(struct inode *inode, struct file *file)
struct file *backing_file = NULL;
struct path backing_path = {};
int err = 0;
const struct cred *old_cred;
get_incfs_backing_path(file->f_path.dentry, &backing_path);
old_cred = override_creds(mi->mi_owner);
backing_file = dentry_open(&backing_path,
O_RDWR | O_NOATIME | O_LARGEFILE, current_cred());
revert_creds(old_cred);
backing_file = dentry_open(
&backing_path, O_RDWR | O_NOATIME | O_LARGEFILE, mi->mi_owner);
path_put(&backing_path);
if (IS_ERR(backing_file)) {