mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 12:03:54 +02:00
ovl: port ovl_llseek() to cred guard
Use the scoped ovl cred guard. Link: https://patch.msgid.link/20251117-work-ovl-cred-guard-v4-8-b31603935724@kernel.org Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
b27ebb3d4b
commit
1fc4bc77c7
|
|
@ -243,7 +243,6 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence)
|
|||
{
|
||||
struct inode *inode = file_inode(file);
|
||||
struct file *realfile;
|
||||
const struct cred *old_cred;
|
||||
loff_t ret;
|
||||
|
||||
/*
|
||||
|
|
@ -272,9 +271,8 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence)
|
|||
ovl_inode_lock(inode);
|
||||
realfile->f_pos = file->f_pos;
|
||||
|
||||
old_cred = ovl_override_creds(inode->i_sb);
|
||||
ret = vfs_llseek(realfile, offset, whence);
|
||||
ovl_revert_creds(old_cred);
|
||||
with_ovl_creds(inode->i_sb)
|
||||
ret = vfs_llseek(realfile, offset, whence);
|
||||
|
||||
file->f_pos = realfile->f_pos;
|
||||
ovl_inode_unlock(inode);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user