[2.1.50] fs/isofs/symlink.c patch

Henrik Wallin (henrik@triton.campus.luth.se)
Fri, 15 Aug 1997 17:31:51 +0200 (CEST)


symlinks on a iso9660-fs (RR) does not work after the changes with inode/dcache.
I have tried to fix this, but as I do not consider myself a good kernel
hacker I hope someone else check this patch..

It works good for me.

regards,
/ Henrik Wallin, henrik@triton.campus.luth.se

--- fs/isofs/symlink.c.old Tue Jun 17 01:35:57 1997
+++ fs/isofs/symlink.c Wed Aug 13 14:29:51 1997
@@ -19,6 +19,7 @@
#include <asm/uaccess.h>

static int isofs_readlink(struct inode *, char *, int);
+static struct dentry * isofs_follow_link(struct inode * inode, struct dentry *base);

/*
* symlinks can't do much...
@@ -35,6 +36,7 @@
NULL, /* mknod */
NULL, /* rename */
isofs_readlink, /* readlink */
+ isofs_follow_link, /* follow_link */
NULL, /* readpage */
NULL, /* writepage */
NULL, /* bmap */
@@ -51,7 +53,6 @@
buflen = 1023;
pnt = get_rock_ridge_symlink(inode);

- iput(inode);
if (!pnt)
return 0;

@@ -62,4 +63,21 @@
i = -EFAULT;
kfree(pnt);
return i;
+}
+
+static struct dentry * isofs_follow_link(struct inode * inode, struct dentry *base)
+{
+ char * pnt;
+
+ pnt = get_rock_ridge_symlink(inode);
+
+ if(!pnt) {
+ dput(base);
+ return ERR_PTR(-ELOOP);
+ }
+
+ base = lookup_dentry(pnt, base, 1);
+
+ kfree(pnt);
+ return base;
}