Whamcloud - gitweb
b=10466
[fs/lustre-release.git] / libsysio / src / symlink.c
index 1925466..ce988b0 100644 (file)
@@ -64,7 +64,7 @@ SYSIO_INTERFACE_NAME(symlink)(const char *oldpath, const char *newpath)
 
        SYSIO_INTERFACE_ENTER;
        INTENT_INIT(&intent, INT_CREAT, NULL, NULL);
-       err = _sysio_namei(_sysio_cwd, newpath, ND_NEGOK, &intent, &pno);
+       err = _sysio_namei(_sysio_cwd, newpath, ND_NOFOLLOW | ND_NEGOK, &intent, &pno);
        if (err)
                goto out;
        if (pno->p_base->pb_ino) {
@@ -76,6 +76,11 @@ SYSIO_INTERFACE_NAME(symlink)(const char *oldpath, const char *newpath)
                err = -EROFS;
                goto error;
        }
+       /*
+        * Use the parent node operations to request the task in case the
+        * driver is implemented using differentiated inode operations based
+        * on file type, such as incore does.
+        */
        err =
            (*pno->p_parent->p_base->pb_ino->i_ops.inop_symlink)(pno, oldpath);
 error: