Re: [PATCH 6.6 438/744] ovl: add helper ovl_file_modified()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 6, 2024 at 5:18 PM Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> 6.6-stable review patch.  If anyone has any objections, please let me know.
>

As I wrote here:
https://lore.kernel.org/stable/CAOQ4uxj6y0TJs9ZEzGCY4UkqUc1frcEOZsnP4UnWvGtQX89mRA@xxxxxxxxxxxxxx/

No objection to this patch, but this patch in itself is useless for stable.
It is being backported as
 Stable-dep-of: 7c98f7cb8fda ("remove call_{read,write}_iter() functions")
and I think the decision to backport 7c98f7cb8fda is wrong.
I think that the Fixes: tag in 7c98f7cb8fda is misleading to think that this
is a bug fix - it is not.

I wonder how my feedback on Sasha's series got lost?

Thanks,
Amir.

> ------------------
>
> From: Amir Goldstein <amir73il@xxxxxxxxx>
>
> [ Upstream commit c002728f608183449673818076380124935e6b9b ]
>
> A simple wrapper for updating ovl inode size/mtime, to conform
> with ovl_file_accessed().
>
> Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
> Stable-dep-of: 7c98f7cb8fda ("remove call_{read,write}_iter() functions")
> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
> ---
>  fs/overlayfs/file.c | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
> index 8be4dc050d1ed..9fd88579bfbfb 100644
> --- a/fs/overlayfs/file.c
> +++ b/fs/overlayfs/file.c
> @@ -235,6 +235,12 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence)
>         return ret;
>  }
>
> +static void ovl_file_modified(struct file *file)
> +{
> +       /* Update size/mtime */
> +       ovl_copyattr(file_inode(file));
> +}
> +
>  static void ovl_file_accessed(struct file *file)
>  {
>         struct inode *inode, *upperinode;
> @@ -290,10 +296,8 @@ static void ovl_aio_cleanup_handler(struct ovl_aio_req *aio_req)
>         struct kiocb *orig_iocb = aio_req->orig_iocb;
>
>         if (iocb->ki_flags & IOCB_WRITE) {
> -               struct inode *inode = file_inode(orig_iocb->ki_filp);
> -
>                 kiocb_end_write(iocb);
> -               ovl_copyattr(inode);
> +               ovl_file_modified(orig_iocb->ki_filp);
>         }
>
>         orig_iocb->ki_pos = iocb->ki_pos;
> @@ -403,7 +407,7 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter)
>                                      ovl_iocb_to_rwf(ifl));
>                 file_end_write(real.file);
>                 /* Update size */
> -               ovl_copyattr(inode);
> +               ovl_file_modified(file);
>         } else {
>                 struct ovl_aio_req *aio_req;
>
> @@ -489,7 +493,7 @@ static ssize_t ovl_splice_write(struct pipe_inode_info *pipe, struct file *out,
>
>         file_end_write(real.file);
>         /* Update size */
> -       ovl_copyattr(inode);
> +       ovl_file_modified(out);
>         revert_creds(old_cred);
>         fdput(real);
>
> @@ -570,7 +574,7 @@ static long ovl_fallocate(struct file *file, int mode, loff_t offset, loff_t len
>         revert_creds(old_cred);
>
>         /* Update size */
> -       ovl_copyattr(inode);
> +       ovl_file_modified(file);
>
>         fdput(real);
>
> @@ -654,7 +658,7 @@ static loff_t ovl_copyfile(struct file *file_in, loff_t pos_in,
>         revert_creds(old_cred);
>
>         /* Update size */
> -       ovl_copyattr(inode_out);
> +       ovl_file_modified(file_out);
>
>         fdput(real_in);
>         fdput(real_out);
> --
> 2.43.0
>
>
>





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux