Skip to content

Commit

Permalink
fs/backing_file: fix wrong argument in callback
Browse files Browse the repository at this point in the history
Commit 48b5062 ("backing-file: clean up the API") unintentionally
changed the argument in the ->accessed() callback from the user file to
the backing file.

Fixes: 48b5062 ("backing-file: clean up the API")
Reported-by: [email protected]
Closes: https://lore.kernel.org/linux-unionfs/[email protected]/
Tested-by: [email protected]
Signed-off-by: Amir Goldstein <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Miklos Szeredi <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
  • Loading branch information
amir73il authored and brauner committed Nov 26, 2024
1 parent e767523 commit 2957fa4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/backing-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ int backing_file_mmap(struct file *file, struct vm_area_struct *vma,
struct backing_file_ctx *ctx)
{
const struct cred *old_cred;
struct file *user_file = vma->vm_file;
int ret;

if (WARN_ON_ONCE(!(file->f_mode & FMODE_BACKING)))
Expand All @@ -342,7 +343,7 @@ int backing_file_mmap(struct file *file, struct vm_area_struct *vma,
revert_creds_light(old_cred);

if (ctx->accessed)
ctx->accessed(vma->vm_file);
ctx->accessed(user_file);

return ret;
}
Expand Down

0 comments on commit 2957fa4

Please sign in to comment.