return 1;
/* Symlink - always valid as long as the dentry was found */
+ /* only special case is to prevent ELOOP error from VFS during open
+ * of a foreign symlink file/dir with O_NOFOLLOW, like it happens for
+ * real symlinks. This will allow to open foreign symlink file/dir
+ * for get[dir]stripe/unlock ioctl()s.
+ */
#ifdef HAVE_IOP_GET_LINK
- if (dentry->d_inode && dentry->d_inode->i_op->get_link)
+ if (dentry->d_inode && dentry->d_inode->i_op->get_link) {
#else
- if (dentry->d_inode && dentry->d_inode->i_op->follow_link)
+ if (dentry->d_inode && dentry->d_inode->i_op->follow_link) {
#endif
- return 1;
+ if (!S_ISLNK(dentry->d_inode->i_mode) &&
+ !(lookup_flags & LOOKUP_FOLLOW))
+ return 0;
+ else
+ return 1;
+ }
/*
* VFS warns us that this is the second go around and previous