Fwd: [PATCH] cifs: revalidate mapping when doing direct writes

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

 



---------- Forwarded message ---------
From: Steve French <smfrench@xxxxxxxxx>
Date: Mon, Sep 12, 2022 at 12:30 AM
Subject: Re: [PATCH] cifs: revalidate mapping when doing direct writes
To: Ronnie Sahlberg <lsahlber@xxxxxxxxxx>
Cc: linux-cifs <linux-cifs@xxxxxxxxxxxxxxx>, Ronnie Sahlberg
<lsahlber@xxxxxxxxxx>


added cc:stable and tentatively merged into cifs-2.6.git for-next
pending testing

Also let me know if you think this could address any long standing
xfstest failures

On Sun, Sep 11, 2022 at 10:05 PM Ronnie Sahlberg <lsahlber@xxxxxxxxxx> wrote:
>
> Kernel bugzilla: 216301
>
> When doing direct writes we need to also invalidate the mapping in case
> we have a cached copy of the affected page(s) in memory or else
> subsequent reads of the data might return the old/stale content
> before we wrote an update to the server.
>
> Signed-off-by: Ronnie Sahlberg <lsahlber@xxxxxxxxxx>
> ---
>  fs/cifs/file.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index fa738adc031f..6f38b134a346 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -3575,6 +3575,9 @@ static ssize_t __cifs_writev(
>
>  ssize_t cifs_direct_writev(struct kiocb *iocb, struct iov_iter *from)
>  {
> +       struct file *file = iocb->ki_filp;
> +
> +       cifs_revalidate_mapping(file->f_inode);
>         return __cifs_writev(iocb, from, true);
>  }
>
> --
> 2.35.3
>


-- 
Thanks,

Steve


-- 
Thanks,

Steve



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux