Thread (14 messages) 14 messages, 2 authors, 2025-01-22
STALE511d

[PATCH 06/11] nfs: use store_release_wake_up() for clearing d_fsdata

From: NeilBrown <hidden>
Date: 2024-12-06 02:19:34
Subsystem: filesystems (vfs and infrastructure), nfs, sunrpc, and lockd clients, the rest · Maintainers: Alexander Viro, Christian Brauner, Trond Myklebust, Anna Schumaker, Linus Torvalds

The barrier provided by smp_store_release() is before the store, while
wake_up_var() needs a full barrier *after* the store.

The new store_release_wake_up() interface encodes all the barriers
making this sort of bug harder to write.

Signed-off-by: NeilBrown <redacted>
---
 fs/nfs/dir.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 492cffd9d3d8..ded86facef8f 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1837,9 +1837,7 @@ static void block_revalidate(struct dentry *dentry)
 
 static void unblock_revalidate(struct dentry *dentry)
 {
-	/* store_release ensures wait_var_event() sees the update */
-	smp_store_release(&dentry->d_fsdata, NULL);
-	wake_up_var(&dentry->d_fsdata);
+	store_release_wake_up(&dentry->d_fsdata, NULL);
 }
 
 /*
-- 
2.47.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help