public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Patch "Revert "mm/filemap: avoid buffered read/write race to read inconsistent data"" has been added to the 6.6-stable tree
       [not found] <20241011001701.1645057-1-sashal@kernel.org>
@ 2024-10-11  1:44 ` Baokun Li
  2024-10-14  9:33   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Baokun Li @ 2024-10-11  1:44 UTC (permalink / raw)
  To: stable, stable-commits
  Cc: Greg Kroah-Hartman, Matthew Wilcox (Oracle), Andrew Morton,
	Yang Erkun

On 2024/10/11 8:17, Sasha Levin wrote:
> This is a note to let you know that I've just added the patch titled
>
>      Revert "mm/filemap: avoid buffered read/write race to read inconsistent data"
>
> to the 6.6-stable tree which can be found at:
>      http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>
> The filename of the patch is:
>       revert-mm-filemap-avoid-buffered-read-write-race-to-.patch
> and it can be found in the queue-6.6 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.
>
Hi Sasha,

The current patch is a cleanup after adding
smp_load_acquire/store_release() to i_size_read/write().

In my opinion stable versions continue to use smp_rmb just fine,
no need to backport the current patch to stable.

In addition, the current patch belongs to a patch set:

  https://lore.kernel.org/all/20240124142857.4146716-1-libaokun1@huawei.com/

If the current patch does need to be backported to stable, then the
entire patch set needs to be backported or problems will be introduced.

All the patches in the patch set are listed below:

  d8f899d13d72 ("fs: make the i_size_read/write helpers be 
smp_load_acquire/store_release()")
  4b944f8ef996 ("Revert "mm/filemap: avoid buffered read/write race to 
read inconsistent data"")
  ad72872eb3ae ("asm-generic: remove extra type checking in 
acquire/release for non-SMP case")

Thanks,
Baokun
>
> commit d87bcb0965636a9b665231560ce147d06a7a18d8
> Author: Baokun Li <libaokun1@huawei.com>
> Date:   Wed Jan 24 22:28:56 2024 +0800
>
>      Revert "mm/filemap: avoid buffered read/write race to read inconsistent data"
>      
>      [ Upstream commit 4b944f8ef99641d5af287c7d9df91d20ef5d3e88 ]
>      
>      This reverts commit e2c27b803bb6 ("mm/filemap: avoid buffered read/write
>      race to read inconsistent data"). After making the i_size_read/write
>      helpers be smp_load_acquire/store_release(), it is already guaranteed that
>      changes to page contents are visible before we see increased inode size,
>      so the extra smp_rmb() in filemap_read() can be removed.
>      
>      Signed-off-by: Baokun Li <libaokun1@huawei.com>
>      Link: https://lore.kernel.org/r/20240124142857.4146716-3-libaokun1@huawei.com
>      Signed-off-by: Christian Brauner <brauner@kernel.org>
>      Signed-off-by: Sasha Levin <sashal@kernel.org>
>
> diff --git a/mm/filemap.c b/mm/filemap.c
> index e6c112f3a211f..cd028f3be6026 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -2694,15 +2694,6 @@ ssize_t filemap_read(struct kiocb *iocb, struct iov_iter *iter,
>   			goto put_folios;
>   		end_offset = min_t(loff_t, isize, iocb->ki_pos + iter->count);
>   
> -		/*
> -		 * Pairs with a barrier in
> -		 * block_write_end()->mark_buffer_dirty() or other page
> -		 * dirtying routines like iomap_write_end() to ensure
> -		 * changes to page contents are visible before we see
> -		 * increased inode size.
> -		 */
> -		smp_rmb();
> -
>   		/*
>   		 * Once we start copying data, we don't want to be touching any
>   		 * cachelines that might be contended:



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch "Revert "mm/filemap: avoid buffered read/write race to read inconsistent data"" has been added to the 6.6-stable tree
  2024-10-11  1:44 ` Patch "Revert "mm/filemap: avoid buffered read/write race to read inconsistent data"" has been added to the 6.6-stable tree Baokun Li
@ 2024-10-14  9:33   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2024-10-14  9:33 UTC (permalink / raw)
  To: Baokun Li
  Cc: stable, stable-commits, Matthew Wilcox (Oracle), Andrew Morton,
	Yang Erkun

On Fri, Oct 11, 2024 at 09:44:42AM +0800, Baokun Li wrote:
> On 2024/10/11 8:17, Sasha Levin wrote:
> > This is a note to let you know that I've just added the patch titled
> > 
> >      Revert "mm/filemap: avoid buffered read/write race to read inconsistent data"
> > 
> > to the 6.6-stable tree which can be found at:
> >      http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> > 
> > The filename of the patch is:
> >       revert-mm-filemap-avoid-buffered-read-write-race-to-.patch
> > and it can be found in the queue-6.6 subdirectory.
> > 
> > If you, or anyone else, feels it should not be added to the stable tree,
> > please let <stable@vger.kernel.org> know about it.
> > 
> Hi Sasha,
> 
> The current patch is a cleanup after adding
> smp_load_acquire/store_release() to i_size_read/write().
> 
> In my opinion stable versions continue to use smp_rmb just fine,
> no need to backport the current patch to stable.
> 
> In addition, the current patch belongs to a patch set:
> 
>  https://lore.kernel.org/all/20240124142857.4146716-1-libaokun1@huawei.com/
> 
> If the current patch does need to be backported to stable, then the
> entire patch set needs to be backported or problems will be introduced.
> 
> All the patches in the patch set are listed below:
> 
>  d8f899d13d72 ("fs: make the i_size_read/write helpers be
> smp_load_acquire/store_release()")
>  4b944f8ef996 ("Revert "mm/filemap: avoid buffered read/write race to read
> inconsistent data"")
>  ad72872eb3ae ("asm-generic: remove extra type checking in acquire/release
> for non-SMP case")

Ok, now dropped, thanks

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-14  9:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20241011001701.1645057-1-sashal@kernel.org>
2024-10-11  1:44 ` Patch "Revert "mm/filemap: avoid buffered read/write race to read inconsistent data"" has been added to the 6.6-stable tree Baokun Li
2024-10-14  9:33   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox