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
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);