mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
ovl: port ovl_fadvise() to cred guard
Use the scoped ovl cred guard. Link: https://patch.msgid.link/20251117-work-ovl-cred-guard-v4-11-b31603935724@kernel.org Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -508,18 +508,13 @@ out_unlock:
|
||||
static int ovl_fadvise(struct file *file, loff_t offset, loff_t len, int advice)
|
||||
{
|
||||
struct file *realfile;
|
||||
const struct cred *old_cred;
|
||||
int ret;
|
||||
|
||||
realfile = ovl_real_file(file);
|
||||
if (IS_ERR(realfile))
|
||||
return PTR_ERR(realfile);
|
||||
|
||||
old_cred = ovl_override_creds(file_inode(file)->i_sb);
|
||||
ret = vfs_fadvise(realfile, offset, len, advice);
|
||||
ovl_revert_creds(old_cred);
|
||||
|
||||
return ret;
|
||||
with_ovl_creds(file_inode(file)->i_sb)
|
||||
return vfs_fadvise(realfile, offset, len, advice);
|
||||
}
|
||||
|
||||
enum ovl_copyop {
|
||||
|
||||
Reference in New Issue
Block a user