mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
ovl: port ovl_set_link_redirect() to cred guard
Use the scoped ovl cred guard. Link: https://patch.msgid.link/20251117-work-ovl-cred-guard-v4-4-b31603935724@kernel.org Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -731,14 +731,8 @@ static int ovl_symlink(struct mnt_idmap *idmap, struct inode *dir,
|
||||
|
||||
static int ovl_set_link_redirect(struct dentry *dentry)
|
||||
{
|
||||
const struct cred *old_cred;
|
||||
int err;
|
||||
|
||||
old_cred = ovl_override_creds(dentry->d_sb);
|
||||
err = ovl_set_redirect(dentry, false);
|
||||
ovl_revert_creds(old_cred);
|
||||
|
||||
return err;
|
||||
with_ovl_creds(dentry->d_sb)
|
||||
return ovl_set_redirect(dentry, false);
|
||||
}
|
||||
|
||||
static int ovl_link(struct dentry *old, struct inode *newdir,
|
||||
|
||||
Reference in New Issue
Block a user