overlay: Absolute redirect should be followed even if ancestor is opaque
authorVivek Goyal <vgoyal@redhat.com>
Wed, 14 Mar 2018 13:16:18 +0000 (09:16 -0400)
committerEryu Guan <guaneryu@gmail.com>
Fri, 16 Mar 2018 08:30:52 +0000 (16:30 +0800)
commit1afc31f99dd686ae2b37c940f4915453eb2ff4b9
treec3d52455475fd7a210e087bc38e22580d55c0bec
parent2fcd134d393972815739e8c025e45e20f7a4ebe7
overlay: Absolute redirect should be followed even if ancestor is opaque

Typically, when following absolute redirect, if an opauqe dentry is
found, lookup in further lower directories is stopped. But if a child
dentry has another absolute redirect, then lookup in further lower
layers should continue.

Say, following is example setup.
upper:  /redirect (redirect=/a/b/c)
lower1: /a/[b]/c       ([b] is opaque) (c has absolute redirect=/a/b/d/)
lower0: /a/b/d/foo

"redirect" directory in upper should merge with lower1:/a/b/c/ and
lower0:/a/b/d/, despite lower1:/a/b/ being opaque.

This example and kernel fix has come from Amir Goldstein. I am just
putting a test for it to make sure its not broken down the line.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/overlay/057 [new file with mode: 0755]
tests/overlay/057.out [new file with mode: 0644]
tests/overlay/group