]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
ovl: do not cleanup unsupported index entries
authorAmir Goldstein <amir73il@gmail.com>
Tue, 24 Oct 2017 09:24:11 +0000 (12:24 +0300)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 16 Nov 2017 13:23:26 +0000 (11:23 -0200)
commit35ae62f849f598e7e484a9843a622189eaca2045
tree8daa1a6b2234a52cc3a4a351532ccb018714edf4
parent2934e427fa6441c8b22cdbb6daa407d513283799
ovl: do not cleanup unsupported index entries

BugLink: http://bugs.launchpad.net/bugs/1731961
commit fa0096e3bad69ed6f34843fd7ae1c45ca987012a upstream.

With index=on, ovl_indexdir_cleanup() tries to cleanup invalid index
entries (e.g. bad index name). This behavior could result in cleaning of
entries created by newer kernels and is therefore undesirable.
Instead, abort mount if such entries are encountered. We still cleanup
'stale' entries and 'orphan' entries, both those cases can be a result
of offline changes to lower and upper dirs.

When encoutering an index entry of type directory or whiteout, kernel
was supposed to fallback to read-only mount, but the fill_super()
operation returns EROFS in this case instead of returning success with
read-only mount flag, so mount fails when encoutering directory or
whiteout index entries. Bless this behavior by returning -EINVAL on
directory and whiteout index entries as we do for all unsupported index
entries.

Fixes: 61b674710cd9 ("ovl: do not cleanup directory and whiteout index..")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
fs/overlayfs/namei.c
fs/overlayfs/readdir.c