···46694669EXPORT_SYMBOL(generic_readlink);4670467046714671/**46724672+ * vfs_readlink - copy symlink body into userspace buffer46734673+ * @dentry: dentry on which to get symbolic link46744674+ * @buffer: user memory pointer46754675+ * @buflen: size of buffer46764676+ *46774677+ * Does not touch atime. That's up to the caller if necessary46784678+ *46794679+ * Does not call security hook.46804680+ */46814681+int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen)46824682+{46834683+ struct inode *inode = d_inode(dentry);46844684+46854685+ if (!inode->i_op->readlink)46864686+ return -EINVAL;46874687+46884688+ return inode->i_op->readlink(dentry, buffer, buflen);46894689+}46904690+EXPORT_SYMBOL(vfs_readlink);46914691+46924692+/**46724693 * vfs_get_link - get symlink body46734694 * @dentry: dentry on which to get symbolic link46744695 * @done: caller needs to free returned data with this
+4-4
fs/nfsd/nfs4xdr.c
···35763576 if (!p)35773577 return nfserr_resource;35783578 /*35793579- * XXX: By default, the ->readlink() VFS op will truncate symlinks35803580- * if they would overflow the buffer. Is this kosher in NFSv4? If35813581- * not, one easy fix is: if ->readlink() precisely fills the buffer,35823582- * assume that truncation occurred, and return NFS4ERR_RESOURCE.35793579+ * XXX: By default, vfs_readlink() will truncate symlinks if they35803580+ * would overflow the buffer. Is this kosher in NFSv4? If not, one35813581+ * easy fix is: if vfs_readlink() precisely fills the buffer, assume35823582+ * that truncation occurred, and return NFS4ERR_RESOURCE.35833583 */35843584 nfserr = nfsd_readlink(readlink->rl_rqstp, readlink->rl_fhp,35853585 (char *)p, &maxcount);