diff mbox series

fs: use a consume fence in mnt_idmap()

Message ID 20241130051712.1036527-1-mjguzik@gmail.com (mailing list archive)
State New
Headers show
Series fs: use a consume fence in mnt_idmap() | expand

Commit Message

Mateusz Guzik Nov. 30, 2024, 5:17 a.m. UTC
The routine is used in link_path_walk() for every path component.

To my reading the entire point of the fence was to grab a fully
populated mnt_idmap, but that's already going to happen with mere
consume fence.

Eliminates an actual fence on arm64.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
---
 include/linux/mount.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christian Brauner Nov. 30, 2024, 12:08 p.m. UTC | #1
On Sat, 30 Nov 2024 06:17:11 +0100, Mateusz Guzik wrote:
> The routine is used in link_path_walk() for every path component.
> 
> To my reading the entire point of the fence was to grab a fully
> populated mnt_idmap, but that's already going to happen with mere
> consume fence.
> 
> Eliminates an actual fence on arm64.
> 
> [...]

Applied to the vfs-6.14.misc branch of the vfs/vfs.git tree.
Patches in the vfs-6.14.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.14.misc

[1/1] fs: use a consume fence in mnt_idmap()
      https://git.kernel.org/vfs/vfs/c/e448a60956bc
diff mbox series

Patch

diff --git a/include/linux/mount.h b/include/linux/mount.h
index c34c18b4e8f3..33f17b6e8732 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -76,7 +76,7 @@  struct vfsmount {
 static inline struct mnt_idmap *mnt_idmap(const struct vfsmount *mnt)
 {
 	/* Pairs with smp_store_release() in do_idmap_mount(). */
-	return smp_load_acquire(&mnt->mnt_idmap);
+	return READ_ONCE(mnt->mnt_idmap);
 }
 
 extern int mnt_want_write(struct vfsmount *mnt);