mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-12 20:35:23 +02:00
Revert "eventfs: Have "events" directory get permissions from its parent"
This reverts commit51a2049a2c
which is commitd57cf30c4c
upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: I5380f87dc4a553b3a1c9108da8c7c21121418a75 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
6ad7f6ea6a
commit
c4bed60157
|
@ -37,7 +37,6 @@ static DEFINE_MUTEX(eventfs_mutex);
|
||||||
|
|
||||||
struct eventfs_root_inode {
|
struct eventfs_root_inode {
|
||||||
struct eventfs_inode ei;
|
struct eventfs_inode ei;
|
||||||
struct inode *parent_inode;
|
|
||||||
struct dentry *events_dir;
|
struct dentry *events_dir;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -227,23 +226,12 @@ static int eventfs_set_attr(struct mnt_idmap *idmap, struct dentry *dentry,
|
||||||
|
|
||||||
static void update_events_attr(struct eventfs_inode *ei, struct super_block *sb)
|
static void update_events_attr(struct eventfs_inode *ei, struct super_block *sb)
|
||||||
{
|
{
|
||||||
struct eventfs_root_inode *rei;
|
struct inode *root;
|
||||||
struct inode *parent;
|
|
||||||
|
|
||||||
rei = get_root_inode(ei);
|
/* Get the tracefs root inode. */
|
||||||
|
root = d_inode(sb->s_root);
|
||||||
/* Use the parent inode permissions unless root set its permissions */
|
ei->attr.uid = root->i_uid;
|
||||||
parent = rei->parent_inode;
|
ei->attr.gid = root->i_gid;
|
||||||
|
|
||||||
if (rei->ei.attr.mode & EVENTFS_SAVE_UID)
|
|
||||||
ei->attr.uid = rei->ei.attr.uid;
|
|
||||||
else
|
|
||||||
ei->attr.uid = parent->i_uid;
|
|
||||||
|
|
||||||
if (rei->ei.attr.mode & EVENTFS_SAVE_GID)
|
|
||||||
ei->attr.gid = rei->ei.attr.gid;
|
|
||||||
else
|
|
||||||
ei->attr.gid = parent->i_gid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_top_events_ownership(struct inode *inode)
|
static void set_top_events_ownership(struct inode *inode)
|
||||||
|
@ -822,7 +810,6 @@ struct eventfs_inode *eventfs_create_events_dir(const char *name, struct dentry
|
||||||
// Note: we have a ref to the dentry from tracefs_start_creating()
|
// Note: we have a ref to the dentry from tracefs_start_creating()
|
||||||
rei = get_root_inode(ei);
|
rei = get_root_inode(ei);
|
||||||
rei->events_dir = dentry;
|
rei->events_dir = dentry;
|
||||||
rei->parent_inode = d_inode(dentry->d_sb->s_root);
|
|
||||||
|
|
||||||
ei->entries = entries;
|
ei->entries = entries;
|
||||||
ei->nr_entries = size;
|
ei->nr_entries = size;
|
||||||
|
@ -832,15 +819,10 @@ struct eventfs_inode *eventfs_create_events_dir(const char *name, struct dentry
|
||||||
uid = d_inode(dentry->d_parent)->i_uid;
|
uid = d_inode(dentry->d_parent)->i_uid;
|
||||||
gid = d_inode(dentry->d_parent)->i_gid;
|
gid = d_inode(dentry->d_parent)->i_gid;
|
||||||
|
|
||||||
|
/* This is used as the default ownership of the files and directories */
|
||||||
ei->attr.uid = uid;
|
ei->attr.uid = uid;
|
||||||
ei->attr.gid = gid;
|
ei->attr.gid = gid;
|
||||||
|
|
||||||
/*
|
|
||||||
* When the "events" directory is created, it takes on the
|
|
||||||
* permissions of its parent. But can be reset on remount.
|
|
||||||
*/
|
|
||||||
ei->attr.mode |= EVENTFS_SAVE_UID | EVENTFS_SAVE_GID;
|
|
||||||
|
|
||||||
INIT_LIST_HEAD(&ei->children);
|
INIT_LIST_HEAD(&ei->children);
|
||||||
INIT_LIST_HEAD(&ei->list);
|
INIT_LIST_HEAD(&ei->list);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user