summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-01-12 10:32:51 +1100
committerNathan Scott <nathans@sgi.com>2006-01-12 10:32:51 +1100
commit0d1335b3106687d87fcfa0e4d90f2a961bd7e1db (patch)
tree0da896892a40ed56eb02d58601089d9d2b67c382
parent3762ec6bf76cdd32653c409dbad09f7b85807c68 (diff)
downloadop-kernel-dev-0d1335b3106687d87fcfa0e4d90f2a961bd7e1db.zip
op-kernel-dev-0d1335b3106687d87fcfa0e4d90f2a961bd7e1db.tar.gz
[XFS] Fix follow_link when dealing with symlinks larger than 256 bytes.
Thanks to Yamamoto Takashi. SGI-PV: 947953 SGI-Modid: xfs-linux-melb:xfs-kern:24962a Signed-off-by: Nathan Scott <nathans@sgi.com>
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index d388d14..1294039 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -546,7 +546,7 @@ linvfs_follow_link(
ASSERT(dentry);
ASSERT(nd);
- link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL);
+ link = (char *)kmalloc(MAXPATHLEN+1, GFP_KERNEL);
if (!link) {
nd_set_link(nd, ERR_PTR(-ENOMEM));
return NULL;
@@ -562,12 +562,12 @@ linvfs_follow_link(
vp = LINVFS_GET_VP(dentry->d_inode);
iov.iov_base = link;
- iov.iov_len = MAXNAMELEN;
+ iov.iov_len = MAXPATHLEN;
uio->uio_iov = &iov;
uio->uio_offset = 0;
uio->uio_segflg = UIO_SYSSPACE;
- uio->uio_resid = MAXNAMELEN;
+ uio->uio_resid = MAXPATHLEN;
uio->uio_iovcnt = 1;
VOP_READLINK(vp, uio, 0, NULL, error);
@@ -575,7 +575,7 @@ linvfs_follow_link(
kfree(link);
link = ERR_PTR(-error);
} else {
- link[MAXNAMELEN - uio->uio_resid] = '\0';
+ link[MAXPATHLEN - uio->uio_resid] = '\0';
}
kfree(uio);
OpenPOWER on IntegriCloud