[PATCH] fs: use a consume fence in mnt_idmap()

Mateusz Guzik posted 1 patch 6 days, 20 hours ago
include/linux/mount.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] fs: use a consume fence in mnt_idmap()
Posted by Mateusz Guzik 6 days, 20 hours ago
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(-)

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);
-- 
2.43.0
Re: [PATCH] fs: use a consume fence in mnt_idmap()
Posted by Christian Brauner 6 days, 13 hours ago
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