mount namespace + d_path question

David Legault legault.david at gmail.com
Fri Feb 6 08:15:53 EST 2015


Hello,

Question regarding pathnames and mount namespaces. As I understand mount
namespaces enable different processes to mount filesystems at different
locations leading to different paths to the same underlying file.

When you do something like the below in kernel code:

d_path(&file->f_path, filename, PATH_MAX+11);

How can you guarantee that the returned full path is against the root/init
mount namespace instead of the calling process' mount namespace?

Thanks

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150206/1700106f/attachment.html 


More information about the Kernelnewbies mailing list