Skip to content
Snippets Groups Projects
Commit b6650dab authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

ovl: do not fail because of O_NOATIME


In case the file cannot be opened with O_NOATIME because of lack of
capabilities, then clear O_NOATIME instead of failing.

Remove WARN_ON(), since it would now trigger if O_NOATIME was cleared.
Noticed by Amir Goldstein.

Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 6939f977
No related branches found
No related tags found
No related merge requests found
...@@ -53,9 +53,10 @@ static struct file *ovl_open_realfile(const struct file *file, ...@@ -53,9 +53,10 @@ static struct file *ovl_open_realfile(const struct file *file,
err = inode_permission(realinode, MAY_OPEN | acc_mode); err = inode_permission(realinode, MAY_OPEN | acc_mode);
if (err) { if (err) {
realfile = ERR_PTR(err); realfile = ERR_PTR(err);
} else if (!inode_owner_or_capable(realinode)) {
realfile = ERR_PTR(-EPERM);
} else { } else {
if (!inode_owner_or_capable(realinode))
flags &= ~O_NOATIME;
realfile = open_with_fake_path(&file->f_path, flags, realinode, realfile = open_with_fake_path(&file->f_path, flags, realinode,
current_cred()); current_cred());
} }
...@@ -75,12 +76,6 @@ static int ovl_change_flags(struct file *file, unsigned int flags) ...@@ -75,12 +76,6 @@ static int ovl_change_flags(struct file *file, unsigned int flags)
struct inode *inode = file_inode(file); struct inode *inode = file_inode(file);
int err; int err;
flags |= OVL_OPEN_FLAGS;
/* If some flag changed that cannot be changed then something's amiss */
if (WARN_ON((file->f_flags ^ flags) & ~OVL_SETFL_MASK))
return -EIO;
flags &= OVL_SETFL_MASK; flags &= OVL_SETFL_MASK;
if (((flags ^ file->f_flags) & O_APPEND) && IS_APPEND(inode)) if (((flags ^ file->f_flags) & O_APPEND) && IS_APPEND(inode))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment