summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMateusz Guzik <mjguzik@gmail.com>2025-10-09 09:59:16 +0200
committerChristian Brauner <brauner@kernel.org>2025-10-20 20:22:26 +0200
commitcb5db358ab5769cbd3e8e864f14af321126cccdb (patch)
tree2807b05689012041edcb49917026e0490599f37d /include/linux
parentaf6023e2ce0a3d4d948885d464b0ddca4b8b1fdf (diff)
fs: spell out fenced ->i_state accesses with explicit smp_wmb/smp_rmb
The incomming helpers don't ship with _release/_acquire variants, for the time being anyway. Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/backing-dev.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 3e64f14739dd..065cba5dc111 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -277,10 +277,11 @@ unlocked_inode_to_wb_begin(struct inode *inode, struct wb_lock_cookie *cookie)
rcu_read_lock();
/*
- * Paired with store_release in inode_switch_wbs_work_fn() and
+ * Paired with a release fence in inode_do_switch_wbs() and
* ensures that we see the new wb if we see cleared I_WB_SWITCH.
*/
- cookie->locked = smp_load_acquire(&inode->i_state) & I_WB_SWITCH;
+ cookie->locked = inode->i_state & I_WB_SWITCH;
+ smp_rmb();
if (unlikely(cookie->locked))
xa_lock_irqsave(&inode->i_mapping->i_pages, cookie->flags);