public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] v9fs: symlink support fixes
@ 2006-01-21  1:26 Latchesar Ionkov
  0 siblings, 0 replies; only message in thread
From: Latchesar Ionkov @ 2006-01-21  1:26 UTC (permalink / raw)
  To: Andrew Morton; +Cc: v9fs-developer, linux-kernel

two symlink fixes, v9fs_readlink didn't copy the last character of the
symlink name, v9fs_vfs_follow_link incorrectly called strlen of newly
allocated buffer instead of PATH_MAX.

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>

---
commit 80543589e5ab35e0fda3e97f93108f136eb4e623
tree 78150d708f7d815a3aa64967741f1aa9df60be9f
parent 3ee68c4af3fd7228c1be63254b9f884614f9ebb2
author Latchesar Ionkov <lucho@ionkov.net> Fri, 20 Jan 2006 20:20:38 -0500
committer Latchesar Ionkov <lucho@ionkov.net> Fri, 20 Jan 2006 20:20:38 -0500

 fs/9p/vfs_inode.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 91f5524..63e5b03 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -886,8 +886,8 @@ static int v9fs_readlink(struct dentry *
 	}
 
 	/* copy extension buffer into buffer */
-	if (fcall->params.rstat.stat.extension.len < buflen)
-		buflen = fcall->params.rstat.stat.extension.len;
+	if (fcall->params.rstat.stat.extension.len+1 < buflen)
+		buflen = fcall->params.rstat.stat.extension.len + 1;
 
 	memcpy(buffer, fcall->params.rstat.stat.extension.str, buflen - 1);
 	buffer[buflen-1] = 0;
@@ -951,7 +951,7 @@ static void *v9fs_vfs_follow_link(struct
 	if (!link)
 		link = ERR_PTR(-ENOMEM);
 	else {
-		len = v9fs_readlink(dentry, link, strlen(link));
+		len = v9fs_readlink(dentry, link, PATH_MAX);
 
 		if (len < 0) {
 			__putname(link);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-01-21  1:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-21  1:26 [PATCH] v9fs: symlink support fixes Latchesar Ionkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox