diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2018-07-18 15:44:44 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2018-07-18 15:44:44 +0200 |
commit | fb16043b46831a75c9b076a7262ae035290b0409 (patch) | |
tree | aede88128c9d4ec05c36ac0864d3e01e2f916c34 /fs | |
parent | 573e1784817ca1f13d76a0df636929e983e5de3c (diff) | |
download | linux-stable-fb16043b46831a75c9b076a7262ae035290b0409.tar.gz linux-stable-fb16043b46831a75c9b076a7262ae035290b0409.tar.bz2 linux-stable-fb16043b46831a75c9b076a7262ae035290b0409.zip |
vfs: remove open_flags from d_real()
Opening regular files on overlayfs is now handled via ovl_open(). Remove
the now unused "open_flags" argument from d_op->d_real() and the d_real()
helper.
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/overlayfs/super.c | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index c63beccad4fc..0e84593af84e 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -74,28 +74,10 @@ static void ovl_dentry_release(struct dentry *dentry) } } -static int ovl_check_append_only(struct inode *inode, int flag) -{ - /* - * This test was moot in vfs may_open() because overlay inode does - * not have the S_APPEND flag, so re-check on real upper inode - */ - if (IS_APPEND(inode)) { - if ((flag & O_ACCMODE) != O_RDONLY && !(flag & O_APPEND)) - return -EPERM; - if (flag & O_TRUNC) - return -EPERM; - } - - return 0; -} - static struct dentry *ovl_d_real(struct dentry *dentry, - const struct inode *inode, - unsigned int open_flags) + const struct inode *inode) { struct dentry *real; - int err; /* It's an overlay file */ if (inode && d_inode(dentry) == inode) @@ -107,28 +89,16 @@ static struct dentry *ovl_d_real(struct dentry *dentry, goto bug; } - if (open_flags) { - err = ovl_open_maybe_copy_up(dentry, open_flags); - if (err) - return ERR_PTR(err); - } - real = ovl_dentry_upper(dentry); - if (real && (!inode || inode == d_inode(real))) { - if (!inode) { - err = ovl_check_append_only(d_inode(real), open_flags); - if (err) - return ERR_PTR(err); - } + if (real && (!inode || inode == d_inode(real))) return real; - } real = ovl_dentry_lower(dentry); if (!real) goto bug; /* Handle recursion */ - real = d_real(real, inode, open_flags); + real = d_real(real, inode); if (!inode || inode == d_inode(real)) return real; |