[lustre-devel] [PATCH 514/622] lustre: llite: Don't clear d_fsdata in ll_release()

James Simmons jsimmons at infradead.org
Thu Feb 27 13:16:22 PST 2020


From: NeilBrown <neilb at suse.de>

The whole point of using rcu_free() is that some code might
still be accessing the dentry (e.g. lockless lookup) and so
the dentry cannot be freed until the end of the grace
period.

As lockless lookup can accesses d_fsdata -- ll_dcompare calls
d_lustre_invalid() -- we also mustn't clear d_fsdata before
the end of the grace period.
We don't need to clear it at all - by the time it is freed,
the inode will no longer be accessed.

Fixes: 7126bc2e8d60c ("lustre: switch to use of ->d_init()")

Signed-off-by: NeilBrown <neilb at suse.de>
Reviewed-by: James Simmons <jsimmons at infradaed.org>
---
 fs/lustre/llite/dcache.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/lustre/llite/dcache.c b/fs/lustre/llite/dcache.c
index 2dfe12a..3230d32 100644
--- a/fs/lustre/llite/dcache.c
+++ b/fs/lustre/llite/dcache.c
@@ -63,7 +63,6 @@ static void ll_release(struct dentry *de)
 		kfree(lld->lld_it);
 	}
 
-	de->d_fsdata = NULL;
 	call_rcu(&lld->lld_rcu_head, free_dentry_data);
 }
 
-- 
1.8.3.1



More information about the lustre-devel mailing list