diff mbox series

[14/14] lustre: llite: use d_is_symlink to test if dentry is a symlink

Message ID 1620087016-17857-15-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series Update to OpenSFS tree as of May 3, 2021 | expand

Commit Message

James Simmons May 4, 2021, 12:10 a.m. UTC
From: Mr NeilBrown <neilb@suse.de>

Using d_is_symlink() is preferred to testing ->get_link or
->follow_link.

A recent patch made this work for foreign files/dirs by making sure
the entry type in d_flags is correct, so we can simplify the code in
ll_revalidate_dentry().

Fixes: 94875289c356 ("lustre: llite: fake symlink type of foreign file/dir")
WC-bug-id: https://jira.whamcloud.com/browse/LU-6142
Lustre-commit: 36b1e4c4142f8a72 ("LU-6142 llite: use d_is_symlink to test if dentry is a symlink")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/41770
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/llite/dcache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/lustre/llite/dcache.c b/fs/lustre/llite/dcache.c
index f8b82d6..24af33e 100644
--- a/fs/lustre/llite/dcache.c
+++ b/fs/lustre/llite/dcache.c
@@ -253,7 +253,7 @@  static int ll_revalidate_dentry(struct dentry *dentry,
 	 * real symlinks. This will allow to open foreign symlink file/dir
 	 * for get[dir]stripe/unlock ioctl()s.
 	 */
-	if (dentry->d_inode && dentry->d_inode->i_op->get_link) {
+	if (d_is_symlink(dentry)) {
 		if (!S_ISLNK(dentry->d_inode->i_mode) &&
 		    !(lookup_flags & LOOKUP_FOLLOW))
 			return 0;