OSDN Git Service

Revert "ovl: modify ovl_permission() to do checks on two inodes"
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / fs / overlayfs / inode.c
index 060482e..013d27d 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <linux/fs.h>
 #include <linux/slab.h>
-#include <linux/cred.h>
 #include <linux/xattr.h>
 #include "overlayfs.h"
 
@@ -92,7 +91,6 @@ int ovl_permission(struct inode *inode, int mask)
        struct ovl_entry *oe;
        struct dentry *alias = NULL;
        struct inode *realinode;
-       const struct cred *old_cred;
        struct dentry *realdentry;
        bool is_upper;
        int err;
@@ -145,18 +143,7 @@ int ovl_permission(struct inode *inode, int mask)
                        goto out_dput;
        }
 
-       /*
-        * Check overlay inode with the creds of task and underlying inode
-        * with creds of mounter
-        */
-       err = generic_permission(inode, mask);
-       if (err)
-               goto out_dput;
-
-       old_cred = ovl_override_creds(inode->i_sb);
        err = __inode_permission(realinode, mask);
-       revert_creds(old_cred);
-
 out_dput:
        dput(alias);
        return err;