Use the scoped ovl cred guard. Reviewed-by: Amir Goldstein Signed-off-by: Christian Brauner --- fs/overlayfs/file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 6c5aa74f63ec..28263ad00dee 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -481,7 +481,6 @@ static long ovl_fallocate(struct file *file, int mode, loff_t offset, loff_t len { struct inode *inode = file_inode(file); struct file *realfile; - const struct cred *old_cred; int ret; inode_lock(inode); @@ -496,9 +495,8 @@ static long ovl_fallocate(struct file *file, int mode, loff_t offset, loff_t len if (IS_ERR(realfile)) goto out_unlock; - old_cred = ovl_override_creds(file_inode(file)->i_sb); + with_ovl_creds(inode->i_sb) ret = vfs_fallocate(realfile, mode, offset, len); - ovl_revert_creds(old_cred); /* Update size */ ovl_file_modified(file); -- 2.47.3