Whamcloud - gitweb
b=10466
authorzhanghc <zhanghc>
Fri, 28 Apr 2006 04:39:06 +0000 (04:39 +0000)
committerzhanghc <zhanghc>
Fri, 28 Apr 2006 04:39:06 +0000 (04:39 +0000)
r=adilger@clusterfs.com
description: After calling 'symlink(path, newpath)', of which path(link target)
doesn't exist,  the second symlink call still success, which should return
-EEXIST.

libsysio/src/symlink.c

index a90aba0..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) {