From 11cd2136a915e9eb3588588de0c163a595f2d41e Mon Sep 17 00:00:00 2001 From: adilger Date: Thu, 8 Sep 2005 18:16:22 +0000 Subject: [PATCH] Branch b1_4 Description: liblustre could not open files whose last component is a symlink Details : sysio_path_walk() would incorrectly pass the open intent to intermediate path components. b=6363 r=oleg, lee, devesh --- libsysio/src/namei.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libsysio/src/namei.c b/libsysio/src/namei.c index c4b6072..9dc7a15 100644 --- a/libsysio/src/namei.c +++ b/libsysio/src/namei.c @@ -257,12 +257,14 @@ _sysio_path_walk(struct pnode *parent, struct nameidata *nd) lpath[cc] = '\0'; /* NUL term */ /* * Handle symbolic links with recursion. Yuck! + * Pass the NULL intent for recursive symlink + * except the last component. */ ND_INIT(&nameidata, (nd->nd_flags | ND_NEGOK), lpath, nd->nd_root, - nd->nd_intent); + !next.len ? nd->nd_intent : NULL); nameidata.nd_slicnt = nd->nd_slicnt + 1; err = _sysio_path_walk(nd->nd_pno->p_parent, &nameidata); -- 1.8.3.1