fs: use a consume fence in mnt_idmap()
authorMateusz Guzik <mjguzik@gmail.com>
Sat, 30 Nov 2024 05:17:11 +0000 (06:17 +0100)
committerChristian Brauner <brauner@kernel.org>
Sun, 22 Dec 2024 10:29:52 +0000 (11:29 +0100)
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>
Link: https://lore.kernel.org/r/20241130051712.1036527-1-mjguzik@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/mount.h

index c34c18b4e8f36f27775c4df624890eb8e6060965..33f17b6e873236360eed818a9a36b50e22f4f0be 100644 (file)
@@ -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);