mds: use projected path construction for access
A new CDentry will not have a parent until its projected parent is
flushed to journal. During path construction a given dentry may have no
parent yet which will cause fallbacks to be used (the inode number).
This can cause access checks to fail:
2016-11-17 19:50:43.830207
7eff9977a700 20 Session check_access path #
10000000002/3
compare to an earlier check:
2016-11-17 19:50:43.824223
7eff9977a700 20 Session check_access path /test/1/2
This commit refactors path construction to optionally use projected
parents for the entire chain of directories. Existing use of real stable
parents is unchanged. For example, this line is the same before and
after the patch:
2016-11-18 23:17:15.611680
7f153f97a700 12 mds.0.cache.dir(
10000000002) add_null_dentry [dentry #
10000000002/3 [2,head] auth NULL (dversion lock) pv=0 v=1 inode=0 0x55e0f771f5f0]
Here inode "#
10000000002" has no stable parent yet. So the path is
constructed as "#
10000000002/3".
One notable change in this commit is the removal of
make_path_string_projected which was only used in debugging code. Here's
an example difference:
2016-11-17 19:50:43.827915
7eff9977a700 10 mds.0.server traverse_to_auth_dir [dir
10000000003 {#
10000000003 #
10000000002/3}/ [2,head] auth v=1 cv=0/0 state=
1073741826|complete f() n() hs=0+0,ss=0+0 0x55f5d35e2ee0]
to:
2016-11-18 23:17:15.617757
7f153f97a700 10 mds.0.server traverse_to_auth_dir [dir
10000000003 /test/1/2/3/ [2,head] auth v=1 cv=0/0 state=
1073741826|complete f() n() hs=0+0,ss=0+0 0x55e0f7706ee0]
Fixes: http://tracker.ceph.com/issues/17858
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>