diff --git a/lustre/llite/symlink.c b/lustre/llite/symlink.c
index 365910fb6c38e58bfd1aae6b7045fea4f8679b3e..b6902bba823b9463cdf10cfc5ffbf6de8e4556b8 100644
--- a/lustre/llite/symlink.c
+++ b/lustre/llite/symlink.c
@@ -163,24 +163,16 @@ static LL_FOLLOW_LINK_RETURN_TYPE ll_follow_link(struct dentry *dentry,
 #endif
 
         CDEBUG(D_VFSTRACE, "VFS Op\n");
-#if THREAD_SIZE < 8192
-        /*
-         *  We set the limits recursive symlink to 5
-         *  instead of default 8 when kernel has 4k stack
-         *  to prevent stack overflow.
-         */
-        if (current->link_count >= 5) {
+        /* Limit the recursive symlink depth to 5 instead of default
+         * 8 links when kernel has 4k stack to prevent stack overflow. */
+        if (THREAD_SIZE < 8192 && current->link_count >= 5) {
                 rc = -ELOOP;
-                GOTO(out_release, rc);
+        } else {
+                ll_inode_size_lock(inode, 0);
+                rc = ll_readlink_internal(inode, &request, &symname);
+                ll_inode_size_unlock(inode, 0);
         }
-#endif
-        ll_inode_size_lock(inode, 0);
-        rc = ll_readlink_internal(inode, &request, &symname);
-        ll_inode_size_unlock(inode, 0);
         if (rc) {
-#if THREAD_SIZE < 8192
-out_release:
-#endif
                 path_release(nd); /* Kernel assumes that ->follow_link()
                                      releases nameidata on error */
                 GOTO(out, rc);