Sukadev Bhattiprolu wrote:
> One comment below.

Thanks .. (and the other reviews as well - I fixed all of them)

[...]

> | +static char *
> | +cr_fill_fname(struct path *path, struct path *root, char *buf, int *n)
> | +{
> | +   struct path tmp = *root;
> | +   char *fname;
> | +
> | +   BUG_ON(!buf);
> | +   spin_lock(&dcache_lock);
> | +   fname = __d_path(path, &tmp, buf, *n);
> | +   spin_unlock(&dcache_lock);
> | +   if (!IS_ERR(fname))
> | +           *n = (buf + (*n) - fname);
> | +   /*
> | +    * FIXME: if __d_path() changed these, it must have stepped out of
> | +    * init's namespace. Since currently we require a unified namespace
> | +    * within the container: simply fail.
> | +    */
> | +   if (tmp.mnt != root->mnt || tmp.dentry != root->dentry)
> | +           fname = ERR_PTR(-EBADF);
> | 
> 
> Shouldn't this be under if (!IS_ERR(fname)) ? 'tmp' may be uninitialized
> if __d_path() fails with ENAMETOOLONG. Even otherwise, it may be better
> to report the error from __dpath() first ?
> 

True, fixed.

Oren.
_______________________________________________
Containers mailing list
contain...@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
Devel@openvz.org
https://openvz.org/mailman/listinfo/devel

Reply via email to