ovl: don't check sticky
Since commit 07a2daab49
("ovl: Copy up underlying inode's ->i_mode to
overlay inode") sticky checking on overlay inode is performed by the vfs,
so checking against sticky on underlying inode is not needed.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
parent
804032fabb
commit
99f5d08e36
|
@ -717,28 +717,12 @@ out_unlock:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int ovl_check_sticky(struct dentry *dentry)
|
|
||||||
{
|
|
||||||
struct inode *dir = ovl_dentry_real(dentry->d_parent)->d_inode;
|
|
||||||
struct inode *inode = ovl_dentry_real(dentry)->d_inode;
|
|
||||||
|
|
||||||
if (check_sticky(dir, inode))
|
|
||||||
return -EPERM;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int ovl_do_remove(struct dentry *dentry, bool is_dir)
|
static int ovl_do_remove(struct dentry *dentry, bool is_dir)
|
||||||
{
|
{
|
||||||
enum ovl_path_type type;
|
enum ovl_path_type type;
|
||||||
int err;
|
int err;
|
||||||
const struct cred *old_cred;
|
const struct cred *old_cred;
|
||||||
|
|
||||||
|
|
||||||
err = ovl_check_sticky(dentry);
|
|
||||||
if (err)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
err = ovl_want_write(dentry);
|
err = ovl_want_write(dentry);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -804,10 +788,6 @@ static int ovl_rename(struct inode *olddir, struct dentry *old,
|
||||||
|
|
||||||
flags &= ~RENAME_NOREPLACE;
|
flags &= ~RENAME_NOREPLACE;
|
||||||
|
|
||||||
err = ovl_check_sticky(old);
|
|
||||||
if (err)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
/* Don't copy up directory trees */
|
/* Don't copy up directory trees */
|
||||||
old_type = ovl_path_type(old);
|
old_type = ovl_path_type(old);
|
||||||
err = -EXDEV;
|
err = -EXDEV;
|
||||||
|
@ -815,10 +795,6 @@ static int ovl_rename(struct inode *olddir, struct dentry *old,
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (new->d_inode) {
|
if (new->d_inode) {
|
||||||
err = ovl_check_sticky(new);
|
|
||||||
if (err)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
if (d_is_dir(new))
|
if (d_is_dir(new))
|
||||||
new_is_dir = true;
|
new_is_dir = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue